GNOME Bugzilla – Bug 580620
Crash in NSS_Shutdown
Last modified: 2009-05-07 10:37:14 UTC
Camel always call NSS_Init() and NSS_Shutdown() to initialize/tear down the NSS services. That could cause crashes if the NSS library is used at the same time by other application like any Mozilla-based. One example of this crash (with other applications) is here http://www.mail-archive.com/dev-tech-crypto@lists.mozilla.org/msg04273.html
Created attachment 133515 [details] [review] Patch that hopefully fixes this bug This patch basically does two things 1- first of all, it protects the calls to NSS_Init and NSS_Shutdown with a lock 2- secondly we keep track whether or not camel is initializing NSS, because if it was already initialized by some other software we must not call NSS_Shutdown It's the same solution that curl adopted: https://bugzilla.redhat.com/show_bug.cgi?id=459297 https://bugzilla.redhat.com/attachment.cgi?id=315685 and we did also the same in tinymail.
crash is critical always
Interesting. You'd think those functions would be idempotent. Patch looks okay, but please add a more descriptive comment about why it's necessary. Camel is already full of this kind of cruft, and much of it is undocumented and long forgotten as to why it's there.
Patch committed with the suggested modifications. Fixed in master 898b5e05f95bf7703a55aee9ea2e5f87119ed53e