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 674309 - Crash when calling oauth_init_nss() from two threads
Crash when calling oauth_init_nss() from two threads
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
3.2.x (obsolete)
Other Linux
: Normal critical
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2012-04-18 09:11 UTC by Milan Crha
Modified: 2012-04-18 09:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eds patch (3.10 KB, patch)
2012-04-18 09:29 UTC, Milan Crha
committed Details | Review

Description Milan Crha 2012-04-18 09:11:02 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.

Thread 2 (Thread 0x7fe179bfe700 (LWP 1861))

  • #0 read
    at ../sysdeps/unix/syscall-template.S line 82
  • #1 read
    at /usr/include/bits/unistd.h line 45
  • #2 unix_signal_helper_thread
    at gmain.c line 4551
  • #3 g_thread_create_proxy
    at gthread.c line 1962
  • #4 start_thread
    at pthread_create.c line 309
  • #5 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 115

Comment 1 Milan Crha 2012-04-18 09:12:39 UTC
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.
Comment 2 Milan Crha 2012-04-18 09:29:06 UTC
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.
Comment 3 Milan Crha 2012-04-18 09:32:54 UTC
Created commit 6c96980 in eds master (3.5.1+)
Created commit 7b6f8bd in eds gnome-3-4 (3.4.2+)