libmicrohttpd
[Top][All Lists]
Advanced

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

[libmicrohttpd] Segfault after MHD_quiesce_daemon()


From: Markus Doppelbauer
Subject: [libmicrohttpd] Segfault after MHD_quiesce_daemon()
Date: Thu, 16 Jul 2015 21:43:00 +0200

Hello,

Sometimes I get some segfaults - after calling "MHD_quiesce_daemon()".
My setup:
MHD with epoll parses requests from a http-socket - and fills a queue.
A worker thread takes the requests from the queue and fills the buffer.
After 'quiesce()' the worker threads checks on every requests if the number
of connections is zero by calling MHD_get_daemon_info(MHD_DAEMON_INFO_CURRENT_CONNECTIONS).

The segfault happens always in "MHD_cleanup_connections()". Down below
the backtrace from gdb.

Thanks a lot
Markus


*MHD thread (this thread segfaults):

#0  0x0000003bd6e32625 in raise () from /lib64/libc.so.6
No symbol table info available.
#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  0x000000000045fbc5 in MHD_cleanup_connections (daemon=0x2c7dc50) at microhttpd/daemon.c:2037
        pos = 0x7f44ec00a220
#5  0x00000000004639c5 in MHD_select_thread (cls=0x2c7dc50) at microhttpd/daemon.c:2935
        daemon = 0x2c7dc50
#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.


* Worker thread (after MHD_quiesce_daemon() - checks if there are still open connections):

#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  0x00000000006cd841 in http_NotifyConnectionCallback (cls=0x7fff9eeffda0, connection=<value optimized out>, socket_context=<value optimized out>, toe=MHD_CONNECTION_NOTIFY_CLOSED)
    at worker.cpp:1776
        daemonqueue = 0x7fff9eeffda0
#4  0x000000000045fbed in MHD_cleanup_connections (daemon=0x2c7dc50) at microhttpd/daemon.c:2044
        pos = 0x7f44ec00a220
#5  0x000000000045fef4 in MHD_get_daemon_info (daemon=0x2c74a50, info_type=<value optimized out>) at microhttpd/daemon.c:4628
        i = <value optimized out>
#6  0x00000000006cbd13 in daemon_http (socket=-1628438856) at worker.cpp:291
#7  0x0000000000f7bfee in main (argc=<value optimized out>, argv=0x7fff9ef02e08) at worker.cpp:691




reply via email to

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