Closed
Bug 340889
Opened 19 years ago
Closed 19 years ago
Hang on shutdown dealing with close hooks
Categories
(Core :: JavaScript Engine, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: mrbkap, Assigned: mrbkap)
References
Details
(Keywords: hang)
Attachments
(2 files)
1.73 KB,
patch
|
igor
:
review+
|
Details | Diff | Splinter Review |
5.29 KB,
patch
|
igor
:
review+
|
Details | Diff | Splinter Review |
I've been noticing for the past couple of weeks a hang (or pseudo hang, it actually does finish eventually, soemtimes) on shutdown. I finally got it in a debugger today and found a probable cause:
Currently, if we're on the last context and there's more than zero object with a close hook, then we'll set rt->gcPoke to JS_TRUE unconditionally to allow any garbage generated by the close hooks to be collected on the next run. However, if we've already marked all of the objects in the close array, then we'll not call any close hooks, not free any objects, and loop unnecessarily. I think this can only happen with leaked iterators, but I don't think that leaks should cause the GC to hang.
Assignee | ||
Comment 1•19 years ago
|
||
This is a potential patch. If |count != pivot| then that means that we will not call any close hooks (since all of the objects in the close list were marked already), so we can avoid doing any work at all.
This is a diff -w. The real patch will have to include some rewrapping, but I left that out for clarity.
Igor, what do you think?
Attachment #224930 -
Flags: review?(igor.bukanov)
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P1
Comment 2•19 years ago
|
||
Comment on attachment 224930 [details] [diff] [review]
Possible fix -w
If on shutdown rt->gcCloseTable stays above 0, then it must be a leak that keeps some iterators alive. It can be worth to investigate what exactly marks the iterators but for now lets fix this real bug.
Attachment #224930 -
Flags: review?(igor.bukanov) → review+
Assignee | ||
Comment 3•19 years ago
|
||
I'm going to check this in. Igor, if you spot any style problems with this, then go ahead and check them in.
Attachment #224940 -
Flags: review?(igor.bukanov)
Assignee | ||
Comment 4•19 years ago
|
||
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•19 years ago
|
||
I filed bug 340899 on the leaks.
Updated•19 years ago
|
Attachment #224940 -
Flags: review?(igor.bukanov) → review+
Updated•19 years ago
|
Flags: in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•