GNOME Bugzilla – Bug 674309
Crash when calling oauth_init_nss() from two threads
Last modified: 2012-04-18 09:32:54 UTC
Moving this from a downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=759401 libreport version: 2.0.7 abrt_version: 2.0.6 backtrace_rating: 4 cmdline: /usr/libexec/e-addressbook-factory executable: /usr/libexec/e-addressbook-factory kernel: 3.1.2-1.fc16.x86_64 reason: Process /usr/libexec/e-addressbook-factory was killed by signal 11 (SIGSEGV) time: Fri 02 Dec 2011 10:56:03 AM CET Core was generated by `/usr/libexec/e-addressbook-factory'. Program terminated with signal 11, Segmentation fault.
+ Trace 230085
Thread 2 (Thread 0x7fe179bfe700 (LWP 1861))
Thread 8 and Thread 1 are doing basically the same thing, which may be the reason for this crash. Philip Withnall suggested in that bug: I’d say it’s an EDS bug. libgdata requires that the implementations of GDataAuthorizer->process_request() are thread-safe. EDS’ implementation is thread-safe, but not safe if process_request() is called on two *different* EGDataGoaAuthorizer instances simultaneously. I guess EDS should put a static global mutex around calls to oauth_gen_nonce(). It could probably replace the call to oauth_sign_hmac_sha1() with GHmac, which would save some locking. Either that, or make oauth_init_nss() in liboauth be thread-safe.
Created attachment 212270 [details] [review] eds patch for evolution-data-server; I realized that the eds' EGDataGoaAuthorizer object had a mutex for thread-safety already, it was only thread-safe per object, not in global. I made it a global mutex, which should fix the issue.
Created commit 6c96980 in eds master (3.5.1+) Created commit 7b6f8bd in eds gnome-3-4 (3.4.2+)