w00t-labs / libtorrent

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

deluge crashes with throwing an instance of 'std::bad_cast' #649

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hey Arvid, I am forwarding this issue from Launchpad bug tracker: 
https://bugs.launchpad.net/ubuntu/+source/deluge/+bug/1074789

The user is likely using 0.16.7.

------

I ran into this issue, too, also with SOCKS proxies with deluged-1.3.6-0ubuntu2 
on Ubuntu 13.04. The settings for all four proxies in 
~/.config/deluge/core.conf that cause deluged to die with the abort due to 
std::bad_cast are:

      "username": "",
      "password": "",
      "type": 1,
      "port": 3180,
      "hostname": "10.1.2.3"

 I was able to work around the issue. I changed the configuration for all four proxies to something like the following, which don't seem to lead the same crashes:

      "username": "none",
      "password": "none",
      "type": 2,
      "port": 3180,
      "hostname": "10.1.2.3"

And I was able to capture a backtrace from GDB:

#0 0x00007fbb78bba037 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007fbb78bbd698 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007fbb762a8e8d in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007fbb762a6f76 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007fbb762a6fa3 in std::terminate() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007fbb762a71de in __cxa_throw ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007fbb76a584b3 in ?? () from /usr/lib/libtorrent-rasterbar.so.7
#7 0x00007fbb76a6e398 in boost::asio::ip::address::to_v4() const ()
   from /usr/lib/libtorrent-rasterbar.so.7
#8 0x00007fbb76b97846 in 
libtorrent::socks5_stream::socks_connect(boost::shared_ptr<boost::function<void 
(boost::system::error_code const&)> >) ()
   from /usr/lib/libtorrent-rasterbar.so.7
#9 0x00007fbb76b9a343 in 
libtorrent::socks5_stream::connected(boost::system::error_code const&, 
boost::shared_ptr<boost::function<void (boost::system::error_code const&)> >) 
() from /usr/lib/libtorrent-rasterbar.so.7
#10 0x00007fbb76b9e2da in ?? () from /usr/lib/libtorrent-rasterbar.so.7
#11 0x00007fbb76a71f06 in 
boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_loc
k<boost::asio::detail::posix_mutex>&, 
boost::asio::detail::task_io_service::thread_info&, 
boost::asio::detail::op_queue<boost::asio::detail::task_io_service_operation>&, 
boost::system::error_code const&) ()
   from /usr/lib/libtorrent-rasterbar.so.7
#12 0x00007fbb76a74b0e in 
boost::asio::detail::task_io_service::run(boost::system::error_code&) () from 
/usr/lib/libtorrent-rasterbar.so.7
#13 0x00007fbb76b76264 in libtorrent::aux::session_impl::main_thread() ()
   from /usr/lib/libtorrent-rasterbar.so.7
#14 0x00007fbb76a687f7 in boost_asio_detail_posix_thread_function ()
   from /usr/lib/libtorrent-rasterbar.so.7
#15 0x00007fbb79875f8e in start_thread ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
#16 0x00007fbb78c7ce1d in clone () from /lib/x86_64-linux-gnu/libc.so.6

Original issue reported on code.google.com by caluml...@gmail.com on 20 Jul 2014 at 11:28

GoogleCodeExporter commented 9 years ago
I seem to recall this as being a boost.asio bug. I'll try to dig up more info.

Original comment by arvid.no...@gmail.com on 20 Jul 2014 at 4:34

GoogleCodeExporter commented 9 years ago
the asio ticket I had in mind was this:

https://svn.boost.org/trac/boost/ticket/5198

which is a bit different. This could be caused by the address simply not being 
an IPv4 address. I'll take a look

Original comment by arvid.no...@gmail.com on 20 Jul 2014 at 5:49

GoogleCodeExporter commented 9 years ago
yes. This issue seems to be caused by attempting to connect to an IPv6 address 
while using a SOCKS4 proxy (which doesn't support IPv6) and I failed to check 
for this condition, which caused asio to object when trying to interpret the 
address as IPv4.

Original comment by arvid.no...@gmail.com on 20 Jul 2014 at 5:57

GoogleCodeExporter commented 9 years ago
Glad didn't send you on a wild goose-chase :)

Original comment by caluml...@gmail.com on 20 Jul 2014 at 6:44

GoogleCodeExporter commented 9 years ago
fixed in RC_0_16 and all later branches.

Original comment by arvid.no...@gmail.com on 20 Jul 2014 at 6:51