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 671826 - Login hangs if ~/.pki/nssdb exists
Login hangs if ~/.pki/nssdb exists
Status: RESOLVED NOTABUG
Product: gnome-keyring
Classification: Core
Component: pkcs11
3.3.x
Other Linux
: Normal major
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-03-11 12:33 UTC by Mantas Mikulėnas (grawity)
Modified: 2012-03-14 21:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mantas Mikulėnas (grawity) 2012-03-11 12:33:53 UTC
If the ~/.pki/nssdb directory (the shared NSS database) exists on filesystem – even if it is empty – the GNOME login process hangs before having started the Shell or any application.

This appears to be caused by the following startup item:

File: /etc/xdg/autostart/gnome-keyring-pkcs11.desktop
Name: Certificate and Key Storage
Cmnd: /usr/bin/gnome-keyring-daemon --start --components=pkcs11

If the above item is disabled via `gnome-session-properties`, the login proceeds normally.

Strangely, running the above command in a terminal, after logging in, works just fine -- the command exits immediately, outputting a few environment variables.

gnome-keyring 3.3.91-1
libgnome-keyring 3.3.91-1
gcr 3.3.90-1
Arch Linux
Comment 1 Stef Walter 2012-03-13 20:53:54 UTC
Any chance you could attach to gnome-keyring-daemon and get a backtrace to see what it's blocking on?
Comment 3 Stef Walter 2012-03-14 19:42:51 UTC
Oh, I forgot to mention: I can't reproduce on my machines (Fedora, Ubuntu). I have that a ~/.pki/nssdb directory, and gnome-keyring-daemon starts fine.

So that's why I'm interested in the backtrace from someone who sees this.
Comment 4 Mantas Mikulėnas (grawity) 2012-03-14 19:45:02 UTC
I have no idea, honestly.

All threads in gnome-keyring seem to be stuck on read() or poll():

<<EOF

(gdb) thread apply all bt

Thread 7 (Thread 0x7fb0a0e36700 (LWP 70342))

  • #0 do_sigwait
    from /lib/libpthread.so.0
  • #1 sigwait
    from /lib/libpthread.so.0
  • #2 signal_thread
    at gkd-main.c line 394
  • #3 start_thread
    from /lib/libpthread.so.0
  • #4 clone
    from /lib/libc.so.6

EOF

I will try a fresh user account again.
Comment 5 Stef Walter 2012-03-14 19:49:23 UTC
Hmmm, looks like this is where gnome-shell is blocking:

Thread 1 (Thread 0x7ff142a12900 (LWP 70386))

  • #0 pthread_cond_wait
    from /lib/libpthread.so.0
  • #1 PR_WaitCondVar
    from /usr/lib/libnspr4.so
  • #2 PR_Cleanup
    from /usr/lib/libnspr4.so
  • #3 ??
    from /usr/lib/libnm-util.so.2
  • #4 nm_utils_init
    from /usr/lib/libnm-util.so.2
  • #5 ??
    from /usr/lib/libnm-glib.so.4
  • #6 g_object_newv
    from /usr/lib/libgobject-2.0.so.0
  • #7 g_object_new_valist
    from /usr/lib/libgobject-2.0.so.0
  • #8 g_object_new
    from /usr/lib/libgobject-2.0.so.0
  • #9 nm_client_new
    from /usr/lib/libnm-glib.so.4
  • #10 ffi_call_unix64
    from /usr/lib/libffi.so.5
  • #11 ffi_call
    from /usr/lib/libffi.so.5
  • #12 ??
    from /usr/lib/libgjs.so.0
  • #13 ??
    from /usr/lib/libgjs.so.0
  • #14 ??
    from /usr/lib/libmozjs185.so.1.0
  • #15 ??
    from /usr/lib/libmozjs185.so.1.0
  • #16 ??
    from /usr/lib/libmozjs185.so.1.0
  • #17 ??
    from /usr/lib/libmozjs185.so.1.0
  • #18 ??
    from /usr/lib/libmozjs185.so.1.0
  • #19 ??
    from /usr/lib/libmozjs185.so.1.0
  • #20 ??
    from /usr/lib/libmozjs185.so.1.0
  • #21 ??
    from /usr/lib/libmozjs185.so.1.0
  • #22 ??
    from /usr/lib/libmozjs185.so.1.0
  • #23 ??
    from /usr/lib/libmozjs185.so.1.0
  • #24 ??
    from /usr/lib/libmozjs185.so.1.0
  • #25 ??
    from /usr/lib/libmozjs185.so.1.0
  • #26 ??
    from /usr/lib/libmozjs185.so.1.0
  • #27 ??
    from /usr/lib/libmozjs185.so.1.0
  • #28 ??
    from /usr/lib/libmozjs185.so.1.0
  • #29 ??
    from /usr/lib/libmozjs185.so.1.0
  • #30 ??
    from /usr/lib/libmozjs185.so.1.0
  • #31 ??
    from /usr/lib/libmozjs185.so.1.0
  • #32 ??
    from /usr/lib/libmozjs185.so.1.0
  • #33 ??
    from /usr/lib/libmozjs185.so.1.0
  • #34 JS_EvaluateUCScriptForPrincipals
    from /usr/lib/libmozjs185.so.1.0
  • #35 JS_EvaluateUCScript
    from /usr/lib/libmozjs185.so.1.0
  • #36 gjs_context_eval
    from /usr/lib/libgjs.so.0
  • #37 ??
    from /usr/lib/gnome-shell/libgnome-shell.so
  • #38 meta_plugin_manager_initialize
    from /usr/lib/libmutter.so.0
  • #39 meta_compositor_manage_screen
    from /usr/lib/libmutter.so.0
  • #40 meta_display_open
    from /usr/lib/libmutter.so.0
  • #41 meta_run
    from /usr/lib/libmutter.so.0
  • #42 main

Could you post the contents of ~/.pki/nssdb/pkcs11.txt and the list of files in ~/.pki/nssdb ?
Comment 6 Mantas Mikulėnas (grawity) 2012-03-14 20:09:34 UTC
The files are:

/home/grawity/.pki/nssdb
├── [-rw------- grawity  grawity   10K]  cert9.db
├── [-rw------- grawity  grawity   13K]  key4.db
└── [-rw------- grawity  grawity   598]  pkcs11.txt

pkcs11.txt is:

<<EOF

library=
name=NSS Internal PKCS #11 Module
parameters=configdir='sql:/home/grawity/.pki/nssdb' certPrefix='' keyPrefix='' secmod='secmod.db' flags= updatedir='/home/grawity/.local/share/evolution' updateCertPrefix='' updateKeyPrefix='' updateid='/home/grawity/.local/share/evolution' updateTokenDescription='Evolution S/MIME'
NSS=Flags=internal,critical trustOrder=75 cipherOrder=100 slotParams=(1={slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512] askpw=any timeout=30})

library=/usr/lib/libnssckbi.so
name=Mozilla Root Certs
NSS=trustOrder=100

EOF

A completely empty ~/.pki/nssdb/ has the same problem.

Strangely enough, I could not reproduce this with a different account.
Comment 7 Stef Walter 2012-03-14 20:12:11 UTC
Really strange, and interesting. Could you install the debug info for NetworkManager-glib and gnome-shell and do the gnome-shell backtrace again?
Comment 8 Mantas Mikulėnas (grawity) 2012-03-14 20:15:34 UTC
Well, crap. After some more browsing, it turns out that this is my own fault. :(

I had a ~/.pkcs11/modules/nss, pointing to the shared NSS database. Apparently, I used to have p11-kit-proxy.so installed as a PKCS#11 module in Thunderbird & Firefox, to access the shared database directly and avoid duplication of certificates between several programs.

Removing the ~/.pkcs11 configuration fixes this...
Comment 9 Stef Walter 2012-03-14 20:33:32 UTC
So NSS was loading p11-kit-proxy which was in turn loading NSS? Yeah, that'll do it. Although it's strange that p11-kit-proxy.so didn't show up in your nssdb/pkcs11.txt config.
Comment 10 Mantas Mikulėnas (grawity) 2012-03-14 20:53:40 UTC
It didn't because Firefox and Thunderbird use their own private NSS databases and configuration, ignoring ~/.pki/nssdb. Firefox NSS would load p11-kit which would load NSS again, this time for ~/.pki/nssdb.
Comment 11 Stef Walter 2012-03-14 21:28:35 UTC
Ah I see. So let's close this bug. 

BTW, thanks for trying out p11-kit and putting it through its paces. If you do see further bugs or problems, I'd love to hear about them.