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 544998 - Evo hangs every so often, BT shows a g-kr read on top
Evo hangs every so often, BT shows a g-kr read on top
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: general
2.23.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
: 548845 558934 (view as bug list)
Depends on:
Blocks: 532771 539210
 
 
Reported: 2008-07-27 16:03 UTC by C de-Avillez
Modified: 2009-03-05 03:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Patch to try (6.57 KB, patch)
2008-08-22 03:26 UTC, Stef Walter
none Details | Review

Description C de-Avillez 2008-07-27 16:03:30 UTC
E-D-S 2.23.6 (trunk) and E-D-S 2.23.4, g-kr 2.23.5 with fix for bug 502603, Ubuntu Intrepid 8.10 Alpha3.

  • #0 read
    from /lib/libpthread.so.0
  • #1 read_all
    at /usr/include/bits/unistd.h line 45
  • #2 run_sync_operation
    at gnome-keyring.c line 575
  • #3 gnome_keyring_find_items_sync
    at gnome-keyring.c line 2141
  • #4 ep_keyring_lookup_passwords
    at ../../../evolution-data-server/libedataserverui/e-passwords.c line 392
  • #5 ep_get_password_keyring
    at ../../../evolution-data-server/libedataserverui/e-passwords.c line 847
  • #6 ep_get_password
    at ../../../evolution-data-server/libedataserverui/e-passwords.c line 950
  • #7 ep_idle_dispatch
    at ../../../evolution-data-server/libedataserverui/e-passwords.c line 448
  • #8 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.17.4/glib/gmain.c line 2068
  • #9 g_main_context_iterate
    at /build/buildd/glib2.0-2.17.4/glib/gmain.c line 2701
  • #10 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.17.4/glib/gmain.c line 2924
  • #11 bonobo_main
    at bonobo-main.c line 311
  • #12 main
    at ../../../evolution/shell/main.c line 783


I will grab a stacktrace from g-kr-deamon next time.
Comment 1 Stef Walter 2008-07-27 16:18:24 UTC
Thanks, yes a stacktrace from gnome-keyring-daemon is necessary. 

FWIW, UI programs should generally use asynchronous gnome-keyring functions rather than the synchronous ones (which evolution is doing in the stack trace above). This allows them to keep the UI interactive during a gnome-keyring-daemon prompt or some such.
Comment 2 Matthew Barnes 2008-07-29 16:32:17 UTC
Point taken, although Evolution's password management is already asynchronous, not to mention complex and brittle.  I hesitate to pile another asynchronous layer on top.  There's a case to be made that our whole password management design needs to be rethought, but my previous attempts have failed.  That code just hates me.

Anyway, wanted to mention that a lot of Evolution users also report seeing this filling up their /var/log/messages during the hang:

   Jun 15 09:11:55 localhost gnome-keyring-daemon[2607]: couldn't read 4 bytes
   from client:

Also, the hang has been reported on both 32 and 64-bit architectures.
Comment 3 C de-Avillez 2008-07-29 17:47:35 UTC
and another comment -- these last few days I have not experienced any hangs. Before that, I would get at least one hang every day.

