sa3paleasm / libtorrent

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

Compilation problems with latest sources from trunk and then some runtime problems #737

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
#Checkout latest sources from sf:
svn checkout svn://svn.code.sf.net/p/libtorrent/code/trunk libtorrent-trunk
cd libtorrent-trunk/

#configure and make
./autotool.sh 
 ./configure --enable-python-binding --enable-tests
make

# got this error:
  CXX      resolve_links.lo
resolve_links.cpp:33:29: fatal error: resolve_links.hpp: No such file or 
directory
 #include "resolve_links.hpp"
                             ^
compilation terminated.

# If I inject include dir via environment variable, then can compile:
 export CXXFLAGS=-I../include/libtorrent
 ./configure --enable-python-binding --enable-tests
 make

# but tests fails:
make check
...
test_alert_manager.cpp:243:2: note: in expansion of macro ‘TEST_EQUAL’
  TEST_EQUAL(a, NULL);
  ^
  CCLD     test_alert_manager
/usr/bin/ld: test_alert_manager.o: undefined reference to symbol 
'__cxa_free_exception@@CXXABI_1.3'
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing 
from command line

#this can be fixed by adding followink linker flag:
export LDFLAGS=-lstdc++

# but then some other symbols are missing (from boost):
make check
...
test_alert_manager.cpp:243:2: note: in expansion of macro ‘TEST_EQUAL’
  TEST_EQUAL(a, NULL);
  ^
  CCLD     test_alert_manager
test_alert_manager.o: In function `test_wait_for_alert()':
test_alert_manager.cpp:(.text+0x6f8d): undefined reference to 
`boost::chrono::steady_clock::now()'
test_alert_manager.cpp:(.text+0x6fa5): undefined reference to 
`boost::chrono::steady_clock::now()'
test_alert_manager.cpp:(.text+0x70ab): undefined reference to 
`boost::chrono::steady_clock::now()'
test_alert_manager.cpp:(.text+0x70c3): undefined reference to 
`boost::chrono::steady_clock::now()'
test_alert_manager.cpp:(.text+0x714b): undefined reference to 
`boost::chrono::steady_clock::now()'
test_alert_manager.o:test_alert_manager.cpp:(.text+0x719d): more undefined 
references to `boost::chrono::steady_clock::now()' follow
./.libs/libtest.a(dht_server.o):(.data.rel.ro._ZTIN5boost4asio6detail12service_b
aseINS0_23datagram_socket_serviceINS0_2ip3udpEEEEE[_ZTIN5boost4asio6detail12serv
ice_baseINS0_23datagram_socket_serviceINS0_2ip3udpEEEEE]+0x10): undefined 
reference to `typeinfo for boost::asio::io_service::service'
./.libs/libtest.a(peer_server.o):(.data.rel.ro._ZTIN5boost4asio6detail12service_
baseINS0_23socket_acceptor_serviceINS0_2ip3tcpEEEEE[_ZTIN5boost4asio6detail12ser
vice_baseINS0_23socket_acceptor_serviceINS0_2ip3tcpEEEEE]+0x10): undefined 
reference to `typeinfo for boost::asio::io_service::service'
./.libs/libtest.a(peer_server.o):(.data.rel.ro._ZTIN5boost4asio6detail12service_
baseINS0_21stream_socket_serviceINS0_2ip3tcpEEEEE[_ZTIN5boost4asio6detail12servi
ce_baseINS0_21stream_socket_serviceINS0_2ip3tcpEEEEE]+0x10): undefined 
reference to `typeinfo for boost::asio::io_service::service'
../src/.libs/libtorrent-rasterbar.so: undefined reference to 
`boost::random::random_device::operator()()'
../src/.libs/libtorrent-rasterbar.so: undefined reference to 
`boost::random::random_device::random_device()'
collect2: error: ld returned 1 exit status

# I can reduce errors by providing this additional boost libraries:
export LDFLAGS="-lstdc++ -lboost_chrono -lboost_random"

