y500 / libtorrent

Automatically exported from code.google.com/p/libtorrent
0 stars 0 forks source link

SIGSEGV at libtorrent_aio branch #275

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
my client was running almost 2300 torrents files and received this seg fault 
while it was sleeping (at the moment it occurred)

i'm posting the gbd log

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffea7fc700 (LWP 2504)]
0x00000000004c3bc3 in message (this=0x7fffe6326830, e=..., host=<value 
optimized out>, web=..., proxy=<value optimized out>) at 
/usr/local/include/boost/system/error_code.hpp:350
350           std::string             message() const  { return 
m_cat->message(value()); }

(gdb) bt
#0  0x00000000004c3bc3 in message (this=0x7fffe6326830, e=..., host=<value 
optimized out>, web=..., proxy=<value optimized out>) at 
/usr/local/include/boost/system/error_code.hpp:350
#1  url_seed_alert (this=0x7fffe6326830, e=..., host=<value optimized out>, 
web=..., proxy=<value optimized out>) at 
../include/libtorrent/alert_types.hpp:841
#2  libtorrent::torrent::on_name_lookup (this=0x7fffe6326830, e=..., 
host=<value optimized out>, web=..., proxy=<value optimized out>) at 
torrent.cpp:4971
#3  0x00000000004f1df6 in call<boost::shared_ptr<libtorrent::torrent>, 
boost::system::error_code const, 
boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>,
 std::_List_iterator<libtorrent::web_seed_entry>, boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> > (owner=0x8e5ac0, base=<value optimized out>) at /usr/local/include/boost/bind/mem_fn_template.hpp:497
#4  operator()<boost::shared_ptr<libtorrent::torrent> > (owner=0x8e5ac0, 
base=<value optimized out>) at 
/usr/local/include/boost/bind/mem_fn_template.hpp:512
#5  operator()<boost::_mfi::mf4<void, libtorrent::torrent, const 
boost::system::error_code&, 
boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>, std::_List
_iterator<libtorrent::web_seed_entry>, 
boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> >, 
boost::_bi::list2<const boost::system::error_code&, const 
boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>&> > 
(owner=0x8e5ac0, base=<value optimized out>)
    at /usr/local/include/boost/bind/bind.hpp:525
#6  operator()<boost::system::error_code, 
boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp> > 
(owner=0x8e5ac0, base=<value optimized out>) at 
/usr/local/include/boost/bind/bind_template.hpp:102
#7  operator() (owner=0x8e5ac0, base=<value optimized out>) at 
/usr/local/include/boost/asio/detail/bind_handler.hpp:118
#8  asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, 
boost::_mfi::mf4<void, libtorrent::torrent, boost::system::error_code const&, 
boost::asio
::ip::basic_resolver_iterator<boost::asio::ip::tcp>, 
std::_List_iterator<libtorrent::web_seed_entry>, 
boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> >, boost::_
bi::list5<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::arg<1>, boost::arg<2>, 
boost::_bi::value<std::_List_iterator<libtorrent::web_seed_entry> >
, boost::_bi::value<boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> > > 
>, boost::system::error_code, 
boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp> > > 
(owner=0x8e5ac0, 
    base=<value optimized out>) at /usr/local/include/boost/asio/handler_invoke_hook.hpp:64
#9  invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, 
boost::_mfi::mf4<void, libtorrent::torrent, boost::system::error_code const&, 
boost::asio::ip::basic_r
esolver_iterator<boost::asio::ip::tcp>, 
std::_List_iterator<libtorrent::web_seed_entry>, 
boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> >, boost::_bi::list5<boo
st::_bi::value<boost::shared_ptr<libtorrent::torrent> >, boost::arg<1>, 
boost::arg<2>, 
boost::_bi::value<std::_List_iterator<libtorrent::web_seed_entry> >, boost::_bi:
:value<boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> > > >, 
boost::system::error_code, 
boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp> >, boost:
:_bi::bind_t<void, boost::_mfi::mf4<void, libtorrent::torrent, 
boost::system::error_code const&, 
boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>, std::_
List_iterator<libtorrent::web_seed_entry>, 
boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> >, 
boost::_bi::list5<boost::_bi::value<boost::shared_ptr<libtorrent::t
orrent> >, boost::arg<1>, boost::arg<2>, 
boost::_bi::value<std::_List_iterator<libtorrent::web_seed_entry> >, 
boost::_bi::value<boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> > > > > 
(owner=0x8e5ac0, base=<value optimized out>) at 
/usr/local/include/boost/asio/detail/handler_invoke_helpers.hpp:39
#10 boost::asio::detail::resolve_op<boost::asio::ip::tcp, 
boost::_bi::bind_t<void, boost::_mfi::mf4<void, libtorrent::torrent, 
boost::system::error_code const&, boost:
:asio::ip::basic_resolver_iterator<boost::asio::ip::tcp>, 
std::_List_iterator<libtorrent::web_seed_entry>, 
boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> >, boo
st::_bi::list5<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::arg<1>, boost::arg<2>, 
boost::_bi::value<std::_List_iterator<libtorrent::web_seed_ent
ry> >, boost::_bi::value<boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> 
> > > >::do_complete (owner=0x8e5ac0, base=<value optimized out>) at 
/usr/local/include/boost/asio/detail/resolve_op.hpp:111
#11 0x000000000046e198 in complete (this=0x908be0) at 
/usr/local/include/boost/asio/detail/task_io_service_operation.hpp:36
#12 do_one (this=0x908be0) at 
/usr/local/include/boost/asio/detail/impl/task_io_service.ipp:292
#13 run (this=0x908be0) at 
/usr/local/include/boost/asio/detail/impl/task_io_service.ipp:131
#14 run (this=0x908be0) at /usr/local/include/boost/asio/impl/io_service.ipp:64
#15 libtorrent::aux::session_impl::main_thread (this=0x908be0) at 
session_impl.cpp:4398
#16 0x0000000000470ace in 
boost::asio::detail::boost_asio_detail_posix_thread_function (arg=0x8aee00) at 
/usr/local/include/boost/asio/detail/impl/posix_thread.ipp:64
#17 0x00007ffff6daed8c in start_thread () from 
/lib/x86_64-linux-gnu/libpthread.so.0
#18 0x00007ffff5d0904d in clone () from /lib/x86_64-linux-gnu/libc.so.6
#19 0x0000000000000000 in ?? ()
(gdb)                    

Original issue reported on code.google.com by mul...@gmail.com on 2 Dec 2011 at 1:47

GoogleCodeExporter commented 8 years ago
it was here in src/torrent.cpp

        void torrent::on_name_lookup(error_code const& e, tcp::resolver::iterator host
                , std::list<web_seed_entry>::iterator web, tcp::endpoint proxy)
        {
                TORRENT_ASSERT(m_ses.is_network_thread());

                INVARIANT_CHECK;

                ...

                if (e || host == tcp::resolver::iterator())
                {
                        if (m_ses.m_alerts.should_post<url_seed_alert>())
                                m_ses.m_alerts.post_alert(url_seed_alert(get_handle(), web->url, e)); // error_code e may can be undefined?? cause url_seed_alert() constructor function calls e.message()

                ...

        }

Original comment by mul...@gmail.com on 2 Dec 2011 at 2:10