BUT -- I *did* change my Evo account setup, raising the interval between POP mail checks from 5 to 10 minutes (I was wondering if this could be playing a role...). I will reduce it back to 5 minutes (or even lower), and try again.
Comment 4 Stef Walter 2008-07-30 15:27:48 UTC
There was an erroneous warning (ie: 'couldn't read 4 bytes from client') has been fixed in recent versions of gnome-keyring. See bug #511285
Comment 5 C de-Avillez 2008-08-05 03:29:48 UTC
OK, got it again.

Evo BT:

  • #0 read
    from /lib/libpthread.so.0
  • #1 read_all
    at /usr/include/bits/unistd.h line 45
  • #2 run_sync_operation
    at gnome-keyring.c line 575
  • #3 gnome_keyring_find_items_sync
    at gnome-keyring.c line 2141
  • #4 ep_keyring_lookup_passwords
    at ../../../evolution-data-server/libedataserverui/e-passwords.c line 392
  • #5 ep_get_password_keyring
    at ../../../evolution-data-server/libedataserverui/e-passwords.c line 811
  • #6 ep_get_password
    at ../../../evolution-data-server/libedataserverui/e-passwords.c line 950
  • #7 ep_idle_dispatch
    at ../../../evolution-data-server/libedataserverui/e-passwords.c line 448
  • #8 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #9 ??
    from /usr/lib/libglib-2.0.so.0
  • #10 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #11 bonobo_main
    at bonobo-main.c line 311
  • #12 main
    at ../../../evolution/shell/main.c line 783

Comment 6 C de-Avillez 2008-08-05 03:30:33 UTC
and g-kr-daemon's bt:

(gdb) thread apply all bt full

Thread 2 (Thread 0x413b6950 (LWP 26573))

  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 _L_lock_102
    from /lib/libpthread.so.0
  • #2 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #3 gkr_async_end_concurrent
    at gkr-async.c line 524
  • #4 yield_and_read_all
    at gkr-daemon-io.c line 130
  • #5 read_packet_with_size
    at gkr-daemon-io.c line 202
  • #6 client_worker_main
    at gkr-daemon-io.c line 274
  • #7 async_worker_thread
    at gkr-async.c line 274
  • #8 g_static_rec_mutex_lock
    from /usr/lib/libglib-2.0.so.0
  • #9 ??

Comment 7 Stef Walter 2008-08-17 15:05:58 UTC
Thanks for the hard work in getting the stack trace. This is going to be a tough one to figure out. But I'll give it a shot. How often can you duplicate this problem?
Comment 8 C de-Avillez 2008-08-17 20:15:20 UTC
Stef, usually once per day, when I had email checking every 5 minutes or so.  Right now, with a longer interval, it is once per week or so.

I will downset the interval again, and we will see what happens. If you would like me to to something specific, please tell me.
Comment 9 Kandepu Prasad 2008-08-21 11:41:12 UTC
*** Bug 548845 has been marked as a duplicate of this bug. ***
Comment 10 Stef Walter 2008-08-22 03:26:08 UTC
Created attachment 117170 [details] [review]
Patch to try

Does this patch fix the problem you're experiencing?
Comment 11 C de-Avillez 2008-08-22 22:26:01 UTC
The patch does not apply successfully on 2.23.90, but applies successfuly on trunk (revision 1260); but it fails to build, on gp11, so it has nothing to do with the patch:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -Werror -g -O2 -Wno-strict-aliasing -Wno-sign-compare -MT gp11-call.lo -MD -MP -MF .deps/gp11-call.Tpo -c gp11-call.c  -fPIC -DPIC -o .libs/gp11-call.o
cc1: warnings being treated as errors
gp11-call.c: In function ‘_gp11_call_sync’:
gp11-call.c:355: error: format not a string literal and no format arguments
gp11-call.c: In function ‘_gp11_call_basic_finish’:
gp11-call.c:444: error: format not a string literal and no format arguments
make[4]: *** [gp11-call.lo] Error 1
make[4]: Leaving directory `/usr/src/buildd/gnome-keyring-svn/gp11'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/src/buildd/gnome-keyring-svn/gp11'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/buildd/gnome-keyring-svn/gp11'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/buildd/gnome-keyring-svn'
make: *** [all] Error 2
 
Base system is Ubuntu Alpha4, Gnome 2.23.90.

I am unsure if there are special instructions to build g-kr, and I could not find a site talking about it. Or, perhaps, I should not apply the patch to trunk?
Comment 12 Stef Walter 2008-08-23 04:03:34 UTC
Thanks for letting me know. I've fixed that build problem on trunk. Although I didn't get those build errors, the problems they were pointing to were legitimate.

Comment 13 C de-Avillez 2008-08-24 21:37:23 UTC
Stef, some more:

cc1: warnings being treated as errors
gkr-crypto.c: In function ‘fatal_handler’:
gkr-crypto.c:63: error: format not a string literal and no format arguments
gkr-crypto.c: In function ‘gkr_crypto_sexp_dump’:
gkr-crypto.c:808: error: format not a string literal and no format arguments
make[3]: *** [libgkr_common_la-gkr-crypto.lo] Error 1
make[3]: Leaving directory `/usr/src/buildd/gnome-keyring-svn/common'
make[2]: *** [all-recursive] Error 1
Comment 14 Stef Walter 2008-08-28 02:04:59 UTC
Cool, your compiler found some possible bugs. What compiler are you using? 

Compile errors fixed: 

2008-08-27  Stef Walter  <stef@memberwebs.com>

	* common/gkr-crypto.c: Fix build problems with string formats.

Comment 15 C de-Avillez 2008-08-28 04:26:41 UTC
gcc 4.3.1, Ubuntu Intrepid. Will try it again :-)
Comment 16 C de-Avillez 2008-08-28 17:45:56 UTC
Yet another:

cc1: warnings being treated as errors
gkr-wakeup.c: In function ‘gkr_wakeup_now’:
gkr-wakeup.c:93: error: ignoring return value of ‘write’, declared with attribute warn_unused_result
make[3]: *** [libgkr_common_la-gkr-wakeup.lo] Error 1
make[3]: Leaving directory `/usr/src/buildd/gnome-keyring-svn/common'

notice the first line. This is a make from SVN, so the compiler options are as SVN has them set. I simply took out -Werror from the Makefile under ./common, and I was then able to build g-kr. Testing now.
Comment 17 Stef Walter 2008-09-03 15:36:57 UTC
That's a silly warning from gcc. I've committed a hopeful fix to silence the warning.

As far as -Werror .... We use -Werror in SVN checkout versions to catch problems that we wouldn't otherwise find, as the gnome-keyring maintainers obviously don't have every compiler, OS, and distro at their disposal.
Comment 18 C de-Avillez 2008-09-24 02:07:57 UTC
I have been running your patch for a while, and have not had another lock.

I would guess this is a go... of course, this is a deadlock, and it might just be I did not hit the right spot so far. But, given that I would be hit by it almost every day, not having had it for about 2 weeks is a good indication.

Thank you.
Comment 19 André Klapper 2008-11-02 22:31:26 UTC
*** Bug 558934 has been marked as a duplicate of this bug. ***
Comment 20 Stef Walter 2009-03-05 03:52:35 UTC
Great let's close this.