Bug 72089 - JSString forgets to clear m_fibers when resolving ropes
Summary: JSString forgets to clear m_fibers when resolving ropes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-10 21:50 PST by Filip Pizlo
Modified: 2011-11-10 22:40 PST (History)
2 users (show)

See Also:


Attachments
the patch (1.45 KB, patch)
2011-11-10 21:52 PST, Filip Pizlo
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2011-11-10 21:50:59 PST
This can cause some pathological memory usage.  Patch on the way.
Comment 1 Filip Pizlo 2011-11-10 21:52:07 PST
Created attachment 114626 [details]
the patch
Comment 2 WebKit Review Bot 2011-11-10 22:01:41 PST
Attachment 114626 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1

Source/JavaScriptCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Geoffrey Garen 2011-11-10 22:07:00 PST
Might be good to merge your new comment with the comment above, which (now) incorrectly ASSERTs that using a Vector is OK because the string will mark its fibers -- really, using a Vector is only OK because GC just won't happen.

r=me
Comment 4 Geoffrey Garen 2011-11-10 22:08:03 PST
Comment on attachment 114626 [details]
the patch

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

> Source/JavaScriptCore/runtime/JSString.cpp:109
> +        // Clearing here works only because there are no GC points in this method.

Might be good to merge this with the comment above, which ASSERTs that using a Vector is OK -- really, using a Vector is only OK because GC just won't happen.
Comment 5 Filip Pizlo 2011-11-10 22:11:06 PST
(In reply to comment #4)
> (From update of attachment 114626 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=114626&action=review
> 
> > Source/JavaScriptCore/runtime/JSString.cpp:109
> > +        // Clearing here works only because there are no GC points in this method.
> 
> Might be good to merge this with the comment above, which ASSERTs that using a Vector is OK -- really, using a Vector is only OK because GC just won't happen.

Oh, heh, didn't even notice that comment.  I've gone for two comments, one to say that it's OK to put them into the Vector (because there are no GC points) and another to say that it's OK to clear m_fibers (because there are no GC points).  Figure that minimizes the chances of someone getting the wrong ideas.
Comment 6 Filip Pizlo 2011-11-10 22:40:15 PST
Landed in http://trac.webkit.org/changeset/99927