Crash in tests, when some tests fail
Categories
(Core :: Gecko Profiler, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: julienw, Assigned: mozbugz)
Details
Attachments
(3 files)
Hey,
while looking at intermittents, I've seen this crash:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=300547008&repo=mozilla-central&lineNumber=4072
It looks like we crash because a promise isn't disconnected when (maybe) Firefox shuts down.
I'm not sure where this promise is created in the first place, but I do see nsProfiler::StartProfiler is part of the stacktrace.
I don't know more really :-)
Comment 1•4 years ago
|
||
This is a crash in a diagnostic assert, but I'm not sure I completely understand its purpose.
My guess is that we should call mPromiseHolder->Reject(...) before we destroy the MozPromiseHolder object.
Assignee | ||
Comment 2•4 years ago
|
||
Thank you Julien for the report, and Markus for the early analysis.
I think by design, MozPromise
s must be resolved or rejected if there is at least one Then
waiting for it, otherwise that Then
will wait forever.
So yes, we should reject the promise before resetting it.
(Another option would be to "disconnect" the Then
, but we don't want that here, because the existing Then
s are themselves tasked with resolving/rejecting a JS Promise, which we should respond to as well.)
I hope whoever waits for these JS promises can handle rejections! I'll have a look...
Assignee | ||
Comment 3•4 years ago
|
||
While gathering profiles from child processes, some actions (e.g., shutting down, restarting the profiler) may reset the gathering operation.
In this case we must ensure that the promise is rejected if not already fulfilled, so that anyone waiting on it won't be blocked forever (and MozPromise enforces it in a MOZ_DIAGNOSTIC_ASSERT).
Assignee | ||
Comment 4•4 years ago
|
||
It is not necessary to dispatch another task to the main thread to resolve/reject a MozPromiseHolder, because wherever this happens, the attached Then
will do its own dispatch to the main thread.
Also, this removes a dispatch that could potentially fail, leaving the promise unfulfilled.
Depends on D73790
Assignee | ||
Comment 5•4 years ago
|
||
In rare cases, a dispatch may fail (e.g., threads are shutting down), we should handle this failure by rejecting the promise on the spot.
Depends on D73791
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/103d46d0ce15 Make sure profile-gathering promise is fulfilled before destroying holder - r=mstange https://hg.mozilla.org/integration/autoland/rev/63b9ac1938ba GetSymbolTableMozPromise can fulfill the promise on any thread - r=mstange https://hg.mozilla.org/integration/autoland/rev/dc9ab7ee6c95 Make sure GetSymbolTableMozPromise promise is always fulfilled - r=mstange
Comment 7•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/103d46d0ce15
https://hg.mozilla.org/mozilla-central/rev/63b9ac1938ba
https://hg.mozilla.org/mozilla-central/rev/dc9ab7ee6c95
Description
•