Closed Bug 2094313 Opened 10 days ago Closed 8 days ago

ccov mochitest jobs time out after the last test passes when a content process exits during the final coverage flush

Categories

(Testing :: Code Coverage, defect)

defect

Tracking

(firefox163 fixed)

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: calixte, Assigned: calixte)

References

(Regression)

Details

(Keywords: regression)

Crash Data

Attachments

(1 file, 1 external file)

Since bug 2077159 re-landed on 2026-11-16, several Android ccov mochitest-plain chunks on mozilla-central get killed with "application timed out after 370 seconds with no output", after their last test has passed (the crash signature is the harness kill, @ libc.so + 0xb94da). The chunks affected include dom/serviceworkers, dom/base/test/jsmodules, dom/ipc/tests, dom/security/permissionspolicy, dom/security/test/mixedcontentblocker, dom/tests/mochitest/storageevent and toolkit/components/pdfjs/test (bug 2094061). The last mozilla-central push without the re-land had all its Android ccov mochitest-plain jobs green, the first one with it had five of them killed this way, and none were seen in the two weeks before.

At the end of a suite, TestRunner now awaits SpecialPowers.requestFinalDumpCoverageCounters(), which goes through nsCodeCoverage::Request. The logcats show a content process being torn down (the last frame it hosted is gone) a few ms after the flush request was sent to it. The IPC reply is then rejected with ActorDestroyed, Request rejects the whole promise, TestRunner throws an uncaught exception, and the harness never logs SimpleTest FINISHED. Request also counts the live processes before the parent flush (which takes about 2 s on the emulator) and only sends the requests afterwards, so a process dying in between is counted but never asked, and the promise never settles.

This is not Android specific: a browser-chrome test killing a content process right after flushCounters() is called fails every time on a desktop ccov build (the flush is rejected), and passes once a dying process is counted as done.

A second variant is seen in a dom/file/tests chunk: no rejection, but the surviving children never finish their flush. A plausible cause is the dying child being killed while holding the CrossProcessMutex taken in CodeCoverageHandler::FlushCounters, which is not robust on POSIX, so its owner dying leaves it locked forever. Win32 mutexes are released when their owner dies, so this can only happen on Linux, macOS and Android.

A content process shutting down while the counters are flushed (e.g. right
after the last frame it hosted was removed) rejected the whole request, so
the final dump at the end of a mochitest suite threw and the harness timed
out without printing its summary.

The live processes were also counted before the parent flush, which can take
a few seconds, so a process dying in between was never sent the request and
the promise never settled.

Duplicate of this bug: 2094505
Duplicate of this bug: 2094434

Copying crash signatures from duplicate bugs.

Crash Signature: [@ libc.so + 0x00000000000b94da]
See Also: → 2094621
Duplicate of this bug: 2095279
Pushed by cdenizet@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/52c7abf55a4d https://hg.mozilla.org/integration/autoland/rev/ac45b9ea355b Don't fail or hang the code coverage flush when a content process dies. r=marco,ipc-reviewers,mccr8
Status: ASSIGNED → RESOLVED
Closed: 8 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
Duplicate of this bug: 2094061
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: