Closed Bug 2052432 Opened 27 days ago Closed 4 days ago

Upload a minidump for force-killed hung xpcshell processes on timeout

Categories

(Testing :: XPCShell Harness, task)

task

Tracking

(firefox155 fixed)

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: florian, Assigned: florian, NeedInfo)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(2 files)

When the xpcshell harness force-kills a hung test process on timeout, the minidump it takes is currently discarded: testTimeout returns before run_test's normal checkForCrashes, so the dump is never saved to the upload directory (and on Linux/macOS postCheck's SIGKILL races the in-progress SIGABRT Breakpad dump, truncating it). A hung/timed-out test therefore leaves no dump to inspect.

Make the harness preserve it: after killTimeout, wait (bounded) for the process to finish writing its minidump, then run checkForCrashes, which copies the .dmp to the upload dir as a test artifact and symbolicates its thread stacks into the log. The test is still reported as TIMEOUT, and the log states the dump is the force-killed process, not a real crash (buffered as a test message so a retried run keeps it out of the failure summary).

This matters most for a hard deadlock in the profiler itself (bug 1687510): the sampler thread is stuck, so no profile can be produced, and the force-killed process's minidump is the only diagnostic.

Depends on bug 2052043 (builds on its reportTimeoutResult / self-exit / safety-net-kill work). With both bugs fixed we should now have profiles uploaded for timeouts due to the test taking too long, and we should have a crash dump uploaded for hard deadlocks (especially profiler deadlocks).

See Also: → 2052433

I used this patch to reproduce a(n artificial) profiler deadlock on try. For it to cause a deadlock, the try push needs to be made with --env MOZ_TEST_PROFILER_DEADLOCK=1.

Here's the try result of this bug: https://treeherder.mozilla.org/jobs?repo=try&revision=25b739100566d72889ed1445514c316f6311b6d2

When the harness force-kills a hung test on timeout, testTimeout returned before
run_test's normal checkForCrashes, so the minidump was never saved to the upload
directory. On Linux/macOS kill_and_get_minidump only sends SIGABRT (the process
writes the dump itself via Breakpad), and postCheck's SIGKILL raced the
in-progress dump.

Wait, bounded by TIMEOUT_MINIDUMP_WAIT, for the process to finish writing its
minidump, then run checkForCrashes so the dump is uploaded as a test artifact and
its thread stacks are symbolicated into the log. The test is still reported as
TIMEOUT; the "not a real crash" note is buffered as a test message so a retried
run keeps it out of the failure summary.

Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f5751ad9a39e https://hg.mozilla.org/integration/autoland/rev/67c45fd4ba0a Revert "Bug 2052432 - Upload a minidump for force-killed hung xpcshell processes on timeout, r=ahal." for causing Xpcshell failures.
Depends on: 2054145
Status: ASSIGNED → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
Regressions: 2057700
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: