nsSocketTransportService doesn't properly shutdown during xpcom-shutdown-threads
Categories
(Core :: Networking, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr102 | --- | unaffected |
firefox113 | --- | wontfix |
firefox114 | --- | wontfix |
firefox115 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [necko-triaged])
Attachments
(2 files)
In bug 1818998, nsSocketTransportService
was changed to call Shutdown(true)
instead of ShutdownThreads()
during xpcom-shutdown-threads
. This combined with the new implementation of the method meant that the observer notification would only wait for the thread to actually exit in content processes, where the socket runnable is not used.
This meant that the thread would not run it's proper shutdown stages early enough leading to the possibility for dispatch errors from IPC such as those which caused bug 1828389 to be backed out. The thread would only end up exiting during ShutdownNonMainThreads
cleanup, which is too late.
Assignee | ||
Comment 1•1 years ago
|
||
While looking at the relevant code, I noticed the unannotated mutex, and added
some annotations to it. The minor changes I had to do to keep the tree
building after the annotations shouldn't be actual threadsafety issues, as
most of it is either dead code, or exclusively called from the only mutating
thread.
Assignee | ||
Comment 2•1 years ago
|
||
This also cleans up some of the unnecessary flags & memebrs which were held
during the changes in bug 1818998. mSelf was unncessary as the runnable
reference will be keeping the instance alive for the same lifetime, and
mSocketThreadShutDown was redundant with !mInitialized.
This change will also fix a potential issue where the socket thread was not
being shut down when switching the browser into an offline state from
profile-change-net-teardown
, which could've lead to thread leaks when the
browser is returned to an online state. The restore codepath, however, has
been dead for a long time so this is unlikely to be a real issue in practice.
Depends on D178867
Comment 3•1 years ago
|
||
Set release status flags based on info from the regressing bug 1818998
Updated•1 years ago
|
Updated•1 years ago
|
Comment 5•1 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f762e1cce59c
https://hg.mozilla.org/mozilla-central/rev/3e4914be9f30
Updated•1 year ago
|
Description
•