[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Re: help with debugging
The crash seems to happen approximately daily. Here's more debugging text.
mihai@evo:~/frogmod-justice$ gdb frogserv core.14829
GNU gdb 6.8-debian
Copyright (C) 2008 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 "i486-linux-gnu"...
warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/i686/cmov/librt.so.1...done.
Loaded symbols for /lib/i686/cmov/librt.so.1
Reading symbols from /usr/lib/libGeoIP.so.1...done.
Loaded symbols for /usr/lib/libGeoIP.so.1
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /lib/i686/cmov/libresolv.so.2...done.
Loaded symbols for /lib/i686/cmov/libresolv.so.2
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/i686/cmov/libm.so.6...done.
Loaded symbols for /lib/i686/cmov/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/i686/cmov/libc.so.6...done.
Loaded symbols for /lib/i686/cmov/libc.so.6
Reading symbols from /lib/i686/cmov/libpthread.so.0...done.
Loaded symbols for /lib/i686/cmov/libpthread.so.0
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/i686/cmov/libnss_files.so.2...done.
Loaded symbols for /lib/i686/cmov/libnss_files.so.2
Reading symbols from /lib/libnss_mdns4_minimal.so.2...done.
Loaded symbols for /lib/libnss_mdns4_minimal.so.2
Reading symbols from /lib/i686/cmov/libnss_dns.so.2...done.
Loaded symbols for /lib/i686/cmov/libnss_dns.so.2
Core was generated by `/home/mihai/frogmod-justice/frogserv'.
Program terminated with signal 11, Segmentation fault.
[New process 14829]
#0 evhttp_request_get_input_buffer (req=0x99d90f8) at http.c:3014
3014 {
(gdb) up
#1 0x08091a0e in _bufferevent_run_eventcb (bufev=0x20, what=0) at
bufferevent.c:264
264 bufev->errorcb(bufev, what, bufev->cbarg);
Current language: auto; currently c
(gdb)
#2 0x080928cd in bufferevent_connect_getaddrinfo_cb (result=-4,
ai=0x99e3100, arg=0x99d90f8) at bufferevent_sock.c:444
444 _bufferevent_run_eventcb(bev, BEV_EVENT_ERROR);
(gdb) list 434
429 static void
430 bufferevent_connect_getaddrinfo_cb(int result, struct evutil_addrinfo *ai,
431 void *arg)
432 {
433 struct bufferevent *bev = arg;
434 struct bufferevent_private *bev_p =
435 EVUTIL_UPCAST(bev, struct bufferevent_private, bev);
436 int r;
437 BEV_LOCK(bev);
438
(gdb)
439 bufferevent_unsuspend_write(bev, BEV_SUSPEND_LOOKUP);
440 bufferevent_unsuspend_read(bev, BEV_SUSPEND_LOOKUP);
441
442 if (result != 0) {
443 bev_p->dns_error = result;
444 _bufferevent_run_eventcb(bev, BEV_EVENT_ERROR);
445 _bufferevent_decref_and_unlock(bev);
446 if (ai)
447 evutil_freeaddrinfo(ai);
448 return;
(gdb) print bev[0]
$1 = {ev_base = 0x981d660, be_ops = 0x80ab4e0, ev_read =
{ev_active_next = {tqe_next = 0x0, tqe_prev = 0x0}, ev_next =
{tqe_next = 0x0, tqe_prev = 0x99d9150}, ev_timeout_pos =
{ev_next_with_common_timeout = {
tqe_next = 0xffffffff, tqe_prev = 0x0}, min_heap_idx = -1},
ev_fd = 21, ev_base = 0x981d660, _ev = {ev_io = {ev_io_next =
{tqe_next = 0x0, tqe_prev = 0x99d9168}, ev_timeout = {tv_sec = 0,
tv_usec = 0}}, ev_signal = {ev_signal_next = {tqe_next =
0x0, tqe_prev = 0x99d9168}, ev_ncalls = 0, ev_pncalls = 0x0}},
ev_events = 18, ev_res = 0, ev_flags = 128, ev_pri = 5 '\005',
ev_closure = 2 '\002', ev_timeout = {tv_sec = 0, tv_usec = 0},
ev_callback = 0x8092060 <bufferevent_readcb>, ev_arg = 0x99d90f8},
ev_write = {ev_active_next = {tqe_next = 0x0, tqe_prev = 0x0}, ev_next
= {
tqe_next = 0x0, tqe_prev = 0x99eca48}, ev_timeout_pos =
{ev_next_with_common_timeout = {tqe_next = 0xffffffff, tqe_prev =
0x0}, min_heap_idx = -1}, ev_fd = 21, ev_base = 0x981d660, _ev =
{ev_io = {
ev_io_next = {tqe_next = 0x0, tqe_prev = 0x984be68},
ev_timeout = {tv_sec = 45, tv_usec = 0}}, ev_signal = {ev_signal_next
= {tqe_next = 0x0, tqe_prev = 0x984be68}, ev_ncalls = 45, ev_pncalls =
0x0}},
ev_events = 20, ev_res = 0, ev_flags = 128, ev_pri = 5 '\005',
ev_closure = 2 '\002', ev_timeout = {tv_sec = 803939, tv_usec =
464008}, ev_callback = 0x8091df0 <bufferevent_writecb>, ev_arg =
0x99d90f8},
input = 0x99d9208, output = 0x99d9258, wm_read = {low = 0, high =
0}, wm_write = {low = 0, high = 0}, readcb = 0, writecb = 0, errorcb =
0x809d400 <evhttp_connection_cb>, cbarg = 0x99e3100, timeout_read = {
tv_sec = 0, tv_usec = 0}, timeout_write = {tv_sec = 45, tv_usec =
0}, enabled = 0}
(gdb) print bev_p[0]
No symbol "bev_p" in current context.
(gdb)
It seems that by the time _bufferevent_run_eventcb() is called, its
bufev argument ends up being 0x20. No idea what to do next.
On Thu, Sep 16, 2010 at 11:17 AM, Mihai Draghicioiu
<mihai.draghicioiu@xxxxxxxxx> wrote:
> Hi, i've received a http/dns related crash inside libevent code, and
> i'm not sure if it's a libevent bug or my application's bug.
>
> I'm using 2.0.7-rc on linux.
>
> The code that uses the http code is here
> http://github.com/vampirefrog/frogmod-justice/blob/master/fpsgame/server.cpp#L746
> Lines 746-790.
> It tries to do a simple POST request to a pre-configured URL.
>
> The backtrace:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0xb74af6c0 (LWP 8189)]
> evhttp_request_get_input_buffer (req=0x8a57dd0) at http.c:3014
> 3014 Â Â{
> Current language: Âauto; currently c
> (gdb) backtrace
> #0 Âevhttp_request_get_input_buffer (req=0x8a57dd0) at http.c:3014
> #1 Â0x080919fe in _bufferevent_run_eventcb (bufev=0x20, what=0) at
> bufferevent.c:264
> #2 Â0x080928bd in bufferevent_connect_getaddrinfo_cb (result=-4,
> ai=0x8a47d50, arg=0x8a57dd0) at bufferevent_sock.c:444
> #3 Â0x0809fa39 in evdns_getaddrinfo_timeout_cb (fd=-1, what=1,
> ptr=0x8a58100) at evdns.c:4112
> #4 Â0x0808a5aa in event_base_loop (base=0x8607660, flags=<value
> optimized out>) at event.c:1288
> #5 Â0x0808b1b9 in event_base_dispatch (event_base=0x8607660) at event.c:1382
> #6 Â0x08061439 in rundedicatedserver () at
> /home/mihai/frogmod-justice/engine/server.cpp:828
> #7 Â0x08062c10 in initserver (listen=true, dedicated=true) at
> /home/mihai/frogmod-justice/engine/server.cpp:1010
> #8 Â0x08062d08 in main (argc=1, argv=0xbfdac3a4) at
> /home/mihai/frogmod-justice/engine/server.cpp:107
>
> I've stopped gdb without saving a core dump, but this crash has
> happened before and it will happen again. It seems to be related to
> dns timeout. If i add the http host in /etc/hosts, this crash doesn't
> happen anymore.
>
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.