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 591415 - gnome-keyring-daemon dumps core when exiting
gnome-keyring-daemon dumps core when exiting
Status: RESOLVED DUPLICATE of bug 590004
Product: gnome-keyring
Classification: Core
Component: general
2.27.x
Other opensolaris
: Normal critical
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-08-11 07:32 UTC by Jeff Cai
Modified: 2009-08-30 02:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
Possible patch (502 bytes, patch)
2009-08-11 14:40 UTC, Stef Walter
none Details | Review

Description Jeff Cai 2009-08-11 07:32:32 UTC
If you logout and login again, you can find a core file under the HOME directory.

core 'core' of 7534:	gnome-keyring-daemon --start
 fea22485 _lwp_kill (1, 5, 8046b48, fe9cac0e) + 15
 fe9cac1a raise    (5, 0) + 22
 feb29832 g_logv   (fef33cf8, 4, fef33d00, 8046fdc, 0, 0) + 402
 feb298f0 g_log    (fef33cf8, 4, fef33d00, fef33d30, 181, fef33cb3) + 40
 fef32d05 g_thread_join_posix_impl (81493ac, 0) + 95
 feb576b8 g_thread_join (8149390, 0) + 148
 08102034 gck_timer_shutdown (8136e6c, 80f2f09, 814c018, 80470b0, 80d1e59, 814c018) + f4
 080f30c1 gck_module_finalize (814c018, 0) + 1c1
 080d1e59 gck_user_module_finalize (814c018, 0) + 109
 fec0b156 g_object_unref (814c018, 0) + 266
 080cadc4 gck_C_Finalize (0, 0) + 104
 080a042d plex_C_Finalize (0, 0) + dd
 08084f85 auth_C_Finalize (0, 0) + 35
 080844de pkcs11_daemon_cleanup (0, 0) + 6e
 08108158 egg_cleanup_perform (8147ba8, 80472c0, 80471f4, 807e23d, 1, 8047200) + a8
 0807f576 main     (1, 8047200, 804720c, 80471bc) + 1d6
 0807e23d _start   (2, 8047328, 0, 0, 8047345, 804736a) + 7d
Comment 1 Jeff Cai 2009-08-11 07:34:15 UTC
This looks that timer_thread_func exits due to some unknown reasons. It cores at g_thread_join, it it likely it is the main thread is trying to join a thread that has been done.
Comment 2 Jeff Cai 2009-08-11 08:34:52 UTC
It looks like just not join the thread can solve the issue. Is there a better solution for this?

Stef, how the thread of 'timer_thread_func' exit out?
Comment 3 Stef Walter 2009-08-11 14:09:54 UTC
Thanks for your research into this. This seems to be the same problem as: bug #590004. 

The timer_thread_func thread exits in an orderly fashion, as you would expect by setting a flag, firing off a GCond and then it stops it's loop. There's unit tests that verify this behavior. There's a few more wrinkles. 

This is line that's (sent to /var/log/auth.log) where the gnome-keyring-daemon is aborting (signal 5):

Jul 28 14:22:16 test910 gnome-keyring-daemon[2319]: GThread: file /build/buildd/glib2.0-2.21.4/gthread/gthread-posix.c: line 385 (g_thread_join_posix_impl): error 'No such process' during 'pthread_join (*(pthread_t*)thread, &ignore)'

The thread is started as a joinable thread, so we should run join on it. Running it as non-joinable might be a work around, but I'm not sure it would fix the problem, although you could try that. 

I've tried to duplicate the problem, but haven't been able to. If you can duplicate it consistently, the first thing to check is that join isn't being called twice (in quick succession?). This change would cause that to show up in the logs:

diff --git a/pkcs11/gck/gck-timer.c b/pkcs11/gck/gck-timer.c
index 4776c3b..ddfeb67 100644
--- a/pkcs11/gck/gck-timer.c
+++ b/pkcs11/gck/gck-timer.c
@@ -134,6 +134,7 @@ gck_timer_shutdown (void)
                g_cond_broadcast (timer_cond);
 
                g_assert (timer_thread);
+               g_message ("joining timer thread");
                g_thread_join (timer_thread);
                timer_thread = NULL;
 

I'm wondering if perhaps this is something to do with the interaction of signals and threads. gnome-keyring-daemon exits via the SIGTERM signal. This is caught, (in daemon/gkr-daemon.c) and then an orderly shutdown is run. But perhaps the timer_thread_func is killed via the SIGTERM?

Comment 4 Stef Walter 2009-08-11 14:40:02 UTC
Created attachment 140445 [details] [review]
Possible patch

Does this fix the problem for you?
Comment 5 Jeff Cai 2009-08-12 03:30:01 UTC
(In reply to comment #4)
> Created an attachment (id=140445) [edit]
> Possible patch
> 
> Does this fix the problem for you?
> 

No, this patch can not fix the problem.

Comment 6 Jeff Cai 2009-08-12 03:31:07 UTC
(In reply to comment #3)
> Thanks for your research into this. This seems to be the same problem as: bug
> #590004. 
> 
> The timer_thread_func thread exits in an orderly fashion, as you would expect
> by setting a flag, firing off a GCond and then it stops it's loop. There's unit
> tests that verify this behavior. There's a few more wrinkles. 
> 
> This is line that's (sent to /var/log/auth.log) where the gnome-keyring-daemon
> is aborting (signal 5):
> 
> Jul 28 14:22:16 test910 gnome-keyring-daemon[2319]: GThread: file
> /build/buildd/glib2.0-2.21.4/gthread/gthread-posix.c: line 385
> (g_thread_join_posix_impl): error 'No such process' during 'pthread_join
> (*(pthread_t*)thread, &ignore)'
> 
> The thread is started as a joinable thread, so we should run join on it.
> Running it as non-joinable might be a work around, but I'm not sure it would
> fix the problem, although you could try that. 
> 
> I've tried to duplicate the problem, but haven't been able to. If you can
> duplicate it consistently, the first thing to check is that join isn't being
> called twice (in quick succession?). This change would cause that to show up in
> the logs:
> 
> diff --git a/pkcs11/gck/gck-timer.c b/pkcs11/gck/gck-timer.c
> index 4776c3b..ddfeb67 100644
> --- a/pkcs11/gck/gck-timer.c
> +++ b/pkcs11/gck/gck-timer.c
> @@ -134,6 +134,7 @@ gck_timer_shutdown (void)
>                 g_cond_broadcast (timer_cond);
> 
>                 g_assert (timer_thread);
> +               g_message ("joining timer thread");
>                 g_thread_join (timer_thread);
>                 timer_thread = NULL;
> 
> 
> I'm wondering if perhaps this is something to do with the interaction of
> signals and threads. gnome-keyring-daemon exits via the SIGTERM signal. This is
> caught, (in daemon/gkr-daemon.c) and then an orderly shutdown is run. But
> perhaps the timer_thread_func is killed via the SIGTERM?
> 

The thread is only joined once.

Comment 7 Stef Walter 2009-08-30 02:07:06 UTC

*** This bug has been marked as a duplicate of bug 590004 ***