Closed
Bug 374681
Opened 18 years ago
Closed 7 years ago
JS engine warning: 260 GC roots remain after destroying the JSRuntime.
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: bc, Unassigned)
Details
Attachments
(2 files)
(deleted),
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
brendan
:
review-
|
Details | Diff | Splinter Review |
forked from bug 352064
the testcase in attachment 237646 [details] (zip file) in a 1.8.0 (but not 1.8.1) debug build with Java 6 from this morning.
shows lots of
JS engine warning: leaking GC root '&member_descriptor->invoke_func_obj' at 03EA3B34
warnings with a summary
JS engine warning: 260 GC roots remain after destroying the JSRuntime.
These roots may point to freed memory. Objects reachable
through them have not been finalized.
Comment 1•18 years ago
|
||
I wonder if this is because the invoke_func_obj root is being added always, but only removed if the function ptr is non-null?
Comment 2•18 years ago
|
||
(In reply to comment #1)
> I wonder if this is because the invoke_func_obj root is being added always, but
> only removed if the function ptr is non-null?
That would do it... Can you take this one?
/be
Comment 3•18 years ago
|
||
Yeah. Only question is, should I NOT root if the function is null, or should I remove the root regardless? Which is the right direction to go?
Assignee: general → crowder
Comment 5•18 years ago
|
||
Keep whichever one of these you like better.
Attachment #260618 -
Flags: review?(brendan)
Updated•18 years ago
|
Status: NEW → ASSIGNED
Comment 6•18 years ago
|
||
Wait, JS_GetFunctionObject will always return non-null after a successful JS_NewFunction return. So there's no point in the null-check guarding the call to JS_AddNamedRoot. Now the question is: why would the rooted pointer become null?
The first patch is good in any event, and it may be a fix. But how does the pointer become null (if it does)? If it doesn't, then there's no actual bug biting here -- just the latent bug of the null-check guarding the JS_RemoveRoot call.
/be
Comment 7•18 years ago
|
||
All of the memsets on the structure seem only to happen immediately following its allocation and I don't see any other obvious places where this pointer would be getting NULLed out....
Comment 8•18 years ago
|
||
If you are seeing
JS engine warning: leaking GC root '&member_descriptor->invoke_func_obj' at
03EA3B34
then indeed the JS_RemoveRoots are not happening, or are passing the wrong address, being called too late, whatever.
This needs debugging before patching. The first patch is a good change to the current code, but it won't fix the bug AFAICT. Please reproduce with it applied and debug why JS_RemoveRoot ain't working for these named roots.
/be
Updated•18 years ago
|
Attachment #260618 -
Flags: review?(brendan) → review-
Comment 9•18 years ago
|
||
Comment on attachment 260617 [details] [diff] [review]
first proposal, remove root regardless
This can't hurt, could help but we think it won't. Try it?
/be
Attachment #260617 -
Flags: review?(brendan) → review+
Comment 10•18 years ago
|
||
I can still see the same GC warning with the patch.
Comment 11•18 years ago
|
||
Well, I have tried now with 1.8, 1.8.0 and trunk nightly builds and cannot reproduce this bug on Mac OS X; it must be windows-only? I will try on my windows box later.
Comment 12•18 years ago
|
||
Forgot to mention, here is Firefox 1.8.0 debug build on Solaris Nevada.
Comment 13•17 years ago
|
||
jsj_class.c: 1.24
Landed the reviewed patch here, but not closing out the bug as it seems unlikely to fix the problem. Someone else who can reproduce this will have a better chance of fixing it than I did just auditing code, so I am releasing the bug into the wild.
Assignee: crowder → general
Status: ASSIGNED → NEW
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
Comment 14•7 years ago
|
||
Old bug with test case using Java Applet, so probably no longer actionable, therefore resolving as INCOMPLETE.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•