Closed Bug 1435966 Opened 6 years ago Closed 4 years ago

mozilla::net::nsSocketTransportService::ShutdownThread() blocks the shutdown of other components

Categories

(Core :: Security: PSM, enhancement, P2)

58 Branch
enhancement

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: baku, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [psm-backlog])

Crash Data

Similar crash report of bug 1435962 
https://crash-stats.mozilla.com/report/index/b924b1db-a013-4b0a-a137-98f910180206#allthreads
here we crash because the main-thread is blocked by mozilla::net::nsSocketTransportService::ShutdownThread() that spins the event loop and never returns.
Flags: needinfo?(michal.novotny)
The socket thread is blocked by mozilla::psm::StopSSLServerCertVerificationThreads().
Component: Networking → Security: PSM
Flags: needinfo?(michal.novotny)
Blocks: 1437575
Blocks: 1405290
Crash Signature: [@ mozilla::dom::workers::RuntimeService::CrashIfHanging ]
See Also: → 1435962
All of the cert verification threads seem to be waiting on OCSP events to finish, which presumably should have been cancelled as a result of shutting down necko, so perhaps there's something wrong with the OCSP event implementation (or maybe my assumption there is wrong).
Priority: -- → P2
Whiteboard: [psm-backlog]
I honestly think we don't cancel channels just that when shutting down.  We close sockets (that should cancel network pending channels), but I believe we do so AFTER the point we are stuck at shutdown in this case.

Only channels that belong to a load group on content processes are canceled as part of the STOP navigation docshell command.

Channels w/o a load group are more fire-and-forget thing, I believe.

Hence, you may need to keep a collection of the OCSP channels (or maybe rather the events) and cancel them on shutdown yourself.
Bug 1456489 may have improved this - we'll have to keep an eye on it.

(In reply to Dana Keeler (she/her) (use needinfo) (:keeler for reviews) from comment #4)

Bug 1456489 may have improved this - we'll have to keep an eye on it.

That lannded in version 61. However, the crashes end at version 60 https://crash-stats.mozilla.org/signature/?signature=mozilla%3A%3Adom%3A%3Aworkers%3A%3ARuntimeService%3A%3ACrashIfHanging&date=%3E%3D2019-10-04T11%3A59%3A00.000Z&date=%3C2020-04-04T11%3A59%3A00.000Z

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
Blocks: 1633342
No longer blocks: 1633342
You need to log in before you can comment on or make changes to this bug.