View Issue Details

IDProjectCategoryView StatusLast Update
0003916libmicrohttpdotherpublic2015-09-16 14:32
ReporterChristian Grothoff Assigned ToChristian Grothoff  
PrioritynormalSeveritycrashReproducibilityhave not tried
Status closedResolutionno change required 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Version0.9.43 
Target Version0.9.42Fixed in Version0.9.43 
Summary0003916: Segfault after MHD_quiesce_daemon()
DescriptionMarkus Doppelbauer reported on the mailinglist:

Sorry - I can't provide a testcase - I only have the coredumps.
IMHO the problem is, that two threads work in the same critical section
MHD_cleanup_connections()

#1 MHD-Thread from microhttpd/daemon.c:2937 from
MHD_select_thread()
#2 Worker-thread from microhttpd/daemon.c:4630 from
MHD_get_daemon_info( MHD_DAEMON_INFO_CURRENT_CONNECTIONS )

Both threads meet each other in MHD_cleanup_connections()
Down below an other core-dump. In that case the worker-thread crashed.

Thanks a lot
Markus



# Main-Thread after MHD_quiesce_daemon()

#1 0x0000003bd6e33e05 in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x0000003bd6e70537 in __libc_message () from /lib64/libc.so.6
No symbol table info available.
#3 0x0000003bd6e75e66 in malloc_printerr () from /lib64/libc.so.6
No symbol table info available.
#4 0x000000000045fc2a in MHD_cleanup_connections (daemon=0x28d8bf0) at
microhttpd/daemon.c:2038
        pos = 0x7fb4f00009c0
#5 0x000000000045ff54 in MHD_get_daemon_info (daemon=0x28cf9f0,
info_type=<value optimized out>) at microhttpd/daemon.c:4630
        i = <value optimized out>

# MHD-Thread

#0 0x0000003bd720e264 in __lll_lock_wait () from /lib64/libpthread.so.0
No symbol table info available.
#1 0x0000003bd7209508 in _L_lock_854 () from /lib64/libpthread.so.0
No symbol table info available.
#2 0x0000003bd72093d7 in pthread_mutex_lock ()
from /lib64/libpthread.so.0
No symbol table info available.
#3 0x00000000006c73fe in http_NotifyConnectionCallback
(cls=0x7fff32d7a1e0, connection=<value optimized out>,
socket_context=<value optimized out>, toe=<value optimized out>) at
global/daemon.cpp:1782
        daemonqueue = 0x7fff32d7a1e0
#4 0x000000000045fc5a in MHD_cleanup_connections (daemon=0x28d8bf0) at
microhttpd/daemon.c:2046
        pos = 0x7fb4f00009c0
#5 0x0000000000463a25 in MHD_select_thread (cls=0x28d8bf0) at
microhttpd/daemon.c:2937
        daemon = 0x28d8bf0
#6 0x0000003bd72079d1 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#7 0x0000003bd6ee88fd in clone () from /lib64/libc.so.6
No symbol table info available.


Hi,

Maybe it is not allowed to call
MHD_get_daemon_info( MHD_DAEMON_INFO_CURRENT_CONNECTIONS )
at any time from any thread? Maybe only from
MHD_NotifyConnectionCallback() ?

Thanks a lot
Markus

Hello,

Since I have moved the call
MHD_get_daemon_info( MHD_DAEMON_INFO_CURRENT_CONNECTIONS )
to MHD_NotifyConnectionCallback() no segfaults did occur.
Could this be true? Maybe update the documentation?

Thanks a lot
Markus





TagsNo tags attached.

Activities

Christian Grothoff

2015-09-16 14:31

manager   ~0009631

Markus now writes:

Die Sache war wohl mein Fehler - ich habe die Funktion
    MHD_get_daemon_info( MHD_DAEMON_INFO_CURRENT_CONNECTIONS )
von einem unbeteiligtem Thread aus augerufen. Bitte die beiden issues
schließen - und danke für die Hilfe.

Issue History

Date Modified Username Field Change
2015-07-25 15:50 Christian Grothoff New Issue
2015-07-25 15:51 Christian Grothoff Status new => acknowledged
2015-09-16 14:31 Christian Grothoff Note Added: 0009631
2015-09-16 14:32 Christian Grothoff Assigned To => Christian Grothoff
2015-09-16 14:32 Christian Grothoff Status acknowledged => closed
2015-09-16 14:32 Christian Grothoff Resolution open => no change required
2015-09-16 14:32 Christian Grothoff Product Version => 0.9.43
2015-09-16 14:32 Christian Grothoff Fixed in Version => 0.9.43
2015-09-16 14:32 Christian Grothoff Target Version => 0.9.42