#but still have problem with export LDFLAGS="-lstdc++ -lboost_system 
-lboost_thread -lboost_chrono -lboost_random"
# not sure which library is missing,   because I read that asio should be in 
boost_system which is already linked

 CCLD     test_alert_manager
./.libs/libtest.a(dht_server.o):(.data.rel.ro._ZTIN5boost4asio6detail12service_b
aseINS0_23datagram_socket_serviceINS0_2ip3udpEEEEE[_ZTIN5boost4asio6detail12serv
ice_baseINS0_23datagram_socket_serviceINS0_2ip3udpEEEEE]+0x10): undefined 
reference to `typeinfo for boost::asio::io_service::service'
./.libs/libtest.a(peer_server.o):(.data.rel.ro._ZTIN5boost4asio6detail12service_
baseINS0_23socket_acceptor_serviceINS0_2ip3tcpEEEEE[_ZTIN5boost4asio6detail12ser
vice_baseINS0_23socket_acceptor_serviceINS0_2ip3tcpEEEEE]+0x10): undefined 
reference to `typeinfo for boost::asio::io_service::service'
./.libs/libtest.a(peer_server.o):(.data.rel.ro._ZTIN5boost4asio6detail12service_
baseINS0_21stream_socket_serviceINS0_2ip3tcpEEEEE[_ZTIN5boost4asio6detail12servi
ce_baseINS0_21stream_socket_serviceINS0_2ip3tcpEEEEE]+0x10): undefined 
reference to `typeinfo for boost::asio::io_service::service'
collect2: error: ld returned 1 exit status

#libtorrent seems to work after this patched compilation
sudo make install
sudo ldconfig
python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libtorrent as lt
>>> lt.version
'1.1.0.0'

#but my python program crashes - output from gdb:

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffeaffd700 (LWP 4646)]
0x00007ffff782dcc9 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff782dcc9 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff78310d8 in __GI_abort () at abort.c:89
#2  0x00007ffff786a394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7978b28 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff787666e in malloc_printerr (ptr=<optimized out>, 
str=0x7ffff7974c31 "free(): invalid size", 
    action=1) at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at 
malloc.c:3840
#5  0x00007ffff63b38f9 in release (this=0x7fffe0000dd0)
    at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:146
#6  ~shared_count (this=0x7ffff2f16ae8, __in_chrg=<optimized out>)
    at /usr/include/boost/smart_ptr/detail/shared_count.hpp:371
#7  ~shared_ptr (this=0x7ffff2f16ae0, __in_chrg=<optimized out>)
    at /usr/include/boost/smart_ptr/shared_ptr.hpp:328
#8  
boost::python::objects::pointer_holder<boost::shared_ptr<libtorrent::alert>, 
libtorrent::alert>::~pointer_holder (this=0x7ffff2f16ad0, __in_chrg=<optimized 
out>)
    at /usr/include/boost/python/object/pointer_holder.hpp:56
#9  0x00007ffff5880907 in ?? () from 
/usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0
#10 0x00000000004d94bb in ?? ()
#11 0x000000000052c798 in PyEval_EvalFrameEx ()
#12 0x000000000052cf32 in PyEval_EvalFrameEx ()
#13 0x000000000052cf32 in PyEval_EvalFrameEx ()
#14 0x000000000056d0aa in ?? ()
#15 0x00000000004d9854 in ?? ()
---Type <return> to continue, or q <return> to quit---
#16 0x00000000004da20b in PyEval_CallObjectWithKeywords ()
#17 0x00000000005872b2 in ?? ()
#18 0x00007ffff7bc4182 in start_thread (arg=0x7fffeaffd700) at 
pthread_create.c:312
#19 0x00007ffff78f147d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:111 

this problem seems to be related to handling of of events in separate python 
thread (especially read_piece_alert) ,
if I do not start this thread problem disapears  

# another problem is with arithmetic error - happens occationally
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7ffff270d700 (LWP 5400)]
0x00007ffff5e07887 in libtorrent::piece_picker::add(int) () from 
/usr/local/lib/libtorrent-rasterbar.so.9
(gdb) bt
#0  0x00007ffff5e07887 in libtorrent::piece_picker::add(int) ()
   from /usr/local/lib/libtorrent-rasterbar.so.9
#1  0x00007ffff5e0878b in libtorrent::piece_picker::set_piece_priority(int, 
int) ()
   from /usr/local/lib/libtorrent-rasterbar.so.9
#2  0x00007ffff5e6351d in libtorrent::torrent::set_piece_deadline(int, int, 
int) ()
   from /usr/local/lib/libtorrent-rasterbar.so.9
#3  0x00007ffff5e89f87 in void 
boost_asio_handler_invoke_helpers::invoke<boost::_bi::bind_t<void, 
boost::_mfi::mf3<void, libtorrent::torrent, int, int, int>, 
boost::_bi::list4<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::_bi::value<int>, boost::_bi::value<int>, boost::_bi::value<int> > >, 
boost::_bi::bind_t<void, boost::_mfi::mf3<void, libtorrent::torrent, int, int, 
int>, 
boost::_bi::list4<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::_bi::value<int>, boost::_bi::value<int>, boost::_bi::value<int> > > 
>(boost::_bi::bind_t<void, boost::_mfi::mf3<void, libtorrent::torrent, int, 
int, int>, 
boost::_bi::list4<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::_bi::value<int>, boost::_bi::value<int>, boost::_bi::value<int> > >&, 
boost::_bi::bind_t<void, boost::_mfi::mf3<void, libtorrent::torrent, int, int, 
int>, 
boost::_bi::list4<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::_bi::value<int>, boost::_bi::value<int>, boost::_bi::value<int> > >&) 
[clone .isra.617] ()
   from /usr/local/lib/libtorrent-rasterbar.so.9
#4  0x00007ffff5e9a00a in 
boost::asio::detail::completion_handler<boost::_bi::bind_t<void, 
boost::_mfi::mf3<void, libtorrent::torrent, int, int, int>, 
boost::_bi::list4<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::_bi::value<int>, boost::_bi::value<int>, boost::_bi::value<int> > > 
>::do_complete(boost::asio::detail::task_io_service*, 
boost::asio::detail::task_io_service_operation*, boost::system::error_code 
const&, unsigned long) () from /usr/local/lib/libtorrent-rasterbar.so.9
#5  0x00007ffff5d71a5b in 
boost::asio::detail::task_io_service::do_run_one(boost::asio::detail::scoped_loc
k<---Type <return> to continue, or q <return> to quit---
boost::asio::detail::posix_mutex>&, 
boost::asio::detail::task_io_service_thread_info&, boost::system::error_code 
const&) () from /usr/local/lib/libtorrent-rasterbar.so.9
#6  0x00007ffff5d72843 in 
boost::asio::detail::task_io_service::run(boost::system::error_code&) ()
   from /usr/local/lib/libtorrent-rasterbar.so.9
#7  0x00007ffff5e35e29 in libtorrent::aux::session_impl::main_thread() ()
   from /usr/local/lib/libtorrent-rasterbar.so.9
#8  0x00007ffff5d6b1e2 in boost_asio_detail_posix_thread_function ()
   from /usr/local/lib/libtorrent-rasterbar.so.9
#9  0x00007ffff7bc4182 in start_thread (arg=0x7ffff270d700) at 
pthread_create.c:312
#10 0x00007ffff78f147d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

#and when debug is enabled this error:

Program received signal SIGINT, Interrupt.
[Switching to Thread 0x7ffff2167700 (LWP 19093)]
0x00007ffff7bcc20b in raise (sig=2) at 
../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
37  ../nptl/sysdeps/unix/sysv/linux/pt-raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff7bcc20b in raise (sig=2) at 
../nptl/sysdeps/unix/sysv/linux/pt-raise.c:37
#1  0x00007ffff590f024 in assert_fail (expr=0x7ffff5d925e0 "st->is_finished", 
line=11457, 
    file=0x7ffff5d904f0 "torrent.cpp", 
    function=0x7ffff5d98180 <libtorrent::torrent::status(libtorrent::torrent_status*, unsigned int)::__PRETTY_FUNCTION__> "void libtorrent::torrent::status(libtorrent::torrent_status*, uint32_t)", value=0x0, kind=0)
    at assert.cpp:291
#2  0x00007ffff5c034b9 in libtorrent::torrent::status (this=0x7fffec00a4e0, 
st=0x7fffeb5f14a0, 
    flags=4294967295) at torrent.cpp:11457
#3  0x00007ffff5c709f1 in boost::_mfi::mf2<void, libtorrent::torrent, 
libtorrent::torrent_status*, unsigned 
int>::call<boost::shared_ptr<libtorrent::torrent>, libtorrent::torrent_status*, 
unsigned int> (
    this=0x7fffec01e6c0, u=..., b1=@0x7ffff21667d8: 0x7fffeb5f14a0, b2=@0x7ffff21667d4: 4294967295)
    at /usr/include/boost/bind/mem_fn_template.hpp:271
#4  0x00007ffff5c6ee7a in boost::_mfi::mf2<void, libtorrent::torrent, 
libtorrent::torrent_status*, unsigned 
int>::operator()<boost::shared_ptr<libtorrent::torrent> > (this=0x7fffec01e6c0, 
u=..., a1=0x7fffeb5f14a0, 
    a2=4294967295) at /usr/include/boost/bind/mem_fn_template.hpp:286
#5  0x00007ffff5c6ba02 in 
boost::_bi::list3<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::_bi::value<libtorrent::torrent_status*>, boost::_bi::value<unsigned int> 
>::operator()<boost::_mfi::mf2<void, libtorrent::torrent, 
libtorrent::torrent_status*, unsigned int>, boost::_bi::list0> (
    this=0x7fffec01e6d0, f=..., a=...) at /usr/include/boost/bind/bind.hpp:392
#6  0x00007ffff5c68185 in boost::_bi::bind_t<void, boost::_mfi::mf2<void, 
libtorrent::torrent, libtorrent::torrent_status*, unsigned int>, 
boost::_bi::list3<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::_bi::value<libtorrent::torrent_status*>, boost::_bi::value<unsigned int> 
> >::operator() (
    this=0x7fffec01e6c0) at /usr/include/boost/bind/bind_template.hpp:20
---Type <return> to continue, or q <return> to quit---
#7  0x00007ffff5c63c77 in 
boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, 
boost::_mfi::mf2<void, libtorrent::torrent, libtorrent::torrent_status*, 
unsigned int>, 
boost::_bi::list3<boost::_bi::value<boost::shared_ptr<libtorrent::torrent> >, 
boost::_bi::value<libtorrent::torrent_status*>, boost::_bi::value<unsigned int> 
> >, void>::invoke (function_obj_ptr=...)
    at /usr/include/boost/function/function_template.hpp:153
#8  0x00007ffff58f4334 in boost::function0<void>::operator() 
(this=0x7ffff2166980)
    at /usr/include/boost/function/function_template.hpp:767
#9  0x00007ffff5b35d23 in libtorrent::aux::fun_wrap(bool&, 
libtorrent::condition_variable&, boost::asio::detail::posix_mutex&, 
boost::function<void ()>) (done=@0x7fffeb5f1357: false, e=..., m=..., f=...)
    at session_call.cpp:76
#10 0x00007ffff5afcdaa in boost::_bi::list4<boost::reference_wrapper<bool>, 
boost::reference_wrapper<libtorrent::condition_variable>, 
boost::reference_wrapper<boost::asio::detail::posix_mutex>, 
boost::_bi::value<boost::function<void ()> > >::operator()<void (*)(bool&, 
libtorrent::condition_variable&, boost::asio::detail::posix_mutex&, 
boost::function<void ()>), boost::_bi::list0>(boost::_bi::type<void>, void 
(*&)(bool&, libtorrent::condition_variable&, boost::asio::detail::posix_mutex&, 
boost::function<void ()>), boost::_bi::list0&, int) (this=0x7ffff2166af8, 
    f=@0x7ffff2166af0: 0x7ffff5b35cfe <libtorrent::aux::fun_wrap(bool&, libtorrent::condition_variable&, boost::asio::detail::posix_mutex&, boost::function<void ()>)>, a=...) at /usr/include/boost/bind/bind.hpp:457
#11 0x00007ffff5afc483 in boost::_bi::bind_t<void, void (*)(bool&, 
libtorrent::condition_variable&, boost::asio::detail::posix_mutex&, 
boost::function<void ()>), boost::_bi::list4<boost::reference_wrapper<bool>, 
boost::reference_wrapper<libtorrent::condition_variable>, 
boost::reference_wrapper<boost::asio::detail::posix_mutex>, 
boost::_bi::value<boost::function<void ()> > > >::operator()() 
(this=0x7ffff2166af0)
    at /usr/include/boost/bind/bind_template.hpp:20
---Type <return> to continue, or q <return> to quit---
#12 0x00007ffff5afb61b in 
boost::asio::asio_handler_invoke<boost::_bi::bind_t<void, void (*)(bool&, 
libtorrent::condition_variable&, boost::asio::detail::posix_mutex&, 
boost::function<void ()>), boost::_bi::list4<boost::reference_wrapper<bool>, 
boost::reference_wrapper<libtorrent::condition_variable>, 
boost::reference_wrapper<boost::asio::detail::posix_mutex>, 
boost::_bi::value<boost::function<void ()> > > > >(boost::_bi::bind_t<void, 
void (*)(bool&, libtorrent::condition_variable&, 
boost::asio::detail::posix_mutex&, boost::function<void ()>), 
boost::_bi::list4<boost::reference_wrapper<bool>, 
boost::reference_wrapper<libtorrent::condition_variable>, 
boost::reference_wrapper<boost::asio::detail::posix_mutex>, 
boost::_bi::value<boost::function<void ()> > > >, ...) (function=...) at 
/usr/include/boost/asio/handler_invoke_hook.hpp:64
#13 0x00007ffff5afa373 in 
boost_asio_handler_invoke_helpers::invoke<boost::_bi::bind_t<void, void 
(*)(bool&, libtorrent::condition_variable&, boost::asio::detail::posix_mutex&, 
boost::function<void ()>), boost::_bi::list4<boost::reference_wrapper<bool>, 
boost::reference_wrapper<libtorrent::condition_variable>, 
boost::reference_wrapper<boost::asio::detail::posix_mutex>, 
boost::_bi::value<boost::function<void ()> > > >, boost::_bi::bind_t<void, void 
(*)(bool&, libtorrent::condition_variable&, boost::asio::detail::posix_mutex&, 
boost::function<void ()>), boost::_bi::list4<boost::reference_wrapper<bool>, 
boost::reference_wrapper<libtorrent::condition_variable>, 
boost::reference_wrapper<boost::asio::detail::posix_mutex>, 
boost::_bi::value<boost::function<void ()> > > > >(boost::_bi::bind_t<void, 
void (*)(bool&, libtorrent::condition_variable&, 
boost::asio::detail::posix_mutex&, boost::function<void ()>), 
boost::_bi::list4<boost::reference_wrapper<bool>, 
boost::reference_wrapper<libtorrent::condition_variable>, 
boost::reference_wrapper<boost::asio::detail::posix_mutex>, 
boost::_bi::value<boost::function<void ()> > > >&, boost::_bi::bind_t<void, 
void (*)(bool&, libtorrent::condition_variable&, 
boost::asio::detail::posix_mutex&, boost::function<void ()>), 
boost::_bi::list4<boost::reference_wrapper<bool>, 
boost::reference_wrapper<libtorrent::condition_variable>, 
boost::reference_wrapper<boost::asio::detail::posix_mutex>, 
boost::_bi::value<boost::function<void ()> > > >&) (function=..., 
    context=...) at /usr/include/boost/asio/detail/handler_invoke_helpers.hpp:37
---Type <return> to continue, or q <return> to quit---
#14 0x00007ffff5afb7cc in 
boost::asio::detail::completion_handler<boost::_bi::bind_t<void, void 
(*)(bool&, libtorrent::condition_variable&, boost::asio::detail::posix_mutex&, 
boost::function<void ()>), boost::_bi::list4<boost::reference_wrapper<bool>, 
boost::reference_wrapper<libtorrent::condition_variable>, 
boost::reference_wrapper<boost::asio::detail::posix_mutex>, 
boost::_bi::value<boost::function<void ()> > > > 
>::do_complete(boost::asio::detail::task_io_service*, 
boost::asio::detail::task_io_service_operation*, boost::system::error_code 
const&, unsigned long) (owner=0xd765f0, base=0x7fffdc00bf00)
    at /usr/include/boost/asio/detail/completion_handler.hpp:68
#15 0x00007ffff59065b0 in 
boost::asio::detail::task_io_service_operation::complete (this=0x7fffdc00bf00, 
    owner=..., ec=..., bytes_transferred=0)
    at /usr/include/boost/asio/detail/task_io_service_operation.hpp:37
#16 0x00007ffff5902341 in boost::asio::detail::task_io_service::do_run_one 
(this=0xd765f0, lock=..., 
    this_thread=..., ec=...) at /usr/include/boost/asio/detail/impl/task_io_service.ipp:384
#17 0x00007ffff5901775 in boost::asio::detail::task_io_service::run 
(this=0xd765f0, ec=...)
    at /usr/include/boost/asio/detail/impl/task_io_service.ipp:153
#18 0x00007ffff58f666d in boost::asio::io_service::run (this=0xe72d20, ec=...)
    at /usr/include/boost/asio/impl/io_service.ipp:66
#19 0x00007ffff5b48b80 in libtorrent::aux::session_impl::main_thread 
(this=0xe71f10)
    at session_impl.cpp:4029
#20 0x00007ffff5b31035 in boost::_mfi::mf0<void, 
libtorrent::aux::session_impl>::operator() (
    this=0xc6cfe8, p=0xe71f10) at /usr/include/boost/bind/mem_fn_template.hpp:49
#21 0x00007ffff5b2cd62 in 
boost::_bi::list1<boost::_bi::value<libtorrent::aux::session_impl*> 
>::operator()<boost::_mfi::mf0<void, libtorrent::aux::session_impl>, 
boost::_bi::list0> (this=0xc6cff8, f=..., a=...)
    at /usr/include/boost/bind/bind.hpp:253
---Type <return> to continue, or q <return> to quit---
#22 0x00007ffff5b275eb in boost::_bi::bind_t<void, boost::_mfi::mf0<void, 
libtorrent::aux::session_impl>, 
boost::_bi::list1<boost::_bi::value<libtorrent::aux::session_impl*> > 
>::operator() (this=0xc6cfe8)
    at /usr/include/boost/bind/bind_template.hpp:20
#23 0x00007ffff5b95e96 in 
boost::asio::detail::posix_thread::func<boost::_bi::bind_t<void, 
boost::_mfi::mf0<void, libtorrent::aux::session_impl>, 
boost::_bi::list1<boost::_bi::value<libtorrent::aux::session_impl*> > > >::run 
(this=0xc6cfe0) at /usr/include/boost/asio/detail/posix_thread.hpp:82
#24 0x00007ffff58fa89a in 
boost::asio::detail::boost_asio_detail_posix_thread_function (arg=0xc6cfe0)
    at /usr/include/boost/asio/detail/impl/posix_thread.ipp:64
#25 0x00007ffff7bc4182 in start_thread (arg=0x7ffff2167700) at 
pthread_create.c:312
#26 0x00007ffff78f147d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

# and here is debug backtrace for that problem with alerts and memory release:

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffea7cd700 (LWP 19283)]
0x00007ffff782dcc9 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff782dcc9 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff78310d8 in __GI_abort () at abort.c:89
#2  0x00007ffff786a394 in __libc_message (do_abort=do_abort@entry=1, 
    fmt=fmt@entry=0x7ffff7978b28 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff787666e in malloc_printerr (ptr=<optimized out>, 
str=0x7ffff7974c31 "free(): invalid size", 
    action=1) at malloc.c:4996
#4  _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at 
malloc.c:3840
#5  0x00007ffff58d98ca in libtorrent::alert::~alert (this=0x7fffec048390, 
__in_chrg=<optimized out>)
    at alert.cpp:55
#6  0x00007ffff63b1e79 in release (this=0x7fffe0000dd0)
    at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:146
#7  ~shared_count (this=0x7ffff2970ae8, __in_chrg=<optimized out>)
    at /usr/include/boost/smart_ptr/detail/shared_count.hpp:371
#8  ~shared_ptr (this=0x7ffff2970ae0, __in_chrg=<optimized out>)
    at /usr/include/boost/smart_ptr/shared_ptr.hpp:328
#9  
boost::python::objects::pointer_holder<boost::shared_ptr<libtorrent::alert>, 
libtorrent::alert>::~pointer_holder (this=0x7ffff2970ad0, __in_chrg=<optimized 
out>)
    at /usr/include/boost/python/object/pointer_holder.hpp:56
#10 0x00007ffff52da907 in ?? () from 
/usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0
#11 0x00000000004d94bb in ?? ()
#12 0x000000000052c798 in PyEval_EvalFrameEx ()
#13 0x000000000052cf32 in PyEval_EvalFrameEx ()
#14 0x000000000052cf32 in PyEval_EvalFrameEx ()
---Type <return> to continue, or q <return> to quit---
#15 0x000000000056d0aa in ?? ()
#16 0x00000000004d9854 in ?? ()
#17 0x00000000004da20b in PyEval_CallObjectWithKeywords ()
#18 0x00000000005872b2 in ?? ()
#19 0x00007ffff7bc4182 in start_thread (arg=0x7fffea7cd700) at 
pthread_create.c:312
#20 0x00007ffff78f147d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

What is the expected output? What do you see instead?
compiles and runs tests 
there has not been any compilation problems with 1.0.4 version (downloaded from 
release file)

no runtime errors
python program works with version 0.16

What version of the product are you using? On what operating system?
libtorrent: 1.1.0 - sources from trunk (checked out today)
OS: Ubuntu 14.04.2,  64bit

Please provide any additional information below.

Original issue reported on code.google.com by ivan.zde...@gmail.com on 17 Apr 2015 at 8:18

GoogleCodeExporter commented 8 years ago
the include is fixed in trunk now. as for the link errors, that looks like it 
may be issues in the boost libraries themselves, not supporting building as 
shared libraries under gcc/clang. You may want to build and link statically 
against boost.

The free error in the python binding looks like it may be an ABI issue. make 
sure your python binding .so file is linking against the correct version of the 
main libtorrent library. This may also be a good candidate for linking 
statically, to avoid this risk.

the assert could be a separate issue, but if there is a version (and ABI) 
mismatch between the python bindings and the main library, it could be that too.

Original comment by arvid.no...@gmail.com on 18 Apr 2015 at 2:07

GoogleCodeExporter commented 8 years ago
a) for boost libraries - I'm using shared libraries from Ubuntu repos

b) I've have been compiling library together with python bindings (configure 
--enable-python-binding),  so I think both should be in sync.  1.0.4 version -  
checked with ldd:
ldd /usr/local/lib/python2.7/dist-packages/libtorrent.so 
    linux-vdso.so.1 =>  (0x00007ffc53789000)
    libtorrent-rasterbar.so.9 => /usr/local/lib/libtorrent-rasterbar.so.9 (0x00007f6cffe2f000)
    libboost_system.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0 (0x00007f6cffc2b000)
    libboost_python-py27.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.54.0 (0x00007f6cff9dd000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6cff6d9000)
    libboost_chrono.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.54.0 (0x00007f6cff4d2000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6cff2bb000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6cfeef6000)
    libboost_random.so.1.54.0 => /usr/lib/x86_64-linux-gnu/libboost_random.so.1.54.0 (0x00007f6cfecf3000)
    libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f6cfea94000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f6cfe6b9000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6cfe49b000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6cfe194000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f6d00da1000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f6cfdf8c000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6cfdd87000)

Original comment by ivan.zde...@gmail.com on 20 Apr 2015 at 8:28