gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix segfault when running GN_OP_Terminate


From: Bastien Nocera
Subject: [PATCH] fix segfault when running GN_OP_Terminate
Date: Mon, 13 Jun 2005 18:59:40 +0100

Heya,

I was getting a segfault when running the GN_OP_Terminate as a function,
because it looks like state->device.device_instance was never
initialised.

Patch below.

This is what valgrind told me:
==10918==
==10918== Thread 4:
==10918== Conditional jump or move depends on uninitialised value(s)
==10918==    at 0x1B9265AC: device_close (device.c:117)
==10918==    by 0x1B95C273: link_terminate (utils.c:55)
==10918==    by 0x1B936E1E: pgen_terminate (generic.c:51)
==10918==    by 0x1B9540A9: Terminate (atgen.c:1772)
==10918==    by 0x1B9542A5: Functions (atgen.c:242)
==10918==    by 0x1B9247E3: gn_sm_functions (gsm-statemachine.c:347)
==10918==    by 0x8053633: phonemgr_utils_guess_driver (phonemgr-
utils.c:203)
==10918==    by 0x8052909: phonemgr_listener_connect (phonemgr-
listener.c:226)
==10918==    by 0x804F6DB: connect_phone_thread (connection.c:87)
==10918==    by 0x1418E8: g_thread_create_proxy (gthread.c:561)
==10918==    by 0x189340: start_thread (in /lib/tls/libpthread-2.3.5.so)
==10918==    by 0xC45FED: clone (in /lib/tls/libc-2.3.5.so)
==10918==
==10918== Conditional jump or move depends on uninitialised value(s)
==10918==    at 0x1B9056F8: free (vg_replace_malloc.c:152)
==10918==    by 0x1B9265C0: device_close (device.c:118)
==10918==    by 0x1B95C273: link_terminate (utils.c:55)
==10918==    by 0x1B936E1E: pgen_terminate (generic.c:51)
==10918==    by 0x1B9540A9: Terminate (atgen.c:1772)
==10918==    by 0x1B9542A5: Functions (atgen.c:242)
==10918==    by 0x1B9247E3: gn_sm_functions (gsm-statemachine.c:347)
==10918==    by 0x8053633: phonemgr_utils_guess_driver (phonemgr-
utils.c:203)
==10918==    by 0x8052909: phonemgr_listener_connect (phonemgr-
listener.c:226)
==10918==    by 0x804F6DB: connect_phone_thread (connection.c:87)
==10918==    by 0x1418E8: g_thread_create_proxy (gthread.c:561)
==10918==    by 0x189340: start_thread (in /lib/tls/libpthread-2.3.5.so)
==10918==
==10918== Invalid free() / delete / delete[]
==10918==    at 0x1B905743: free (vg_replace_malloc.c:152)
==10918==    by 0x1B9265C0: device_close (device.c:118)
==10918==    by 0x1B95C273: link_terminate (utils.c:55)
==10918==    by 0x1B936E1E: pgen_terminate (generic.c:51)
==10918==    by 0x1B9540A9: Terminate (atgen.c:1772)
==10918==    by 0x1B9542A5: Functions (atgen.c:242)
==10918==    by 0x1B9247E3: gn_sm_functions (gsm-statemachine.c:347)
==10918==    by 0x8053633: phonemgr_utils_guess_driver (phonemgr-
utils.c:203)
==10918==    by 0x8052909: phonemgr_listener_connect (phonemgr-
listener.c:226)
==10918==    by 0x804F6DB: connect_phone_thread (connection.c:87)
==10918==    by 0x1418E8: g_thread_create_proxy (gthread.c:561)
==10918==    by 0x189340: start_thread (in /lib/tls/libpthread-2.3.5.so)
==10918==  Address 0x1 is not stack'd, malloc'd or (recently) free'd

Please CC: me on the answers as I'm not subscribed to the list.

---
Bastien Nocera <address@hidden> 

Attachment: gnokii-init-device-instance.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]