RESOLVED FIXED 158073
[Win] jsc.exe sometimes never exits.
https://bugs.webkit.org/show_bug.cgi?id=158073
Summary [Win] jsc.exe sometimes never exits.
Per Arne Vollan
Reported 2016-05-25 07:50:37 PDT
Sometimes jsc.exe never exits. Debugging shows that is waits for a lock under MachineThreads::removeThreadIfFound when calling jscExit().
Attachments
Patch (2.50 KB, patch)
2016-05-25 08:09 PDT, Per Arne Vollan
no flags
Patch (1.53 KB, patch)
2016-07-22 06:07 PDT, Per Arne Vollan
no flags
Crash log (33.67 KB, application/octet-stream)
2016-07-22 13:25 PDT, Ryan Haddad
no flags
Patch (2.61 KB, patch)
2016-08-25 05:53 PDT, Per Arne Vollan
no flags
Patch (2.11 KB, patch)
2016-12-13 07:16 PST, Per Arne Vollan
darin: review+
Per Arne Vollan
Comment 1 2016-05-25 08:09:24 PDT
Darin Adler
Comment 2 2016-05-30 20:43:28 PDT
Comment on attachment 279771 [details] Patch Ideally I’d like to see a more elegant fix for this. It’s really unfortunate to need the MainThread concept at all in this file; that’s a more fragile higher level concept than the rest of what is here. This should be a lower level class than MainThread. The need to initialize the main thread in jsc.cpp shows this new Windows-only dependency we are creating on the MainThread concept. Is there some Windows-specific way to understand which thread is the main one. It also seems better to not pass the remove function to threadSpecificKeyCreate in the first place rather than adding the function but then having the function do nothing. So I would put the code in the MachineThreads constructor.
David Kilzer (:ddkilzer)
Comment 3 2016-06-21 11:29:41 PDT
Comment on attachment 279771 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=279771&action=review r=me > Source/JavaScriptCore/jsc.cpp:2350 > // Initialize JSC before getting VM. > -#if ENABLE(SAMPLING_REGIONS) > +#if ENABLE(SAMPLING_REGIONS) || OS(WINDOWS) > WTF::initializeMainThread(); > #endif Why is Windows the only OS that needs to call WTF::initializeMainThread()? Is there some Windows-specific initialization that's needed, or does this get initialized in a different places on macOS/iOS?
Per Arne Vollan
Comment 4 2016-06-27 06:19:20 PDT
(In reply to comment #3) > Comment on attachment 279771 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=279771&action=review > > r=me > > > Source/JavaScriptCore/jsc.cpp:2350 > > // Initialize JSC before getting VM. > > -#if ENABLE(SAMPLING_REGIONS) > > +#if ENABLE(SAMPLING_REGIONS) || OS(WINDOWS) > > WTF::initializeMainThread(); > > #endif > > Why is Windows the only OS that needs to call WTF::initializeMainThread()? > > Is there some Windows-specific initialization that's needed, or does this > get initialized in a different places on macOS/iOS? Thanks for reviewing! I added this call, because the implementation on Windows of isMainThread() requires that WTF::initializeMainThread() is called first.
Per Arne Vollan
Comment 5 2016-06-27 06:33:32 PDT
(In reply to comment #2) > Comment on attachment 279771 [details] > Patch > > Ideally I’d like to see a more elegant fix for this. > > It’s really unfortunate to need the MainThread concept at all in this file; > that’s a more fragile higher level concept than the rest of what is here. > This should be a lower level class than MainThread. The need to initialize > the main thread in jsc.cpp shows this new Windows-only dependency we are > creating on the MainThread concept. Is there some Windows-specific way to > understand which thread is the main one. > > It also seems better to not pass the remove function to > threadSpecificKeyCreate in the first place rather than adding the function > but then having the function do nothing. So I would put the code in the > MachineThreads constructor. Thanks for reviewing :) I also see that there is an additional difference in how the pthread and Windows thread specific implementation work. On Windows, the destructor is also called when threadSpecificKeyDelete is called, see https://msdn.microsoft.com/en-us/library/windows/desktop/ms682665(v=vs.85).aspx. This does not seem to be the case with the pthread implementation, as far as I can see. With this in mind, I think this patch needs a little more work.
Per Arne Vollan
Comment 6 2016-07-22 06:07:39 PDT
Mark Lam
Comment 7 2016-07-22 10:17:56 PDT
Comment on attachment 284328 [details] Patch r=me
Per Arne Vollan
Comment 8 2016-07-22 11:05:13 PDT
(In reply to comment #7) > Comment on attachment 284328 [details] > Patch > > r=me Thanks for reviewing!
WebKit Commit Bot
Comment 9 2016-07-22 11:27:04 PDT
Comment on attachment 284328 [details] Patch Clearing flags on attachment: 284328 Committed r203603: <http://trac.webkit.org/changeset/203603>
WebKit Commit Bot
Comment 10 2016-07-22 11:27:10 PDT
All reviewed patches have been landed. Closing bug.
Ryan Haddad
Comment 11 2016-07-22 13:25:30 PDT
Created attachment 284367 [details] Crash log This change seems to have caused CLoop tests to fail with this assertion: mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: x = new Function(); x.toString = Object.prototype.toString; x.charAt = String.prototype.charAt; x.charAt(17) = PASSED! mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: ASSERTION FAILED: m_apiLock->currentThreadIsHoldingLock() mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: /Volumes/Data/slave/elcapitan-cloop-debug/build/Source/JavaScriptCore/runtime/VM.cpp(364) : JSC::VM::~VM() mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 1 0x103a9b0e0 WTFCrash mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 2 0x103a43e55 JSC::VM::~VM() mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 3 0x103a45025 JSC::VM::~VM() mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 4 0x10328b6c9 WTF::ThreadSafeRefCounted<JSC::VM>::deref() mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 5 0x10328b670 WTF::Ref<JSC::VM>::~Ref() mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 6 0x10326dd35 WTF::Ref<JSC::VM>::~Ref() mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 7 0x103260526 jscmain(int, char**) mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 8 0x10326035b main mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 9 0x7fff8f36c5ad start mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 10 0x7 https://build.webkit.org/builders/Apple%20El%20Capitan%20LLINT%20CLoop%20%28BuildAndTest%29/builds/8242
WebKit Commit Bot
Comment 12 2016-07-22 13:30:38 PDT
Re-opened since this is blocked by bug 160096
Saam Barati
Comment 13 2016-07-22 13:41:15 PDT
(In reply to comment #11) > Created attachment 284367 [details] > Crash log > > This change seems to have caused CLoop tests to fail with this assertion: > > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: x = new > Function(); x.toString = Object.prototype.toString; x.charAt = > String.prototype.charAt; x.charAt(17) = PASSED! > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: ASSERTION > FAILED: m_apiLock->currentThreadIsHoldingLock() > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: > /Volumes/Data/slave/elcapitan-cloop-debug/build/Source/JavaScriptCore/ > runtime/VM.cpp(364) : JSC::VM::~VM() > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 1 0x103a9b0e0 > WTFCrash > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 2 0x103a43e55 > JSC::VM::~VM() > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 3 0x103a45025 > JSC::VM::~VM() > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 4 0x10328b6c9 > WTF::ThreadSafeRefCounted<JSC::VM>::deref() > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 5 0x10328b670 > WTF::Ref<JSC::VM>::~Ref() > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 6 0x10326dd35 > WTF::Ref<JSC::VM>::~Ref() > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 7 0x103260526 > jscmain(int, char**) > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 8 0x10326035b > main > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 9 > 0x7fff8f36c5ad start > mozilla-tests.yaml/ecma/String/15.5.4.4-4.js.mozilla-llint: 10 0x7 > > > https://build.webkit.org/builders/ > Apple%20El%20Capitan%20LLINT%20CLoop%20%28BuildAndTest%29/builds/8242 I think this change will cause every debug JSC stress test to fail.
Per Arne Vollan
Comment 14 2016-08-25 05:53:33 PDT
Per Arne Vollan
Comment 15 2016-11-17 04:13:09 PST
This bug appears to be causing timeouts on Windows bots when running JSC stress tests.
Brent Fulgham
Comment 16 2016-11-17 09:33:23 PST
Comment on attachment 286962 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=286962&action=review > Source/JavaScriptCore/jsc.cpp:-2435 > -#if ENABLE(SAMPLING_REGIONS) Did you mean to remove this for all ports? Should it maybe be "#if ENABLE(SAMPLING_REGIONS) || PLATFORM(WIN)"?
Per Arne Vollan
Comment 17 2016-11-18 07:15:05 PST
(In reply to comment #16) > Comment on attachment 286962 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=286962&action=review > > > Source/JavaScriptCore/jsc.cpp:-2435 > > -#if ENABLE(SAMPLING_REGIONS) > > Did you mean to remove this for all ports? Should it maybe be "#if > ENABLE(SAMPLING_REGIONS) || PLATFORM(WIN)"? It seems this is the only place where ENABLE(SAMPLING_REGIONS) is still used, so I assumed it was not removed when the other occurrences of ENABLE(SAMPLING_REGIONS) were removed. But perhaps it should still be used here?
Per Arne Vollan
Comment 18 2016-12-13 07:16:05 PST
Darin Adler
Comment 19 2016-12-22 09:52:24 PST
Comment on attachment 297012 [details] Patch This seems like an inelegant solution, but I don’t have something better to suggest at this time.
Per Arne Vollan
Comment 20 2017-01-03 02:35:15 PST
(In reply to comment #19) > Comment on attachment 297012 [details] > Patch > > This seems like an inelegant solution, but I don’t have something better to > suggest at this time. Yes, I agree :) Thanks for reviewing!
Per Arne Vollan
Comment 21 2017-01-03 02:37:53 PST
Note You need to log in before you can comment on or make changes to this bug.