Open Bug 1539508 Opened 6 years ago Updated 2 years ago

[meta] Simplify WorkerPrivate's end-of-life flow

Categories

(Core :: DOM: Workers, task, P2)

task

Tracking

()

People

(Reporter: ytausky, Unassigned)

References

(Depends on 2 open bugs)

Details

(Keywords: meta)

Currently the circumstances that lead to WorkerPrivate getting destructed are quite complicated: it can happen on more than one thread, it involves a self-smart pointer, etc. We're also aware of several bugs that lurk there. We should rethink how it happens and modify accordingly.

See Also: → CVE-2019-17008

I think, this should have higher priority than P3, at least for the removal of raw pointers as of bug 1546331. But I agree that we should have a very close look at the lifetime of WorkerPrivate in general, too, and besides the destruction paths even the usage from multiple threads might cause issues. I assume though, that we are not talking about massive parallel access on these data structures from more than two threads but that it is kind of serialized during run-time through the event loop and that we have at most the spawning thread and the worker thread itself accessing it. But this is just a wild guess/hope and should be verified - I did not even try to analyze the code, yet.

Maybe :perry can structure better the single tasks that should be done for this, probably promoting this to a meta-bug?

Flags: needinfo?(perry)
Type: enhancement → task
Priority: P3 → P1
Priority: P1 → P2

We start with a patch for bug 1546331 first.

See Also: CVE-2019-17008

This will probably become a meta bug (there's agreement that there should/will be work done for this). In particular, worker "busy counts" should be factored into WorkerRefs.

Flags: needinfo?(perry)
See Also: → 1493591

bug 1493591 might be related, too (crash during deconstructor call of WorkerPrivate). And it still gets fresh crash reports from time to time, though closed.

See Also: → 1545733
See Also: → 1350337
Summary: Refactor WorkerPrivate's end-of-life flow → Simplify WorkerPrivate's end-of-life flow
Blocks: 1619923
See Also: → 1620840
See Also: → 1622241

Start to make this a meta-bug.

Keywords: meta
Summary: Simplify WorkerPrivate's end-of-life flow → [meta] Simplify WorkerPrivate's end-of-life flow
Blocks: 1633298
Depends on: 1350337
See Also: 1350337
Depends on: 1633392
Blocks: 1545733
See Also: 1545733
Depends on: 1620840

Should we limit this to end-of-life? What about bugs like bug 1505409 ?

Blocks: 1624569
Blocks: 1665308
No longer blocks: 1665308
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.