Mochitest run is reported as passing when the browser is killed mid-test without leaving a minidump (parent-process TSan aborts stay green)
Categories
(Testing :: Mochitest, defect)
Tracking
(firefox163 fixed)
| Tracking | Status | |
|---|---|---|
| firefox163 | --- | fixed |
People
(Reporter: benoit.goupilleau, Assigned: benoit.goupilleau, NeedInfo)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
Task XauHr1_HRhCSTehEwhcaPA (autoland, test-linux2404-64-tsan/opt-mochitest-browser-chrome-swr-10, rev 6438fbb6d4f6) is green on Treeherder although ThreadSanitizer aborted the parent process while browser/components/firefoxview/tests/browser/browser_syncedtabs_errors_firefoxview.js was running (the PK11_InitToken race of bug 2080357):
- Firefox TSan builds run with
halt_on_error=1:abort_on_error=1(build/sanitizers/TsanOptions.cpp), so the parent died:TEST-INFO | Main app process: killed by SIGIOT. - TSan (and ASan) builds are configured with
--disable-crashreporter, so there is no minidump andmozcrash.log_crashesfinds nothing. - In
testing/mochitest/runtests.py,runApponly reports a non-zero exit status of the main process through the minidump path. Bug 1631828 removed theTEST-UNEXPECTED-FAIL | <test> | application terminated with exit code Nfallback, so a non-zero exit with no minidump, no zombie process and no--crash-as-passemits nothing: the running test never gets atest_endand no error is logged. summary.jsonl has thetest_startof the test and nothing else about it. - In
runMochitests, the CI retry mode then continues with the tests that did not get to start, andresult = self.doTests(...)overwrites the first run's non-zero status with the next run's 0, so the harness exits 0 and printsFailed: 0.
mozharness therefore sees no unexpected status, no crash action, no ERROR line and a zero return code, and the job is green. Only Treeherder's own log parser notices the SUMMARY: ThreadSanitizer line, which nobody looks at on a green job. ASan builds are only saved by ERROR: AddressSanitizer being in mozharness's harness error list, and content-process TSan aborts by the "A content process crashed" line; a parent-process abort in a TSan mochitest run (data race, MOZ_CRASH, any fatal signal) has been invisible since 2023.
The harness should treat a non-zero exit of the main process as a crash whether or not a minidump exists: a test_end with status CRASH for the running test, as the minidump path already does, an error line when no test was running, and the failing status must survive the continuation with the remaining tests.
Keeping the parsed tsan_error record in summary.jsonl is a separate Testing::Mozbase bug; the error summary group status is bug 2088064.
Comment 1•19 days ago
|
||
:jmaher, since you are the author of the regressor, bug 1631828, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Since bug 1631828 a non-zero exit of the main process is only reported
through the minidump mozcrash finds. Sanitizer builds have no crash
reporter, so a ThreadSanitizer abort of the parent process left the
running test without a test_end and the run reported success; in CI the
continuation with the remaining tests then overwrote the failing status.
Report the exit as the minidump path does: a CRASH test_end for the
running test, an error line otherwise. The test_end is not marked
expected in retry mode, so the run fails like a crash with a minidump
instead of being retried.
Updated•19 days ago
|
Reproduced on try, before and after the fix, by running the firefoxview browser-chrome manifest on test-linux2404-64-tsan/opt-mochitest-browser-chrome with a try-only test added at the end of the manifest that calls nsIDebug2.abort() in the parent process. On a TSan build there is no crash reporter, so the abort goes through TSan's signal handler and kills the parent with SIGIOT, like the race does. The bug 2080357 race in PK11_InitToken also recurred during browser_syncedtabs_errors_firefoxview.js on both pushes, so each run exercised the exact scenario of the original job as well.
Original job (autoland, green):
https://treeherder.mozilla.org/jobs?repo=autoland&revision=6438fbb6d4f6dafdc86eca31b0ea7cd7f5881567&selectedTaskRun=XauHr1_HRhCSTehEwhcaPA.0
SUMMARY: ThreadSanitizer: data race ... in PK11_InitToken, then TEST-INFO | Main app process: killed by SIGIOT, no minidump, the harness restarted the browser on the remaining tests, Failed: 0, Return code: 0. summary.jsonl has the test_start of browser_syncedtabs_errors_firefoxview.js and no test_end.
Without the fix:
https://treeherder.mozilla.org/jobs?repo=try&revision=6306aa0973e4&selectedTaskRun=bjgwa9FaRoaFlRHDl0v2Ig.0
Same thing for the race: no test_end, no failure line, Failed: 0, group OK in errorsummary. This job still ended up orange, but only because the deliberate abort hit the last test of the manifest: the exit status of that last browser run was the harness return code (Return code: 1, setting return code to 2), with no test named anywhere. The retry loop in runMochitests overwrites the result of each run with the next one, so an abort anywhere else in the manifest is lost, as on autoland.
With D340925 (plus D340927 for the tsan_error records in summary.jsonl):
https://treeherder.mozilla.org/jobs?repo=try&revision=767599de0872&selectedTaskRun=HUI6Gmu5RpirPm4K1o2eDg.0
Both aborts are reported against their test: TEST-UNEXPECTED-CRASH | browser/components/firefoxview/tests/browser/browser_syncedtabs_errors_firefoxview.js | application terminated with exit code 1 and the same for the repro test, test_end with status: CRASH, expected: PASS, Got 2 unexpected statuses, group ERROR, 150/2/1. summary.jsonl now carries the tsan_error record (signature, pid, stacks) next to each CRASH test_end.
Comment 6•8 days ago
|
||
Backed out for causing bc tests failures at browser_syncedtabs_errors_firefoxview.js
Backout Link
Push with failures
Failure Log
Failure line TEST-UNEXPECTED-CRASH | browser/components/firefoxview/tests/browser/browser_syncedtabs_errors_firefoxview.js | application terminated with exit code -6
Updated•8 days ago
|
Updated•8 days ago
|
Comment 8•7 days ago
|
||
| bugherder | ||
Comment 10•7 days ago
|
||
Backed out for causing bc failures.
Comment 11•7 days ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/904f63ad4a36
Comment 12•6 days ago
|
||
Comment 13•6 days ago
|
||
(In reply to Goloman Adrian[:agoloman] from comment #10)
Backed out for causing bc failures.
Firefox crashed on Windows in a "fast-fail" mode that didn't output a crash dump after opening (and closing) 500 browser windows with the tabs in the title bar. Fixing in bug 2096020 and relanding.
Comment 14•6 days ago
|
||
Comment 15•6 days ago
|
||
Backed out for causing media related failures.
Backout link: https://hg.mozilla.org/integration/autoland/rev/01c9bd96fe07
Failure log: https://treeherder.mozilla.org/logviewer?job_id=609343102&repo=autoland&task=JylQs8dDRi6tIGSvUpllmQ.0&lineNumber=3112
Comment 16•6 days ago
|
||
Comment 17•6 days ago
|
||
| bugherder | ||
Description
•