Closed Bug 1880590 Opened 2 years ago Closed 2 years ago

TSan data race in StopForkServer

Categories

(Core :: IPC, defect, P1)

Unspecified
Linux
defect

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: jld, Assigned: jld)

References

Details

Attachments

(1 external file)

Seen in a Try run with the forkserver pref flipped. There's a race between ProcessWatcher checking if the fork server is in use (via ForkServiceChild::Get) and the fork server shutdown path (ForkServerLauncher::Observe → StopForkServer). The race seems to be benign, but it causes test failures. I have an idea for a simple fix.

Severity: -- → S3
Priority: -- → P1

There's a race between ProcessWatcher checking if the fork server is
in use (via ForkServiceChild::Get) and the fork server shutdown path
(ForkServerLauncher::Observe calling StopForkServer). The race
seems to be benign, but it causes test failures under TSan.

As a relatively simple fix, this patch changes ProcessWatcher to check
an atomic flag which is true if the fork server has ever been run.
(This also means that, in the case where the fork server has been shut
down but some of its child processes are still running, we will continue
to use the kill(pid, 0) fallback.)

Pushed by jedavis@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5a7ed47d6d46 Fix benign data race during fork server shutdown. r=nika
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: