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 608510 - assertion failure when item is not in keyring
assertion failure when item is not in keyring
Status: RESOLVED FIXED
Product: libgnome-keyring
Classification: Core
Component: General
2.29.x
Other Linux
: Normal critical
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
: 599000 608709 611025 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-01-30 08:20 UTC by Jürg Billeter
Modified: 2019-02-22 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Possible fix (651 bytes, patch)
2010-01-30 08:20 UTC, Jürg Billeter
none Details | Review
Change the return value (1.02 KB, patch)
2010-02-16 12:07 UTC, Vincent Untz
none Details | Review
Fix regressed regression (1.76 KB, patch)
2010-03-30 13:43 UTC, Stef Walter
committed Details | Review

Description Jürg Billeter 2010-01-30 08:20:36 UTC
Created attachment 152619 [details] [review]
Possible fix

When trying to open a password-protected document in evince where the password hasn't been stored in the keyring yet, I get the following assertion failure:

ERROR:gnome-keyring.c:105:prepare_get_secret: assertion failed: (path)

Evince uses gnome_keyring_find_password_sync to lookup the document pasword.

The attached patch appears to fix this, however, I'm not familiar at all with the libgnome-keyring codebase, so I don't know whether the patch makes sense.
Comment 1 Jürg Billeter 2010-02-11 20:18:02 UTC
*** Bug 608709 has been marked as a duplicate of this bug. ***
Comment 2 Sebastien Bacher 2010-02-12 17:00:15 UTC
Could somebody review the change? It's a blocker to get gnome-keyring 2.29 in ubuntu lucid now
Comment 3 freggy1 2010-02-13 15:34:48 UTC
Bug #599000 is actually the same as this one.

To reproduce: start mission-control-5 built with gnome-keyring support. It will assert immediately:

Starting program: /usr/lib64/mission-control-5 
[Thread debugging using libthread_db enabled]
**
ERROR:gnome-keyring.c:105:prepare_get_secret: assertion failed: (path)

Program received signal SIGABRT, Aborted.
0x00007ffff67ce955 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64	  return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
Missing debug package(s), you should install: libgcrypt-debug libgpg-error-debug pcre-debug telepathy-glib-debug zlib-debug
(gdb) thread apply all bt

Thread 1 (Thread 0x7ffff7fcb700 (LWP 2253))

  • #0 raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #1 abort
    at abort.c line 92
  • #2 IA__g_assertion_message
  • #3 IA__g_assertion_message_expr
    at gtestutils.c line 1329
  • #4 prepare_get_secret
    at gnome-keyring.c line 105
  • #5 find_password_2_reply
    at gnome-keyring.c line 4326
  • #6 on_open_session_aes
    at gkr-session.c line 300
  • #7 on_pending_call_notify
    at gkr-operation.c line 301
  • #8 complete_pending_call_and_unlock
    at dbus-connection.c line 2227
  • #9 dbus_connection_dispatch
    at dbus-connection.c line 4390
  • #10 message_queue_dispatch
    at egg-dbus.c line 75
  • #11 g_main_dispatch
    at gmain.c line 1960
  • #12 IA__g_main_context_dispatch
    at gmain.c line 2513
  • #13 g_main_context_iterate
    at gmain.c line 2591
  • #14 IA__g_main_loop_run
    at gmain.c line 2799
  • #15 main
    at mc-server.c line 81

Comment 4 Stef Walter 2010-02-14 04:29:20 UTC
Thanks for the patch Jürg.

Sorry, I've had a fix for this, but didn't have time to test it before pushing it into master. Finally committed this in libgnome-keyring, with slightly different behavior to the above patch (returns a NULL password).
Comment 5 Guillaume Desmottes 2010-02-15 20:18:23 UTC
*** Bug 599000 has been marked as a duplicate of this bug. ***
Comment 6 Vincent Untz 2010-02-16 12:06:19 UTC
(In reply to comment #4)
> Sorry, I've had a fix for this, but didn't have time to test it before pushing
> it into master. Finally committed this in libgnome-keyring, with slightly
> different behavior to the above patch (returns a NULL password).

Apparently, we need to return GNOME_KEYRING_RESULT_NO_MATCH and not GNOME_KEYRING_RESULT_OK (with NULL password): at least mission-control relies on this behavior to correctly work, so changing this would be an ABI change.
Comment 7 Vincent Untz 2010-02-16 12:07:54 UTC
Created attachment 153911 [details] [review]
Change the return value
Comment 8 Stef Walter 2010-02-16 15:22:51 UTC
You're right. For some reason I thought this was in a different code path. Your patch looks good. However the tests need updating:

ERROR:test-keyrings.c:505:test_find_no_password: assertion failed (GNOME_KEYRING_RESULT_OK == res): (0 == 9)
GTester: last random seed: R02Scbb60db271e758b19d246e7f36c8041c

Run 'make check' and/or library/tests/run-auto-test

Due to bug fixes, the tests require the latest gnome-keyring to be installed, not just built.
Comment 9 Jürg Billeter 2010-03-02 15:38:12 UTC
*** Bug 611025 has been marked as a duplicate of this bug. ***
Comment 10 Götz Waschk 2010-03-10 14:27:40 UTC
Does this change reopen the problem?
http://git.gnome.org/browse/libgnome-keyring/commit/?id=18affdaadb8c71bfc4092d9281b03c9833027c6a
Comment 11 Stef Walter 2010-03-30 13:43:40 UTC
Created attachment 157484 [details] [review]
Fix regressed regression

You're right. Sorry about that. The original design was for gnome_keyring_find_password and friends to return NULL, and the code in the gnome-2-28 library attests to that. However because of the behavior of the daemon, this never actually happened. 

So here's a patch that changes this back. We now again return GNOME_KEYRING_RESULT_NO_MATCH.
Comment 12 Vincent Untz 2010-03-30 14:52:14 UTC
Thanks Stef, I've committed your patch ;-)