Bug 65638 - Interpreter can potentially GC in the middle of initializing a structure chain
Summary: Interpreter can potentially GC in the middle of initializing a structure chain
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-03 13:31 PDT by Mark Hahnenberg
Modified: 2011-08-04 11:26 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.94 KB, patch)
2011-08-03 16:19 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Patch (2.14 KB, patch)
2011-08-03 16:42 PDT, Mark Hahnenberg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2011-08-03 13:31:44 PDT
Occasionally when running new-run-webkit-tests we can get a failure when the garbage collector decides to do a collection in the middle of initializing a structure chain in Interpreter.cpp around line 1396.  It's difficult to reproduce on its own due to the fact that it depends on what the garbage collector is doing up to that point of the test.  An easy fix would be to move the allocation of the prototypeChain before calling getOpcode.
Comment 1 Mark Hahnenberg 2011-08-03 16:19:36 PDT
Created attachment 102850 [details]
Patch
Comment 2 Michael Saboff 2011-08-03 16:31:25 PDT
Comment on attachment 102850 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=102850&action=review

> Source/JavaScriptCore/interpreter/Interpreter.cpp:1392
> +        StructureChain* prototypeChain = structure->prototypeChain(callFrame);

I think it make sense to document why you do the call here and use a local so that some future unsuspecting engineer doesn't reintroduce the bug by eliminating the local.
Comment 3 Mark Hahnenberg 2011-08-03 16:42:39 PDT
Created attachment 102859 [details]
Patch
Comment 4 WebKit Review Bot 2011-08-04 11:26:42 PDT
Comment on attachment 102859 [details]
Patch

Clearing flags on attachment: 102859

Committed r92393: <http://trac.webkit.org/changeset/92393>
Comment 5 WebKit Review Bot 2011-08-04 11:26:46 PDT
All reviewed patches have been landed.  Closing bug.