After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 580620 - Crash in NSS_Shutdown
Crash in NSS_Shutdown
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
unspecified
Other Linux
: Normal critical
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2009-04-28 15:59 UTC by Sergio Villar
Modified: 2009-05-07 10:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that hopefully fixes this bug (2.07 KB, patch)
2009-04-28 16:12 UTC, Sergio Villar
accepted-commit_now Details | Review

Description Sergio Villar 2009-04-28 15:59:51 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
Comment 1 Sergio Villar 2009-04-28 16:12:28 UTC
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.
Comment 2 Akhil Laddha 2009-04-29 04:40:31 UTC
crash is critical always 
Comment 3 Matthew Barnes 2009-05-01 15:57:56 UTC
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.
Comment 4 Sergio Villar 2009-05-07 10:37:14 UTC
Patch committed with the suggested modifications.

Fixed in master 898b5e05f95bf7703a55aee9ea2e5f87119ed53e