Closed Bug 1982950 Opened 1 year ago Closed 1 year ago

MOZ_CRASH(TimeoutExecutor not thread-safe) due to pending timer in subprocess_worker.win.js

Categories

(Toolkit :: Async Tooling, defect, P1)

defect

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox-esr140 144+ fixed
firefox141 --- unaffected
firefox142 --- unaffected
firefox143 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [addons-jira])

Attachments

(2 external files)

The crash associated with bug 1982170 went up after the patch to bug 1979546 landed. This means that in the new implementation, a timer is scheduled to run at the next macrotask (queued here), but never gets a chance to run, while this was not happening in the previous implementation.

Although it is easy to fix the test-only crashes (I've attached a patch to bug 1982170), I'd like to get make sure that the cause of this behavioral change is clear, and acknowledged or fixed as needed.

Blocks: 1982170
Regressed by: 1979546

Set release status flags based on info from the regressing bug 1979546

The patch to bug 1979546 refactored the logic that awaits the process
termination. The logic that processes process termination should stop
the poll loop() via updatePollEvents(). This did not happen, because
updatePollEvents() considered a process alive if it is in
io.processes, but the updatePollEvents() was not called when
cleanupProcess cleared the last reference.

Consequently, the poll loop continued forever if the process's pipes
closed before the process.

This patch fixes the issue and adds unit tests. As part of the unit
tests, we must wait for stdout to be closed. That was broken on Windows
due to a long-standing pre-existing bug: readBuffer() used
libc.winLastError to check for errors, but that property is never set
because it is on ctypes.winLastError. This patch also fixes that.

Severity: -- → S3
Priority: -- → P1
Pushed by chorotan@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3bb9b9dc739d https://hg.mozilla.org/integration/autoland/rev/6b5b913098c9 Revert "Bug 1982950 - Stop polling as soon as process exits r=gstoll" for causing multiple failures
See Also: → 1983138

Unfortunately fixing the long-standing issue with the use of the non-existing libc.winLastError causes failures. Since it is not critical to fixing the regression I'm moving that to bug 1983138.

Even without the readString() part of the test (disabled because it depends on the fix to bug 1983138), the test still provides the desired test coverage: The most important part of the test is "Not polling when last process has exited" check, and I confirmed that it fails without the fix, and passes with the fix.

Flags: needinfo?(rob)
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
QA Whiteboard: [qa-triage-done-c144/b143]

The patch to bug 1979546 refactored the logic that awaits the process
termination. The logic that processes process termination should stop
the poll loop() via updatePollEvents(). This did not happen, because
updatePollEvents() considered a process alive if it is in
io.processes, but the updatePollEvents() was not called when
cleanupProcess cleared the last reference.

Consequently, the poll loop continued forever if the process's pipes
closed before the process.

Original Revision: https://phabricator.services.mozilla.com/D261060

Attachment #9516423 - Flags: approval-mozilla-esr140?
Flags: in-testsuite+
Attachment #9516423 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
See Also: → CVE-2025-11719
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: