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 530316 - gnome-keyring-daemon crashed with SIGSEGV in location_manager_hal_init()
gnome-keyring-daemon crashed with SIGSEGV in location_manager_hal_init()
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: general
2.22.x
Other Linux
: Normal critical
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2008-04-28 09:06 UTC by Sebastien Bacher
Modified: 2008-05-19 12:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Sebastien Bacher 2008-04-28 09:06:56 UTC
The bug has been opened on https://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/218434

"...
The occurrence of this bug seems most prevalent on USB, Compact Flash (attached via IDE) and SCSI based boot devices.

Debug
--------
I have attached gdb to gnome-keyring-manager and captured a full backtrace, register info and tread backtrace at the point of SEGV. As I ran gdb pointed at the sources for keyring-daemon I have also captured 'list'.

On the console I get the following output:
>** Message: adding removable location: volume_label_Ubuntu_8_04_i386 at /media/cdrom0
>** Message: adding removable location: volume_uuid_87cfbf2f_6fcb_42cb_95ef_92e3aec6d4f1 at /
>
>** (gnome-keyring-daemon:6249): WARNING **: location device 'FILE' already registered at: /
>
>Program received signal SIGSEGV, Segmentation fault.

It seems that gnome-keyring-daemon is being screwed up while it tries to probe the HAL about storage - This might explain the apparent correlation between boot disk type and whether one sees the bug.

We die in hal_device_property() at gkr-location.c:324

 323 locvol = g_hash_table_lookup (pv->volumes_by_name, name);
 324 locvol->hal_volume = TRUE;

It seems that we might benefit from some kind of bounds check in this code as we seem to be taking it as gospel that 'locvol' will always return a valid address.

The SEGV happens while executing the instruction @ 0x080759c7 - This has been consistent throughout my old /var/log/messages files:

0x080759c2 <hal_device_property+834>: call 0x804f8e0 <g_hash_table_lookup@plt>
0x080759c7 <hal_device_property+839>: movl $0x1,0x14(%eax)
0x080759ce <hal_device_property+846>: jmp 0x80758a5 <hal_device_property+549>

So in order to set locvol->hal_volume=TRUE we take $eax + 0x14, dereference it and write a gboolean there. This is fine for the first few volumes and $eax always = 0x80ca828 which I trust is the valid address of a GkrLocationVolume structure. But when I get a SEGV $eax = 0 
..."

The corresponding stacktrace:

""#0 hal_device_property (hal_ctx=0x80af768,
    udi=0x80b0138 "/org/freedesktop/Hal/devices/volume_uuid_744a680e_31d7_4045_bc59_111f6592138f", key=0x808faf4 "volume.is_mounted", is_removed=0, is_added=1)
    at gkr-location.c:324
324 gkr-location.c: No such file or directory.
 in gkr-location.c
(gdb) bt
  • #0 hal_device_property
    at gkr-location.c line 324
  • #1 location_manager_hal_init
    at gkr-location.c line 360
  • #2 IA__g_type_create_instance
    at /build/buildd/glib2.0-2.16.3/gobject/gtype.c line 1575
  • #3 g_object_constructor
    at /build/buildd/glib2.0-2.16.3/gobject/gobject.c line 1046
  • #4 IA__g_object_newv
    at /build/buildd/glib2.0-2.16.3/gobject/gobject.c line 937
  • #5 IA__g_object_new_valist
    at /build/buildd/glib2.0-2.16.3/gobject/gobject.c line 986
  • #6 IA__g_object_new
    at /build/buildd/glib2.0-2.16.3/gobject/gobject.c line 795
  • #7 gkr_location_manager_get
    at gkr-location.c line 624
  • #8 location_to_volume
    at gkr-location.c line 905
  • #9 gkr_location_to_path
    at gkr-location.c line 972
  • #10 keyrings_init
    at gkr-keyrings.c line 184
  • #11 gkr_keyrings_find
    at gkr-keyrings.c line 325
  • #12 gkr_keyrings_get_login
    at gkr-keyrings.c line 266
  • #13 gkr_keyring_login_unlock
    at gkr-keyring-login.c line 141

Comment 1 Stef Walter 2008-05-18 12:51:35 UTC
Thanks for looking into that so deeply. Fixed. This will be included in 2.22.2
Comment 2 Samuel M. Zehel Jnr. 2008-05-19 08:25:35 UTC
Thanks to everyone for finding a fix.  When might 2.22.2 be released?
Comment 3 Stef Walter 2008-05-19 12:30:23 UTC
May 28th: http://live.gnome.org/TwoPointTwentythree