Segmentation fault
Hi,
I'm getting segmentation fault with the latest git version. As a modem I'm using Nokia E51.
Sent dbus commands:
[root(a)localhost ~]# dbus-send --print-reply --system --dest=org.ofono / org.ofono.at.Manager.Create string:"dev:/dev/ttyACM0" string:"at" method return sender=:1.404 -> dest=:1.405 reply_serial=2
object path "/modem1"
[root(a)localhost ~]# dbus-send --print-reply --system --dest=org.ofono / org.ofono.at.Manager.Destroy objpath:"/modem1"
method return sender=:1.404 -> dest=:1.406 reply_serial=2 [root(a)localhost ~]# dbus-send --print-reply --system --dest=org.ofono / org.ofono.at.Manager.Create string:"dev:/dev/ttyACM0" string:"at" method return sender=:1.404 -> dest=:1.407 reply_serial=2
object path "/modem2"
gdb output:
ofonod[2191]: SIMManager interface for modem: /modem2 created ofonod[2191]: Registered call forwarding interface ofonod[2191]: Registered call settings interface ofonod[2191]: Sending voice initialization commands ofonod[2191]: cops_list_cb got result: 1 ofonod[2191]: Final response: OK
ofonod[2191]: Got 0 elements
Program received signal SIGSEGV, Segmentation fault. operator_list_callback (error=0xbfffe85c, total=0, list=0x0, data=0x80888f0) at network.c:981
981 network.c: No such file or directory.
in network.c
Missing separate debuginfos, use: debuginfo-install dbus.i586 glibc.i586 (gdb) where
#0 operator_list_callback (error=0xbfffe85c, total=0, list=0x0, data=0x80888f0) at network.c:981
#1 0x0806d4fe in cops_list_cb (ok=1, result=0xbffff0d4, user_data=0x8089600) at atmodem/network-registration.c:316 #2 0x08074513 in g_at_chat_finish_command (p=0x8087820, ok=1, final=0x808af98 "OK") at gatchat.c:347
#3 0x08074e0e in g_at_chat_handle_command_response () at gatchat.c:396 #4 have_line (p=0x8087820, strip_preceding=1) at gatchat.c:480 #5 0x080752a9 in new_bytes () at gatchat.c:664 #6 received_data (channel=0x80876f0, cond=<value optimized out>, data=0x8087820) at gatchat.c:759 #7 0xb7f336c7 in ?? () from /usr/lib/libglib-2.0.so.0 #8 0x080876f0 in ?? () #9 0x00000001 in ?? ()
#10 0x08087820 in ?? ()
#11 0x00000000 in ?? ()
Regards,
Marko
Hi Marko,
Quoted 22 lines
[root(a)localhost ~]# dbus-send --print-reply --system --dest=org.ofono / org.ofono.at.Manager.Create string:"dev:/dev/ttyACM0" string:"at" method return sender=:1.404 -> dest=:1.405 reply_serial=2
object path "/modem1"
[root(a)localhost ~]# dbus-send --print-reply --system --dest=org.ofono / org.ofono.at.Manager.Destroy objpath:"/modem1"
method return sender=:1.404 -> dest=:1.406 reply_serial=2 [root(a)localhost ~]# dbus-send --print-reply --system --dest=org.ofono / org.ofono.at.Manager.Create string:"dev:/dev/ttyACM0" string:"at" method return sender=:1.404 -> dest=:1.407 reply_serial=2
object path "/modem2"gdb output:
ofonod[2191]: SIMManager interface for modem: /modem2 created ofonod[2191]: Registered call forwarding interface ofonod[2191]: Registered call settings interface ofonod[2191]: Sending voice initialization commands ofonod[2191]:
cops_list_cbgot result: 1 ofonod[2191]: Final response: OK
ofonod[2191]: Got 0 elements
Quoted 5 lines
Program received signal SIGSEGV, Segmentation fault.
operator_list_callback(error=0xbfffe85c, total=0, list=0x0, data=0x80888f0) at network.c:981
981network.c: No such file or directory.
innetwork.c
This should not be fixed upstream. Can you check if this is still broken?
Regards,
-Denis
Hi Denis,
Something changed as the segfault is different. With adding and removing the modem like previously showed it now results to one of the following segmentation faults.
Program received signal SIGSEGV, Segmentation fault. 0x0000013c in ?? ()
(gdb) where
#0 0x0000013c in ?? () #1 0xb7e382b6 in ?? () from /usr/lib/libglib-2.0.so.0 #2 0xb7e37b88 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #3 0xb7e3b0eb in ?? () from /usr/lib/libglib-2.0.so.0 #4 0xb7e3b5ba in g_main_loop_run () from /usr/lib/libglib-2.0.so.0 #5 0x0804d345 in main (argc=3, argv=0xabcdef) at main.c:148
(gdb)
Program received signal SIGSEGV, Segmentation fault. update_network_operator_list_init (user_data=0x8e67500) at network.c:806
806 if (netreg->flags &NETWORK_REGISTRATION_FLAG_REQUESTING_OPLIST)
(gdb) where
#0 update_network_operator_list_init (user_data=0x8e67500) at network.c:806 #1 0xb7f172b6 in ?? () from /usr/lib/libglib-2.0.so.0 #2 0xb7f16b88 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #3 0xb7f1a0eb in ?? () from /usr/lib/libglib-2.0.so.0 #4 0xb7f1a5ba in g_main_loop_run () from /usr/lib/libglib-2.0.so.0 #5 0x0804d345 in main (argc=3, argv=0xabcdef) at main.c:148
(gdb)
Here is a small script which can be used to test this. With Nokia E51 it always segfaults before the 100 is reached. Sometimes it is able to do sequence multiple times and sometimes only create-destroy-create is enough.
#!/bin/sh
if [ ! $1 ]; then
echo "Usage example: $0 dev:/dev/ttyACM0"
return;
fi
for i in seq 1 100; do
dbus-send --print-reply --system --dest=org.ofono /\
org.ofono.at.Manager.Create string:"$1" string:"at"
dbus-send --print-reply --system --dest=org.ofono /\
org.ofono.at.Manager.Destroy objpath:"/modem$i" done
Regards,
Marko
Hi Marko,
Quoted 4 lines
Here is a small script which can be used to test this. With Nokia E51 it always segfaults before the 100 is reached. Sometimes it is able to do sequence multiple times and sometimes only create-destroy-create is enough.
I seem to have fixed this issue, it was related to a g_source(s) that were never being cleaned up.
I've now run the script twice (fun to have 100 phonesim windows popping up) and have not encountered a segfault.
Please report back if this is still broken.
Regards,
-Denis