Hello,

After making debug build of ophonekitd I can shed a little more light on the segfaults I've been getting. Rather than more reverse engineering I thought I'd put what I have on this list to see if anyone else can detect what the problem might be from this information.

Here is some output:

$ DISPLAY=:0 gdb ophonekitd
GNU gdb (GDB) 6.8.50.20090628-cvs-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "arm-linux-gnueabi". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... (gdb) r Starting program: /usr/bin/ophonekitd [Thread debugging using libthread_db enabled] ** (process:2277): DEBUG: Configuration file read ** (process:2277): DEBUG: Entering ecore loop [New Thread 0x4157e490 (LWP 2280)] ** (process:2277): DEBUG: Phonegui initiated ** (process:2277): DEBUG: Entering glib main loop ** (process:2277): DEBUG: /org/shr/ophonekitd/Usage ** (process:2277): DEBUG: Trying to get the system bus ** (process:2277): DEBUG: Adding signals. ** (process:2277): DEBUG: Added sim AuthStatus. ** (process:2277): DEBUG: Added sim ReadyStatus. ** (process:2277): DEBUG: Added sim IncomingStoredMessage. ** (process:2277): DEBUG: Added call CallStatus. ** (process:2277): DEBUG: Added device Idle Notifier State. ** (process:2277): DEBUG: Added network IncomingUssd. ** (process:2277): DEBUG: Added usage ResourceChanged ** (process:2277): DEBUG: Connected to the buses ** (process:2277): DEBUG: list_resources() ** (process:2277): DEBUG: list_resources_callback() ** (process:2277): DEBUG: Resource CPU available ** (process:2277): DEBUG: Resource TEST available ** (process:2277): DEBUG: Resource Display available ** (process:2277): DEBUG: Resource GSM available ** (process:2277): DEBUG: Request GSM resource ** (process:2277): DEBUG: resource GSM is now enabled ** (process:2277): DEBUG: GSM is ready now
** (process:2277): DEBUG: call ogsmd_device_set_antenna_power()
** (process:2277): DEBUG: resource GSM is now enabled
** (process:2277): DEBUG: request_resource_callback()
** (process:2277): DEBUG: Initiated elementary
** (process:2277): DEBUG: Initiated etk
Failed to handle dbus error: Resource Device is not enabled, current status is 'enabling', 81 (dbus-glib-error-quark), code 32
** (process:2277): DEBUG: power_up_antenna_callback()
Failed to handle dbus error: Resource Device is not enabled, current status is 'enabling', 81 (dbus-glib-error-quark), code 32
** (process:2277): DEBUG: sim_ready_status_callback(status=1074520064)
** (process:2277): DEBUG: sim ready
Failed to handle dbus error: Resource Device is not enabled, current status is 'enabling', 81 (dbus-glib-error-quark), code 32
** (process:2277): DEBUG: get_messagebook_info_callback()

Program received signal SIGSEGV, Segmentation fault.
0x00038e8c in ?? ()
(gdb) bt
#0  0x00038e8c in ?? ()
Cannot access memory at address 0x0
#1  0x4015d490 in g_hash_table_lookup_node (hash_table=0x799f0, key=0xadf8)
at /build/buildd-glib2.0_2.22.2-2-armel-9PSBOh/glib2.0-2.22.2/glib/ghash.c:195
#2  IA__g_hash_table_lookup (hash_table=0x799f0, key=0xadf8)
at /build/buildd-glib2.0_2.22.2-2-armel-9PSBOh/glib2.0-2.22.2/glib/ghash.c:784
#3  0x000096d0 in get_messagebook_info_callback (error=0x0, info=0x799f0,
    userdata=<value optimized out>) at ophonekitd-main.c:474
#4  0x4004a138 in ogsmd_sim_get_messagebook_info_callback ()
   from /usr/lib/libframeworkd-glib.so.0
#5  0x4004976c in ?? () from /usr/lib/libframeworkd-glib.so.0
Cannot access memory at address 0x0
#6  0x4004976c in ?? () from /usr/lib/libframeworkd-glib.so.0
Cannot access memory at address 0x0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) frame 3
#3  0x000096d0 in get_messagebook_info_callback (error=0x0, info=0x799f0,
    userdata=<value optimized out>) at ophonekitd-main.c:474
474                     if((p = g_hash_table_lookup(info, "first")) != NULL)
(gdb) p info
$4 = (GHashTable *) 0x799f0
(gdb) p *info
$5 = {size = 1, mod = 172040, mask = 1, nnodes = 1074173264,
  noccupied = 215992, nodes = 0x0, hash_func = 0x38e50,
key_equal_func = 0x385ac, ref_count = 27, version = 1, key_destroy_func = 0,
  value_destroy_func = 0x19}

Without looking in any detail at how the GHashTable structure works, this looks to me to be corrupt or uninitialised. This would indicate to me that either through some race condition the hash table is being used before it is initialised, or that it has been initialised and then corrupted.

It's also worth noting that occasionally (about 1 time in 10) the segfault does not happen and ophonekitd appears to start up OK.

Any ideas?

Jonathan

_______________________________________________
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland

Reply via email to