Bug 22052 - Assert and eventual crash when destroying element in an animation CB
Summary: Assert and eventual crash when destroying element in an animation CB
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Chris Marrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-03 12:03 PST by Chris Marrin
Modified: 2008-12-01 15:06 PST (History)
2 users (show)

See Also:


Attachments
testcase that crashes sometimes (2.17 KB, patch)
2008-11-03 13:52 PST, Dean Jackson
no flags Details | Formatted Diff | Diff
Testcase in loadable form (1.46 KB, text/html)
2008-11-03 15:03 PST, Simon Fraser (smfr)
no flags Details
Patch, including LayoutTest file (8.99 KB, patch)
2008-11-03 18:07 PST, Chris Marrin
no flags Details | Formatted Diff | Diff
Replacement patch with more descriptive changelog (9.56 KB, patch)
2008-11-13 11:31 PST, Chris Marrin
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Marrin 2008-11-03 12:03:26 PST
Dean has an example which occasionally asserts and later crashes when destroying an element in an animation end callback. It looks like it is crashing when the element happens to get GC'ed during the callback. 

The assert is at AnimationBase.cpp:475.

I've asked Dean to submit the preliminary test case. I will try to get a layout test which causes the crash when I do the patch.
Comment 1 Dean Jackson 2008-11-03 13:52:06 PST
Created attachment 24864 [details]
testcase that crashes sometimes
Comment 2 Simon Fraser (smfr) 2008-11-03 15:03:26 PST
Created attachment 24871 [details]
Testcase in loadable form
Comment 3 Chris Marrin 2008-11-03 18:07:10 PST
Created attachment 24875 [details]
Patch, including LayoutTest file
Comment 4 Simon Fraser (smfr) 2008-11-03 20:05:38 PST
Comment on attachment 24875 [details]
Patch, including LayoutTest file

>-                // |this| may be deleted here when we've been called from timerFired()

Isn't this comment still valid?

>+    // Toss the ref to all animations

... the refs.. (plural)
Comment 5 Chris Marrin 2008-11-13 11:31:01 PST
Created attachment 25126 [details]
Replacement patch with more descriptive changelog

I fixed the comment made by Simon. The [this] pointer really is always valid at the point where I removed the comment. That is the point of the previous change I made to refcount AnimationBase objects.

I also added details to the Changelog about the fix.
Comment 6 Simon Fraser (smfr) 2008-11-25 21:22:04 PST
<rdar://problem/6401110>
Comment 7 Dave Hyatt 2008-12-01 14:30:49 PST
Comment on attachment 25126 [details]
Replacement patch with more descriptive changelog

r=me
Comment 8 Chris Marrin 2008-12-01 15:06:20 PST
Committed r38768
        M       WebCore/ChangeLog
        M       WebCore/page/animation/AnimationBase.h
        M       WebCore/page/animation/CompositeAnimation.cpp
        M       WebCore/page/animation/AnimationController.cpp
        M       WebCore/page/animation/CompositeAnimation.h
        M       WebCore/page/animation/AnimationBase.cpp
        M       LayoutTests/ChangeLog
        A      
LayoutTests/animations/transform-animation-event-destroy-element.html
        A      
LayoutTests/animations/transform-animation-event-destroy-element-expected.txt
        A      
LayoutTests/transitions/transform-transition-event-destroy-element-expected.txt
        A      
LayoutTests/transitions/transform-transition-event-destroy-element.html
r38768 = 7c14de362f15d6dc75bbd7914f4b8db76e2c1430 (trunk)


I added a couple more tests.