[Libtorrent-devel] rTorrent crashes on XMLRPC request

Sergei Zhirikov sfzhi at yahoo.com
Fri Apr 11 23:31:50 UTC 2008


Hi everyone,

I've been using rTorrent with XMLRPC for a few months. It would crash once
in a while, but not too often.
The real trouble came when I upgraded Linux kernel from 2.6.18.8 to
2.6.24.4. Now rTorrent crashes on
*almost every* XMLRPC request. The stack trace from gdb (see below) points
to a call to delete[] in scgi_task.cc,
but I didn't find any evidence of double free, so it looks to me like memory
corruption happens elsewhere.
I'm using rTorrent 0.7.9 with xmlrpc-c 1.14.02 (tried older versions of
xmlrpc-c, the same problem).
Did anyone encounter this kind of problem? Any hints about how to deal with
it are appreciated.
(I'm experienced in C/C++ programming, but both rTorrent and xmlrpc-c are
unfamiliar territory to me).

** glibc detected *** double free or corruption (!prev): 0x082f76c0 ***
Program received signal SIGABRT, Aborted.
0xa7965230 in raise () from /lib/libc.so.6
(gdb) bt
#0  0xa7965230 in raise () from /lib/libc.so.6
#1  0xa79666be in abort () from /lib/libc.so.6
#2  0xa7998ca9 in __libc_message () from /lib/libc.so.6
#3  0xa799e40b in malloc_printerr () from /lib/libc.so.6
#4  0xa799edbd in free () from /lib/libc.so.6
#5  0xa7c6b611 in operator delete () from /usr/lib/libstdc++.so.6
#6  0xa7c6b66c in operator delete[] () from /usr/lib/libstdc++.so.6
#7  0x080d935e in rpc::SCgiTask::close (this=0x8126a00) at scgi_task.cc:87
#8  0x080d92b5 in rpc::SCgiTask::receive_write (this=0x8126a00,
    buffer=0x81efab0 "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\r\n<methodResponse>\r\n<params>\r\n<param><value><array
><data>\r\n<value><array><data>\r\n<value><string>DDE9DC692D829159EC883A27A9
B7A69C0F45D296</string></value>\r\n<value>"..., length=1434)
    at scgi_task.cc:218
#9  0x080d8dfb in rak::mem_fn2_t<rpc::SCgiTask, bool, char const*, unsigned
int>::operator() (this=0x81e3b60,
    arg1=0x81efab0 "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\r\n<methodResponse>\r\n<params>\r\n<param><value><array
><data>\r\n<value><array><data>\r\n<value><string>DDE9DC692D829159EC883A27A9
B7A69C0F45D296</string></value>\r\n<value>"..., arg2=1434)
    at ../../rak/functional_fun.h:254
#10 0x080d9a9f in rpc::XmlRpc::process (this=0x82f76c0,
    inBuffer=0x82f76c0 "Status: 200 OK\r\nContent-Type:
text/xml\r\nContent-Length: 1434\r\n\r\n<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\r\n<methodResponse>\r\n<params>\r\n<param><value><array
><data>\r\n<value><array><data>\r\n<value><string>DD"...,
    length=1367, slotWrite=@0x6) at ../../rak/functional_fun.h:136
#11 0x0806c7b2 in rak::mem_fn3_t<rpc::XmlRpc, bool, char const*, unsigned
int, rak::function2<bool, char const*, unsigned int> >::operator()
(this=0x8126c88,
    arg1=0x82f76c0 "Status: 200 OK\r\nContent-Type:
text/xml\r\nContent-Length: 1434\r\n\r\n<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\r\n<methodResponse>\r\n<params>\r\n<param><value><array
><data>\r\n<value><array><data>\r\n<value><string>DD"..., arg2=1367,
    arg3=@0xaf99dd60) at ../rak/functional_fun.h:239
#12 0x080d7f38 in rpc::SCgi::receive_call (this=0x6, task=0x6,
    buffer=0x82f76c0 "Status: 200 OK\r\nContent-Type:
text/xml\r\nContent-Length: 1434\r\n\r\n<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\r\n<methodResponse>\r\n<params>\r\n<param><value><array
><data>\r\n<value><array><data>\r\n<value><string>DD"..., length=1367)
    at ../../rak/functional_fun.h:153
#13 0x080d94b3 in rpc::SCgiTask::event_read (this=0x8126a00) at
scgi_task.cc:170
#14 0xa7de3a99 in torrent::PollEPoll::perform () from
/usr/lib/libtorrent.so.10
#15 0x080b2a92 in core::PollManagerEPoll::poll (this=0x8110508,
timeout={m_time = 882459}) at poll_manager_epoll.cc:112
#16 0x08075646 in main (argc=3, argv=0xaf99df94) at main.cc:269





More information about the Libtorrent-devel mailing list