rakshasa / libtorrent Goto Github PK
View Code? Open in Web Editor NEWlibTorrent BitTorrent library
Home Page: http://rtorrent.net/downloads/
License: GNU General Public License v2.0
libTorrent BitTorrent library
Home Page: http://rtorrent.net/downloads/
License: GNU General Public License v2.0
Hello,
the TrackerManager::close method is still used in several places in src/tracker/tracker_manager.cc
and is declared in src/tracker/tracker_manager.h
but was removed by commit 8e9f692.
If one compile libtorrent after that commit, instal it and try to compile rtorrent he will get error from linker: 'the method is not found' (not accurate wording).
rtorrent is reporting status to tracker in time < than min_interval and i'm gettin errors from tracker
Hi.. Im using the same script, as all ways, that downloads and installs libtorrent + rtorrent, directly from your Github repo. But suddenly I am not able to install libtorrent. It gives me an error, in the "make" command.
The packages that the script installs before compiling is "git build-essential libsigc++-2.0-dev libcurl4-openssl-dev automake libtool libcppunit-dev libncurses5-dev g++".
The error, in the make command you can see here. http://paste.ubuntu.com/6697959/
Running Debian 7 64bit
Let me know if you need more details.
Despite Rakshasa’s blatant denial, there still exists an issue with running make check
. Namely:
make[2]: Leaving directory `/home/ryan/code/torrent/libtorrent/test'
make check-TESTS
make[2]: Entering directory `/home/ryan/code/torrent/libtorrent/test'
.....F...................................................F.
1 0
.............................
extents_test.cc:55:Assertion
Test name: ExtentsTest::test_basic
assertion failed
- Expression: verify_extent_data(extent_1, idx_empty, val_empty)
tracker_controller_test.cc:590:Assertion
Test name: tracker_controller_test::test_requesting_basic
assertion failed
- Expression: "10000"[1] == '1' || !tracker_0_1->is_busy()
Failures !!!
Run: 86 Failure total: 2 Failures: 2 Errors: 0
FAIL: LibTorrentTest
=================================
1 of 1 tests failed
Please report to [email protected]
=================================
make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `/home/ryan/code/torrent/libtorrent/test'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/home/ryan/code/torrent/libtorrent/test'
make: *** [check-recursive] Error 1
Maybe Rakshasa will bother to actually read this time, but since he can’t spell maybe he can’t read, either.
Hi!
Since you seem to have migrated to github a while ago, can you please update http://libtorrent.rakshasa.no/wiki/Install? It's still documented to checkout from svn, which is confusing. Thanks!
Best regards,
Christian
Libtorrent allows an arbitrary number of leading zeros on bytestrings in Bencode decoding; I can see some potential for buffer overflow here. I.e., via a malicious tracker, peer, or Metainfo file.
Bytestrings should not have leading zeros ever because you'll never have a 0 length bytestring (although the Bittorrent 'spec' allows you to express something like i0e which is meaningless.
To recap:
d0000000000000000000000000000000000000000000000000000000000000000000000005:hello000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005:helloe
shouldn't be accepted. Modify a .torrent file and you'll see this works...
"netcat IP PORT < /dev/zero" can be used to remotely segfault rtorrent clients with encryption allow_incoming set. Only tested it on libtorrent 0.13.3 and 0.13.2.
I haven't fully debugged the crash but it looks like rtorrent assumes a connection is encrypted when it doesn't get the bittorrent header.
DiffieHellman::compute_secret(const unsigned char *pubkey, unsigned int length) will be called with pubkey set to only \0 and the call to DH_compute_key will fail with error code -1.
m_size = DH_compute_key((unsigned char*)m_secret, k, m_dh);
This is never checked and unsigned int m_size will be assigned 2^32-1. This value is later used in a call to sha1_salt causing the segfault in openssl.
Backtrace of the segfault:
#0 sha1_block_data_order_avx () at sha1-x86_64.s:3394
#1 0xca62c1d6ca62c1d6 in ?? ()
#2 0xca62c1d6ca62c1d6 in ?? ()
#3 0xca62c1d6ca62c1d6 in ?? ()
#4 0xca62c1d6ca62c1d6 in ?? ()
#5 0xca62c1d6ca62c1d6 in ?? ()
#6 0xca62c1d6ca62c1d6 in ?? ()
#7 0xca62c1d6ca62c1d6 in ?? ()
#8 0xca62c1d6ca62c1d6 in ?? ()
#9 0x00000000523c0ddc in ?? ()
#10 0x00000000ffffffc3 in ?? ()
#11 0x00007fffffffd5a0 in ?? ()
#12 0x00007ffff57ee6ff in SHA1_Update (c=0x743c28ba, data_=, len=2750819798)
at ../md32_common.h:325
#13 0x00007ffff74c8dc9 in update (length=4294967295, data=0x523c0da0, this=0x7fffffffd5a0)
at ./../utils/sha1.h:95
#14 sha1_salt (out=0x51fedc38, keyLength=4294967295, key=0x523c0da0 "\330v\235\366\377\177",
saltLength=4, salt=0x7ffff74ebd16 "req1") at ./../utils/sha1.h:115
#15 torrent::HandshakeEncryption::hash_req1_to_sync (this=0x51fed410) at handshake_encryption.cc:125
#16 0x00007ffff74c6377 in torrent::Handshake::read_encryption_key (this=this@entry=0x51fed370)
at handshake.cc:288
#17 0x00007ffff74c7927 in torrent::Handshake::event_read (this=0x51fed370) at handshake.cc:683
#18 0x00007ffff7451b2c in torrent::PollEPoll::perform (this=this@entry=0x76ec40) at poll_epoll.cc:180
#19 0x00007ffff7451d29 in torrent::PollEPoll::do_poll (this=0x76ec40, timeout_usec=,
flags=<optimized out>) at poll_epoll.cc:210
#20 0x00007ffff7486d82 in torrent::thread_base::event_loop (thread=0x76bfb0) at thread_base.cc:145
#21 0x0000000000415de1 in main (argc=2, argv=0x7fffffffdb48) at main.cc:851
% clang++ -v
Apple clang version 3.1 (tags/Apple/clang-318.0.45) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
libtool: compile: /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I../.. -I. -I./.. -I../.. -Os -w -pipe -march=native -Qunused-arguments -DNDEBUG -fvisibility=hidden -I/usr/local/Cellar/libsigc++/2.2.10/include/sigc++-2.0 -I/usr/local/Cellar/libsigc++/2.2.10/lib/sigc++-2.0/include -c rate.cc -fno-common -DPIC -o .libs/rate.o
poll_select.cc:126:28: error: cannot allocate function type 'rak::cacheline_allocator<> ()' with new
block_type* block = new (rak::cacheline_allocator<>()) block_type;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[4]: *** [poll_select.lo] Error 1
no error with llvm
% llvm-gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.9~22/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
is there a reason why the configure script is adding all three -pthread -mthreads -mt to the cflags?
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... yes
checking for the pthreads library -lpthread... yes
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... yes
checking for the pthreads library -lpthreadGC2... no
yet i get this:
clang: warning: argument unused during compilation: '-mthreads'
clang: warning: argument unused during compilation: '-mt'
I've got an exception on tab completion when there is more than one result. With one possible result it works ok. Expected to list all relevant filenames in folder. Using FreeBSD 8.4 32 bit.
For example I have the following torrents in my folder:
ubuntu-13.04-desktop-amd64.iso.torrent
ubuntu-13.10-beta2-desktop-amd64.iso.torrent
ubuntu-13.10-beta2-desktop-i386.iso.torrent
On load torrent prompt:
ubuntu[TAB] -> exception
ubuntu-13.04[TAB] -> works ok, expand filename, load torrent
ubuntu-13.10-beta2-desktop-amd64.iso.torrent -> works ok, load torrent
u* -> works ok, expand filename, load torrent
SHA: c053d5b
Backtrace:
(gdb) bt
#0 0x28a424eb in thr_kill () from /lib/libc.so.7
#1 0x284f3a86 in pthread_kill () from /lib/libthr.so.3
#2 0x284f1383 in raise () from /lib/libthr.so.3
#3 0x28ae583a in abort () from /lib/libc.so.7
#4 0x08054c02 in do_panic (signum=0xb) at main.cc:994
#5 0x0805829c in std::tr1::_Bind<void (*()(int))(int)>::operator() (this=0x28c5d068) at bind_iterate.h:45
#6 0x08057f6f in std::tr1::_Function_handler<void ()(), std::tr1::_Bind<void (*()(int))(int)> >::_M_invoke (__functor=@0x8479f38)
at functional_iterate.h:502
#7 0x0805ad36 in std::tr1::function<void ()()>::operator() (this=0x8479f38) at functional_iterate.h:865
#8 0x080cf798 in SignalHandler::caught (signum=0xb) at signal_handler.cc:104
#9 <signal handler called>
#10 0x08131405 in display::WindowStringList::set_range (this=0x0, first={_M_node = 0x295feb30}, last={_M_node = 0x28eec5f4})
at window_string_list.h:56
#11 0x08131301 in ui::ElementStringList::set_range_dirent<__gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > > > (this=0x28eec5b8, first={_M_current = 0x28c2804c}, last=
{_M_current = 0x0}) at element_string_list.h:84
#12 0x08130f0f in std::tr1::_Mem_fn<void (ui::ElementStringList::*)(__gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >, __gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >)>::operator() (this=0x28eec5b0, __object=@0x28eec5b8, __a1=
{_M_current = 0x28eec5b8}, __a2={_M_current = 0x8131200}) at functional_iterate.h:208
#13 0x08130e4c in std::tr1::_Bind<std::tr1::_Mem_fn<void (ui::ElementStringList::*)(__gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >, __gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >)> ()(ui::ElementStringList, std::tr1::_Placeholder<1>, std::tr1::_Placeholder<2>)>::operator()<__gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >, __gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > > > (this=0x28eec5b0, __u1=@0xbfbfde44, __u2=@0xbfbfde48) at bind_iterate.h:45
#14 0x08130959 in std::tr1::_Function_handler<void ()(__gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >, __gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >), std::tr1::_Bind<std::tr1::_Mem_fn<void (ui::ElementStringList::*)(__gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >, __gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >)> ()(ui::ElementStringList, std::tr1::_Placeholder<1>, std::tr1::_Placeholder<2>)> >::_M_invoke (__functor=@0x2904b788, __a1=
{_M_current = 0xbfbfde20}, __a2={_M_current = 0xbfbfde20}) at functional_iterate.h:502
#15 0x081c258e in std::tr1::function<void ()(__gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >, __gnu_cxx::__normal_iterator<utils::directory_entry*, std::vector<utils::directory_entry, std::allocator<utils::directory_entry> > >)>::operator() (this=0x2904b788, __a1={_M_current = 0xbfbfde84}, __a2=
{_M_current = 0x805ad36}) at functional_iterate.h:865
#16 0x081c1a43 in input::PathInput::receive_do_complete (this=0x28eec600) at path_input.cc:127
#17 0x081c1337 in input::PathInput::pressed (this=0x28eec600, key=0x9) at path_input.cc:74
#18 0x081c018b in input::Manager::pressed (this=0x28c29040, key=0x9) at manager.cc:65
#19 0x080c38ae in std::tr1::_Mem_fn<void (input::Manager::*)(int)>::operator() (this=0x28c86100, __object=0x28c29040, __a1=0x9)
at functional_iterate.h:214
#20 0x080c3833 in std::tr1::_Bind<std::tr1::_Mem_fn<void (input::Manager::*)(int)> ()(input::Manager*, std::tr1::_Placeholder<1>)>::operator()<int> (this=0x28c86100, __u1=@0xbfbfe138) at bind_iterate.h:45
#21 0x080c348c in std::tr1::_Function_handler<void ()(int), std::tr1::_Bind<std::tr1::_Mem_fn<void (input::Manager::*)(int)> ()(input::Manager*, std::tr1::_Placeholder<1>)> >::_M_invoke (__functor=@0x28c43068, __a1=0x9) at functional_iterate.h:502
#22 0x081bfea3 in std::tr1::function<void ()(int)>::operator() (this=0x28c43068, __a1=0x9) at functional_iterate.h:865
#23 0x081bfdc4 in input::InputEvent::event_read (this=0x28c43060) at input_event.cc:63
#24 0x08200fb4 in torrent::PollKQueue::perform (this=0x28c271c0) at poll_kqueue.cc:244
#25 0x082012f5 in torrent::PollKQueue::do_poll (this=0x28c271c0, timeout_usec=0x1a536, flags=0x0) at poll_kqueue.cc:277
#26 0x0826ccd9 in torrent::thread_base::event_loop (thread=0x28c88580) at thread_base.cc:174
#27 0x08054728 in main (argc=0x1, argv=0xbfbfe728) at main.cc:857
I am using a build compiled from this commit and linked to this version of the library.
I have this line in my configuration
I get this error after hash checking
* Eclipse Phase - RPG
* [CLOSED] done 40.3 MB Rate: 0.0 / 0.0 KB Uploaded: 2.7 MB [ R: 0.07]
* Inactive: Cannot change the directory of an open download after the files have been moved.
The file does get moved but the torrent becomes stopped.
I'd like to try correcting this error myself but am having difficulty following the code.
Do you have any suggestions on where to look?
libtorrent builds fine, but the tests don't build.
Log:
Making check in src
make[1]: Entering directory '/home/ingmar/Repositories/libtorrent/src'
Making check in torrent
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/src/torrent'
Making check in data
make[3]: Entering directory '/home/ingmar/Repositories/libtorrent/src/torrent/data'
make[3]: Nothing to be done for 'check'.
make[3]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/torrent/data'
Making check in download
make[3]: Entering directory '/home/ingmar/Repositories/libtorrent/src/torrent/download'
make[3]: Nothing to be done for 'check'.
make[3]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/torrent/download'
Making check in peer
make[3]: Entering directory '/home/ingmar/Repositories/libtorrent/src/torrent/peer'
make[3]: Nothing to be done for 'check'.
make[3]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/torrent/peer'
Making check in utils
make[3]: Entering directory '/home/ingmar/Repositories/libtorrent/src/torrent/utils'
make[3]: Nothing to be done for 'check'.
make[3]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/torrent/utils'
make[3]: Entering directory '/home/ingmar/Repositories/libtorrent/src/torrent'
make[3]: Nothing to be done for 'check-am'.
make[3]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/torrent'
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/torrent'
Making check in data
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/src/data'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/data'
Making check in dht
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/src/dht'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/dht'
Making check in download
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/src/download'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/download'
Making check in net
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/src/net'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/net'
Making check in protocol
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/src/protocol'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/protocol'
Making check in tracker
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/src/tracker'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/tracker'
Making check in utils
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/src/utils'
make[2]: Nothing to be done for 'check'.
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/src/utils'
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/src'
make[2]: Nothing to be done for 'check-am'.
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/src'
make[1]: Leaving directory '/home/ingmar/Repositories/libtorrent/src'
Making check in test
make[1]: Entering directory '/home/ingmar/Repositories/libtorrent/test'
make LibTorrentTest
make[2]: Entering directory '/home/ingmar/Repositories/libtorrent/test'
/bin/sh ../libtool --tag=CXX --mode=link x86_64-pc-linux-gnu-g++ -g -O2 -DNDEBUG -fvisibility=hidden -pthread -L/usr/lib64 -lcppunit -ldl -ldl -o LibTorrentTest ../src/LibTorrentTest-thread_disk.o rak/LibTorrentTest-allocators_test.o rak/LibTorrentTest-ranges_test.o data/LibTorrentTest-chunk_list_test.o data/LibTorrentTest-hash_check_queue_test.o data/LibTorrentTest-hash_queue_test.o protocol/LibTorrentTest-test_request_list.o torrent/LibTorrentTest-http_test.o torrent/LibTorrentTest-object_test.o torrent/LibTorrentTest-object_test_utils.o torrent/LibTorrentTest-object_static_map_test.o torrent/LibTorrentTest-object_stream_test.o torrent/LibTorrentTest-tracker_controller_test.o torrent/LibTorrentTest-tracker_controller_features.o torrent/LibTorrentTest-tracker_controller_requesting.o torrent/LibTorrentTest-tracker_list_test.o torrent/LibTorrentTest-tracker_list_features_test.o torrent/LibTorrentTest-tracker_timeout_test.o torrent/utils/LibTorrentTest-log_test.o torrent/utils/LibTorrentTest-log_buffer_test.o torrent/utils/LibTorrentTest-net_test.o torrent/utils/LibTorrentTest-option_strings_test.o torrent/utils/LibTorrentTest-test_extents.o torrent/utils/LibTorrentTest-test_queue_buckets.o torrent/utils/LibTorrentTest-signal_bitfield_test.o torrent/utils/LibTorrentTest-thread_base_test.o tracker/LibTorrentTest-tracker_http_test.o LibTorrentTest-main.o ../src/libtorrent.la ../src/torrent/libsub_torrent.la ../src/torrent/data/libsub_torrentdata.la ../src/torrent/download/libsub_torrentdownload.la ../src/torrent/peer/libsub_torrentpeer.la ../src/data/libsub_data.la ../src/dht/libsub_dht.la ../src/download/libsub_download.la ../src/net/libsub_net.la ../src/protocol/libsub_protocol.la ../src/tracker/libsub_tracker.la ../src/utils/libsub_utils.la ../src/torrent/utils/libsub_torrentutils.la -lcrypto
libtool: link: x86_64-pc-linux-gnu-g++ -g -O2 -DNDEBUG -fvisibility=hidden -pthread -o .libs/LibTorrentTest ../src/LibTorrentTest-thread_disk.o rak/LibTorrentTest-allocators_test.o rak/LibTorrentTest-ranges_test.o data/LibTorrentTest-chunk_list_test.o data/LibTorrentTest-hash_check_queue_test.o data/LibTorrentTest-hash_queue_test.o protocol/LibTorrentTest-test_request_list.o torrent/LibTorrentTest-http_test.o torrent/LibTorrentTest-object_test.o torrent/LibTorrentTest-object_test_utils.o torrent/LibTorrentTest-object_static_map_test.o torrent/LibTorrentTest-object_stream_test.o torrent/LibTorrentTest-tracker_controller_test.o torrent/LibTorrentTest-tracker_controller_features.o torrent/LibTorrentTest-tracker_controller_requesting.o torrent/LibTorrentTest-tracker_list_test.o torrent/LibTorrentTest-tracker_list_features_test.o torrent/LibTorrentTest-tracker_timeout_test.o torrent/utils/LibTorrentTest-log_test.o torrent/utils/LibTorrentTest-log_buffer_test.o torrent/utils/LibTorrentTest-net_test.o torrent/utils/LibTorrentTest-option_strings_test.o torrent/utils/LibTorrentTest-test_extents.o torrent/utils/LibTorrentTest-test_queue_buckets.o torrent/utils/LibTorrentTest-signal_bitfield_test.o torrent/utils/LibTorrentTest-thread_base_test.o tracker/LibTorrentTest-tracker_http_test.o LibTorrentTest-main.o -L/usr/lib64 /usr/lib64/libcppunit.so -ldl ../src/.libs/libtorrent.so ../src/torrent/.libs/libsub_torrent.a ../src/torrent/data/.libs/libsub_torrentdata.a ../src/torrent/download/.libs/libsub_torrentdownload.a ../src/torrent/peer/.libs/libsub_torrentpeer.a ../src/data/.libs/libsub_data.a ../src/dht/.libs/libsub_dht.a ../src/download/.libs/libsub_download.a ../src/net/.libs/libsub_net.a ../src/protocol/.libs/libsub_protocol.a ../src/tracker/.libs/libsub_tracker.a ../src/utils/.libs/libsub_utils.a ../src/torrent/utils/.libs/libsub_torrentutils.a /usr/lib64/../lib64/libstdc++.so -lm -lcrypto -pthread -Wl,-rpath -Wl,/usr/lib64/../lib64
torrent/utils/LibTorrentTest-log_test.o: In function utils_log_test::test_file_output()': /home/ingmar/Repositories/libtorrent/test/torrent/utils/log_test.cc:140: warning: the use of
tmpnam' is dangerous, better use mkstemp' ../src/torrent/utils/.libs/libsub_torrentutils.a(log.o): In function
torrent::log_gz_file_write(std::tr1::shared_ptrtorrent::log_gz_output&, char const_, unsigned long, int)':
/home/ingmar/Repositories/libtorrent/src/torrent/utils/log.cc:377: undefined reference to gzwrite' /home/ingmar/Repositories/libtorrent/src/torrent/utils/log.cc:379: undefined reference to
gzwrite'
/home/ingmar/Repositories/libtorrent/src/torrent/utils/log.cc:380: undefined reference to gzwrite' /home/ingmar/Repositories/libtorrent/src/torrent/utils/log.cc:383: undefined reference to
gzwrite'
/home/ingmar/Repositories/libtorrent/src/torrent/utils/log.cc:388: undefined reference to gzwrite' ../src/torrent/utils/.libs/libsub_torrentutils.a(log.o):/home/ingmar/Repositories/libtorrent/src/torrent/utils/log.cc:386: more undefined references to
gzwrite' follow
../src/torrent/utils/.libs/libsub_torrentutils.a(log.o): In function log_gz_output': /home/ingmar/Repositories/libtorrent/src/torrent/utils/log.cc:76: undefined reference to
gzopen'
../src/torrent/utils/.libs/libsub_torrentutils.a(log.o): In function ~log_gz_output': /home/ingmar/Repositories/libtorrent/src/torrent/utils/log.cc:77: undefined reference to
gzclose'
/home/ingmar/Repositories/libtorrent/src/torrent/utils/log.cc:77: undefined reference to gzclose' ../src/protocol/.libs/libsub_protocol.a(request_list.o): In function
torrent::RequestList::delegate()':
/home/ingmar/Repositories/libtorrent/src/protocol/request_list.cc:127: undefined reference to `torrent::Delegator::delegate(torrent::PeerChunks_, int)'
collect2: error: ld returned 1 exit status
Makefile:791: recipe for target 'LibTorrentTest' failed
make[2]: *** [LibTorrentTest] Error 1
make[2]: Leaving directory '/home/ingmar/Repositories/libtorrent/test'
Makefile:1504: recipe for target 'check-am' failed
make[1]: *** [check-am] Error 2
make[1]: Leaving directory '/home/ingmar/Repositories/libtorrent/test'
Makefile:486: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1
First, I tried to run autogen.sh:
robbie@osxserver:~/libtorrent$ ./autogen.sh
aclocal...
configure.ac:22: warning: macro 'AM_PATH_CPPUNIT' not found in library
autoheader...
-n libtoolize...
using glibtoolize
automake...
autoconf...
configure.ac:22: error: possibly undefined macro: AM_PATH_CPPUNIT
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
robbie@osxserver:~/libtorrent$
aclocal version 1.14.1; autoheader version 2.69; glibtoolize version 2.4.2; automake version 1.14.1; autoconf version 2.69.
Despite the failure, a "configure" executable was produced, which ran for a bit before producing the following:
checking dependency style of gcc... gcc3
./configure: line 11844: syntax error near unexpected token `1.9.6'
./configure: line 11844: `AM_PATH_CPPUNIT(1.9.6)'
robbie@osxserver:~/libtorrent$
Platform is OSX (10.6 Server); software has been installed previously through MacPorts. Thanks in advance.
Could raw string (maybe sanitized or only 10-20 characters of it) received from server be shown in case of bencoded data parsing failure?
Something like this:
http://git.pld-linux.org/gitweb.cgi?p=packages/libtorrent.git;a=blob_plain;f=libtorrent-bencoded-error.patch;hb=HEAD
Torrent 1 has a folder structure of Linux/Ubuntu/1.iso
Torrent 2 has a folder structure of Linux/RedHat/2.iso
Suppose the Ubuntu torrent completes first. rtorrent executes a move command on the entire Linux/ directory.
This means that the incomplete RedHat folder is also moved. This causes problems.
rtorrent marks the torrent as closed - nothing more downloads. The only way to get the torrent working again is to copy all the partial files back into the correct directory structure.
(Tested on 0.8.9/0.12.9)
Hi,
I just tried compiling libtorrent I grabbed today from git and it's failing on me.
0.13.2 did compile ok...
I'm running Slackware 14.1 x86_64
aclocal...
/usr/share/aclocal/imlib.m4:9: warning: underquoted definition of AM_PATH_IMLIB
/usr/share/aclocal/imlib.m4:9: run info '(automake)Extending aclocal'
/usr/share/aclocal/imlib.m4:9: or see http://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
configure.ac:22: warning: macro `AM_PATH_CPPUNIT' not found in library
autoheader...
libtoolize... using libtoolize
automake...
configure.ac:3: installing `./config.guess'
configure.ac:3: installing `./config.sub'
configure.ac:20: installing `./install-sh'
configure.ac:20: installing `./missing'
src/Makefile.am: installing `./depcomp'
autoconf...
configure.ac:22: error: possibly undefined macro: AM_PATH_CPPUNIT
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
Please let me know if you need to know the versions of anything from my system...
thanks
Compiled master libtorrent and rtorrent. Short after start running this message appears:
rtorrent: TrackerManager::receive_timeout() called but m_tracker_list->has_active() == true.
rTorrent 0.8.9/0.12.9
Configure options :
./configure --enable-ipv6 --enable-static --disable-shared --prefix=/home/axel/libtorrent/torrent-bins --disable-debug
libtorrent_LIBS='-L/home/axel/libtorrent/torrent-bins/lib -lpthread -ltorrent -lcrypto'
libtorrent_CFLAGS=-I/home/axel/libtorrent/torrent-bins/include
./configure --enable-ipv6 --enable-static --disable-shared --disable-debug
I had to add this to make it compile:
diff --git a/src/core/download.h b/src/core/download.h
index 6939e8d..e5cd7b6 100644
--- a/src/core/download.h
+++ b/src/core/download.h
@@ -43,6 +43,7 @@
#include <torrent/hash_string.h>
#include <torrent/tracker_list.h>
#include <torrent/data/file_list.h>
+#include <torrent/data/download_data.h>
#include <torrent/peer/connection_list.h>
#include "globals.h"
Iam running libtorrent 13.2 on some ARM SOC and experiencing pretty frequent crashes here:
#0 0xb6a92344 in raise () from /lib/libpthread.so.0
#1 0xb6aa4bc4 in __aeabi_ldiv0 () from /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/4.6.3/libgcc_s.so.1
#2 0xb6dc1174 in torrent::FileList::chunk_index_size (this=0xd10160, index=0) at file_list.cc:169
#3 0xb6e4f72c in rak::const_mem_fun1<torrent::FileList, unsigned int, unsigned int>::operator() (this=0xd10124, a1=0) at ../../rak/functional.h:543
#4 0xb6e4eac8 in torrent::Delegator::new_chunk (this=0xd100c4, pc=0xee5080, highPriority=true) at delegator.cc:196
#5 0xb6e4e9e8 in torrent::Delegator::delegate_seeder (this=0xd100c4, peerChunks=0xee5080) at delegator.cc:180
#6 0xb6e4e5c8 in torrent::Delegator::delegate (this=0xd100c4, peerChunks=0xee5080, affinity=-1) at delegator.cc:138
#7 0xb6e95e00 in torrent::RequestList::delegate (this=0xee51c8) at request_list.cc:69
#8 0xb6e94ec0 in torrent::PeerConnectionMetadata::try_request_metadata_pieces (this=0xee5060) at peer_connection_metadata.cc:435
#9 0xb6e959f4 in torrent::PeerConnectionMetadata::fill_write_buffer (this=0xee5060) at peer_connection_metadata.cc:314
#10 0xb6e94530 in torrent::PeerConnectionMetadata::event_write (this=0xee5060) at peer_connection_metadata.cc:338
#11 0xb6d9d0fc in torrent::PollEPoll::perform (this=0xb92b88) at poll_epoll.cc:183
#12 0xb6d9d324 in torrent::PollEPoll::do_poll (this=0xb92b88, timeout_usec=437088, flags=0) at poll_epoll.cc:210
#13 0xb6e103bc in torrent::thread_base::event_loop (thread=0xb90c80) at thread_base.cc:145
#14 0x0003ab04 in main (argc=1, argv=0xbe9b9544) at main.cc:872
(gdb) frame 2
#2 0xb6dc1174 in torrent::FileList::chunk_index_size (this=0xd10160, index=0) at file_list.cc:169
(gdb) l
164 return left;
165 }
166
167 uint32_t
168 FileList::chunk_index_size(uint32_t index) const {
169 if (index + 1 != size_chunks() || size_bytes() % chunk_size() == 0)
170 return chunk_size();
171 else
172 return size_bytes() % chunk_size();
173 }
(gdb) call chunk_size()
$1 = 0
(gdb) frame 4
#4 0xb6e4eac8 in torrent::Delegator::new_chunk (this=0xd100c4, pc=0xee5080, highPriority=true) at delegator.cc:196
196 TransferList::iterator itr = m_transfers.insert(Piece(index, 0, m_slotChunkSize(index)), block_size);
(gdb) l
191 uint32_t index = m_slotChunkFind(pc, highPriority);
192
193 if (index == ~(uint32_t)0)
194 return NULL;
195
196 TransferList::iterator itr = m_transfers.insert(Piece(index, 0, m_slotChunkSize(index)), block_size);
197
198 (*itr)->set_by_seeder(pc->is_seeder());
199
200 if (highPriority)
(gdb) p index
$18 = 0
(gdb) p highPriority
$21 = true
(gdb) p pc
$19 = {m_peerInfo = 0xef8570, m_usingCounter = true, m_bitfield = {m_size = 1, m_set = 1, m_data = 0xedc718 "\200\325\247\266\270-\336"}, m_downloadCache = {static num_layers = 8, m_data = 0x0,
m_maxLayerSize = 0, m_index = 241, m_ceiling = 60464, m_layers = {{first = 0, second = 0}, {first = 0, second = 0}, {first = 0, second = 0}, {first = 0, second = 0}, {first = 0, second = 0}, {first = 0,
second = 0}, {first = 0, second = 0}, {first = 0, second = 0}}}, m_uploadQueue = empty std::list, m_cancelQueue = empty std::list, m_haveTimer = {m_time = 1374896674237079}, m_peerRate = {
m_container = std::deque with 0 elements, m_current = 0, m_total = 0, m_span = 600}, m_downloadThrottle = {m_quota = 0, m_listIterator = , m_rate = {m_container = std::deque with 0 elements,
m_current = 0, m_total = 0, m_span = 30}, m_slotActivate = {m_object = 0xee5068, m_function = (void (torrent::SocketBase::)(
torrent::SocketBase * const)) 0xb6e6df18 torrent::SocketBase::receive_throttle_down_activate()}}, m_uploadThrottle = {m_quota = 0, m_listIterator = , m_rate = {m_container = std::deque with 0 elements,
m_current = 0, m_total = 0, m_span = 30}, m_slotActivate = {m_object = 0xee5068, m_function = (void (torrent::SocketBase::*)(
torrent::SocketBase * const)) 0xb6e6df6c torrent::SocketBase::receive_throttle_up_activate()}}}
(gdb)
(gdb) p ((FileList) m_slotChunkSize->m_object)
$15 = {<std::vector<torrent::File*, std::allocatortorrent::File* >> = std::vector of length 1, capacity 1 = {0xd110d0}, static open_no_create = 1, static open_require_all_open = 2, m_data = {m_hash = {
static size_data = 20, m_data = "s\031f\357z\310.\221^\353d\241Uk-\230\347\370\030\363"}, m_completed_bitfield = {m_size = 1, m_set = 0, m_data = 0xd0b210 ""}, m_untouched_bitfield = {m_size = 1,
m_set = 1, m_data = 0xd087b8 "\200\207\320"},
m_high_priority = {<std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int> > >> = std::vector of length 0, capacity 0, },
m_normal_priority = {<std::vector<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int> > >> = std::vector of length 1, capacity 1 = {{first = 0,
second = 1}}, }, m_wanted_chunks = 1, m_slot_initial_hash = {std::tr1::_Maybe_unary_or_binary_function = {}, std::tr1::_Function_base = {
static _M_max_size = 8, static _M_max_align = 4, _M_functor = {_M_unused = {_M_object = 0xd11058, _M_const_object = 0xd11058, _M_function_pointer = 0xd11058, _M_member_pointer = (
void (std::tr1::Undefined_class::)(std::tr1::_Undefined_class * const)) 0xd11058, this adjustment 6848476}, _M_pod_data = "X\020\321\000\270\377\320"},
_M_manager = 0x124894 <std::tr1::Function_base::Base_manager<std::tr1::Bind<std::tr1::Mem_fn<void (core::DownloadList::)(core::Download)> (core::DownloadList, core::Download)> >::_M_manager(std::tr1::_Any_data&, std::tr1::_Any_data const&, std::tr1::_Manager_operation)>},
M_invoker = 0x12486c <std::tr1::Function_handler<void (), std::tr1::Bind<std::tr1::Mem_fn<void (core::DownloadList::)(core::Download)> (core::DownloadList, core::Download)> >::_M_invoke(std::tr1::_Any_data const&)>}, m_slot_download_done = {std::tr1::_Maybe_unary_or_binary_function = {}, std::tr1::_Function_base = {static _M_max_size = 8, static _M_max_align = 4,
_M_functor = {_M_unused = {_M_object = 0xd319a0, _M_const_object = 0xd319a0, _M_function_pointer = 0xd319a0, _M_member_pointer = (void (std::tr1::Undefined_class::)(
std::tr1::_Undefined_class * const)) 0xd319a0, this adjustment 6848476}, _M_pod_data = "\240\031\323\000\270\377\320"},
_M_manager = 0x124894 <std::tr1::_Function_base::_Base_manager<std::tr1::Bind<std::tr1::Mem_fn<void (core::DownloadList::)(core::Download)> (core::DownloadList, core::Download)> >::_M_manager(std::tr1::_Any_data&, std::tr1::_Any_data const&, std::tr1::_Manager_operation)>},
_M_invoker = 0x12486c <std::tr1::_Function_handler<void (), std::tr1::Bind<std::tr1::Mem_fn<void (core::DownloadList::)(core::Download)> (core::DownloadList, core::Download)> >::_M_invoke(std::tr1::_Any_data const&)>}, m_slot_partially_done = {std::tr1::_Maybe_unary_or_binary_function = {}, std::tr1::_Function_base = {static _M_max_size = 8, static _M_max_align = 4,
_M_functor = {_M_unused = {_M_object = 0xa7d0b5e3, _M_const_object = 0xa7d0b5e3, _M_function_pointer = 0xa7d0b5e3, _M_member_pointer = &virtual table offset -1479494173, this adjustment 328511988},
_M_pod_data = "\343\265\320\247\351c)'"}, _M_manager = 0x0}, _M_invoker = 0x6421c774},
m_slot_partially_restarted = {std::tr1::_Maybe_unary_or_binary_function = {}, std::tr1::_Function_base = {static _M_max_size = 8, static _M_max_align = 4, _M_functor = {
_M_unused = {_M_object = 0xb1f78952, _M_const_object = 0xb1f78952, _M_function_pointer = 0xb1f78952, _M_member_pointer = &virtual table offset -1309177518, this adjustment 802265347},
M_pod_data = "R\211\367\261\a2\243"}, _M_manager = 0x0}, _M_invoker = 0x34b64eba}}, m_isOpen = true, m_torrentSize = 0, m_chunkSize = 0, m_maxFileSize = 137438953472, m_rootDir = "/download",
m_indirectLinks = std::vector of length 1, capacity 2 = {"/download"}, m_isMultiFile = false, m_frozenRootDir = "/download"}
(gdb) p ((((FileList*) m_slotChunkSize->m_object))[0])
$17 = {static flag_active = 1, static flag_create_queued = 2, static flag_resize_queued = 4, static flag_fallocate = 8, static flag_previously_created = 16, static flag_prioritize_first = 32,
static flag_prioritize_last = 64, m_fd = 8, m_protection = 1, m_flags = 21,
m_path = {<std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >> = std::vector of length 1, capacity 1 = {"731966EF7AC82E915EEB64A1556B2D98E7F818F3.meta"}, m_encoding = ""}, m_frozenPath = "/download/731966EF7AC82E915EEB64A1556B2D98E7F818F3.meta", m_offset = 0, m_size = 0,
m_lastTouched = 1374896674479091, m_range = {first = 0, second = 0}, m_completed = 0, m_priority = torrent::PRIORITY_NORMAL, m_matchDepthPrev = 0, m_matchDepthNext = 0}
If you need more info just tell what to look up, this torrent is probably added from magnet link.
Hi,
I tried to compile directly on qemu-arm libtorrent for armel but I got the following problem:
../src/protocol/.libs/libsub_protocol.a(request_list.o): In function torrent::RequestList::delegate():/home/buildd/coding/libtorrent/src/protocol/request_list.cc:159: undefined reference to torrent::Delegator::delegate(torrent::PeerChunks_, int)
collect2: ld returned 1 exit status
make[3]: *_* [LibTorrentTest] Error 1
My configure parameters:
. / configure - build = arm-linux-gnueabi - prefix = / usr - includedir = $ {prefix} / include - mandir = $ {prefix} / share / man - INFODIR = $ {prefix} / share / info - sysconfdir = / etc - localstatedir = / var - libdir = $ {prefix} / lib / arm-linux-gnueabi - libexecdir = $ {prefix} / lib / arm-linux-gnueabi - disable-maintainer-mode - disable-dependency-tracking - enable-ipv6 - disable-instrumentation
how to solve?
thanks
Does libtorrent implement NAT traversal or are there plans to do so?
I really dislike the way you’ve responded to my previous bug reports, but I don’t want your software to be broken so I am going through it to find bugs since you obviously don’t seem to really care about them. Hopefully this will make the Internet just a tiny bit more secure.
Anyway, in ‘src/torrent/object_raw_bencode.h’ we have the following:
bool empty() const { return m_size == 0;; }
Which should obviously be:
bool empty() const { return m_size == 0; }
You’re welcome!
It doesn't send STOPPED event if I click STOP torrent action in rTorrent/ruTorrent.
It's sending an empty event same as on regular update.
I'm using a magnet with two udp trackers (publicbt one of them), for the test. One seeder, and one leech.
I know that rtorrent doesn't allow seeding the meta. But I found that if I set "encryption=require", it fails to grab the meta too.
I've tried with both a transmission and rtorrent, always with encryption require. When both (seeder and leech) use rtorrent, it doesn't work. When one is rtorrent and the other transmission (no matter who), it doesn't work either. When both are transmission, all works (also requiring encryption).
When the seeder is transmission, and rtorrent is the leech, it works only if I disable encryption. With encryption=require, it fails to download the meta.
With rtorrent I could download meta torrents with encryption enabled, like those of ubuntu, but not when the file is in my transmission server.
So there seems to be some incompatibility a bit hard to debug. Can I take any traces or try some situation, to help solve this?
gzbuffer was added in 1.2.4 and centos 6 distributes 1.2.3
log.cc: In member function 'bool torrent::log_gz_output::set_buffer(unsigned int)':
log.cc:81: error: 'gzbuffer' was not declared in this scope
this was added
commit c0757febd85bdaa579ddfd88e8a19b47cbc908b8
Author: rakshasa <[email protected]>
Date: Sun Mar 9 14:41:35 2014 +0100
Changed compression settings for log output using gzip.
diff --git a/src/torrent/utils/log.cc b/src/torrent/utils/log.cc
index 869c0ca..9d57210 100644
--- a/src/torrent/utils/log.cc
+++ b/src/torrent/utils/log.cc
@@ -73,11 +73,13 @@ struct log_cache_entry {
};
struct log_gz_output {
- log_gz_output(const char* filename) { gz_file = gzopen(filename, "wh"); }
+ log_gz_output(const char* filename) { gz_file = gzopen(filename, "w"); }
~log_gz_output() { if (gz_file != NULL) gzclose(gz_file); }
bool is_valid() { return gz_file != Z_NULL; }
+ bool set_buffer(unsigned size) { return gzbuffer(gz_file, size) == 0; }
+
gzFile gz_file;
};
@@ -409,6 +411,9 @@ log_open_gz_file_output(const char* name, const char* filename) {
if (!outfile->is_valid())
throw input_error("Could not open log gzip file '" + std::string(filename) + "'.");
+ // if (!outfile->set_buffer(1 << 14))
+ // throw input_error("Could not set gzip log file buffer size.");
+
log_open_output(name, std::tr1::bind(&log_gz_file_write, outfile,
std::tr1::placeholders::_1,
std::tr1::placeholders::_2,
admittedly, this zlib is old.
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -g -O2 -g -DDEBUG -fvisibility=hidden -pthread -MT net.lo -MD -MP -MF .deps/net.Tpo -c net.cc -fPIC -DPIC -o .libs/net.o
net.cc: In function ‘addrinfo* torrent::address_info_lookup(const char_, int, int)’:
net.cc:47: error: ‘memset’ is not a member of ‘std’
make[4]: *_* [net.lo] Error 1
make[4]: se sale del directorio /home/jose/src/libtorrent/src/torrent/utils' make[3]: *** [all-recursive] Error 1 make[3]: se sale del directorio
/home/jose/src/libtorrent/src/torrent'
make[2]: *** [all-recursive] Error 1
make[2]: se sale del directorio /home/jose/src/libtorrent/src' make[1]: *** [all-recursive] Error 1 make[1]: se sale del directorio
/home/jose/src/libtorrent'
make: *** [all] Error 2
I've always been able to compile previows trunk versions without problems.
Using libtorrent-git from AUR, these are few last lines:
....
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -DNDEBUG -fvisibility=hidden -pthread -MT net.lo -MD -MP -MF .deps/net.Tpo -c net.cc -fPIC -DPIC -o .libs/net.o
net.cc: In function 'addrinfo* torrent::address_info_lookup(const char_, int, int)':
net.cc:47:3: error: 'memset' is not a member of 'std'
make[4]: *_* [net.lo] Error 1
make[4]: Leaving directory /tmp/yaourt-tmp-aksr/aur-libtorrent-git/src/libtorrent-build/src/torrent/utils' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory
/tmp/yaourt-tmp-aksr/aur-libtorrent-git/src/libtorrent-build/src/torrent'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /tmp/yaourt-tmp-aksr/aur-libtorrent-git/src/libtorrent-build/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/tmp/yaourt-tmp-aksr/aur-libtorrent-git/src/libtorrent-build'
Just as the title says - http://bittorrent.org/beps/bep_0029.html is simple enough to implement [and I may doso, if nobody else does], and should be easy to turn on and off support for negotiating.
Just an issue filed because nobody else seems to have yet, so I wanted to note it so I didn't forget later.
The libtorrent/rTorrent suite is still using too much memory when faced with a moderate amount of torrents and peers. After something like 500 total connections, it reaches around 3GB of RAM. Compared to uTorrent using at most 200MB of RAM for the same situation.
Based on what little I can parse from the C++ code, it appears that libtorrent is still allocating a chunk's worth of memory per peer. There's really no need to allocate the memory as soon as the peer is connected, especially since most peers just sit there and don't do anything. It should only allocate the memory when the peer is actually transferring data. If the chunk isn't useful as a cache hit, then the memory should be de-allocated when the peer isn't talking again.
Attempted to build on Linux Mint:
Error:
../src/protocol/.libs/libsub_protocol.a(request_list.o): In function torrent::RequestList::delegate()': /home/rileymat/Development/libtorrent/src/protocol/request_list.cc:127: undefined reference to
torrent::Delegator::delegate(torrent::PeerChunks*, int)'
collect2: error: ld returned 1 exit status
This is the same error that issue #51 had.
Hi,
Everything worked fine 19 hours ago, but it's impossible to build since the last update.
Here's the error :
chunk_list.cc: In member function 'void torrent::ChunkList::release(torrent::ChunkHandle*, int)':
chunk_list.cc:204: error: overloaded function with no contextual type information
Thanks & cheer up
MBK
I have
d['announce-list'] = [ [tracker1], [backup1], [backup2] ]
And rtorrent is reporting announce to all these trackers. More details can be found :
http://bittorrent.org/beps/bep_0012.html
Running Debian 6.0 64bit and get the following when trying to compile libtorrent. I do currently have 0.8.6/0.12.6 running OK. This is happening when i try to compile 0.8.9/0.12.9
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(ctype.o): relocation R_X86_64_32S against `vtable for std::ctype<wchar_t>' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[3]: *** [libtorrent.la] Error 1
Any help would be appreciated.
aclocal...
configure.ac:21: error: 'AM_CONFIG_HEADER': this macro is obsolete.
You should use the 'AC_CONFIG_HEADERS' macro instead.
/usr/share/aclocal-1.13/obsolete-err.m4:12: AM_CONFIG_HEADER is expanded from...
configure.ac:21: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
rTorrent 0.9.2/0.13.2
I have about 1500 active torrents and after first stop/start rtorrent wont work.
System:
2*16 core Xeon(R) CPU E5-2620 0 @ 2.00GHz
RAM: 64Gb
Disk: ~20Tb
$ rtorrent
Caught Segmentation fault, dumping stack:
0 rtorrent() [0x413365]
1 rtorrent() [0x44d390]
2 /lib/x86_64-linux-gnu/libc.so.6(+0x36480) [0x7fde50583480]
3 /usr/lib/libtorrent.so.14(+0x5889c) [0x7fde51bb589c]
4 /usr/lib/libtorrent.so.14(+0xb3ce0) [0x7fde51c10ce0]
5 /usr/lib/libtorrent.so.14(+0xb4172) [0x7fde51c11172]
6 /usr/lib/libtorrent.so.14(+0x3a61d) [0x7fde51b9761d]
7 /usr/lib/libtorrent.so.14(ZN7torrent11thread_base10event_loopEPS0+0xb4) [0x7fde51bdefd4]
8 rtorrent() [0x412881]
9 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fde5056e76d]
10 rtorrent() [0x412ec5]
$ uname -a
Linux server 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
sysctl -a http://paste.ubuntu.com/1208825/
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 515159
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 999999
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 515159
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
do we need AM_PATH_CPPUNIT ?
small untested quick fix:
diff --git a/configure.ac b/configure.ac
index 5e9e71a..943da75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ AC_SUBST(LIBTORRENT_INTERFACE_VERSION_NO)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
-AM_PATH_CPPUNIT(1.9.6)
+#AM_PATH_CPPUNIT(1.9.6)
AC_PROG_CXX
diff --git a/src/torrent/utils/net.cc b/src/torrent/utils/net.cc
index 607bfbe..ed24fab 100644
--- a/src/torrent/utils/net.cc
+++ b/src/torrent/utils/net.cc
@@ -38,13 +38,14 @@
#include "net.h"
#include "exceptions.h"
+#include <string.h>
namespace torrent {
addrinfo*
address_info_lookup(const char* hostname, int family, int socktype) {
addrinfo hints;
libtorrent fails to compile with clang when clang is using libc++ as its C++ stdlib (for example, on Mac OS X 10.9 where that is the default). The failure comes from libtorrent using the TR1 prefixed versions of a few headers; libc++ includes only the C++11 versions of these, not the TR1 versions.
You can see the build logs here: https://gist.github.com/mistydemeo/7271614 I also notice that configure says:
checking for C++11 support... no
Which isn't correct. Seems to come from this in the configure test for C++11 support:
conftest.cpp:32:24: error: union member 'b1' has a non-trivial copy constructor
union test { Bar b1; };
^
/Library/Developer/CommandLineTools/usr/bin/../lib/c++/v1/unordered_map:733:5: note: because type 'std::__1::unordered_map<Foo *, int, std::__1::hash<Foo *>, std::__1::equal_to<Foo *>, std::__1::allocator<std::__1::pair<Foo *const, int> > >' has a user-provided copy constructor
unordered_map(const unordered_map& __u);
^
1 error generated.
It seems all the beta crap is using 2 characters followed by 3 numbers instead of four.
-UT340-
-BT791-
And theres a new client that we probably don't need to bother with. Tixati uses 3 characters.
TIX0196-
We're seeing requests from different peers using the same peer ID. This doesn't seem right, could you fix this?
Note the different ports, indicating different peers.
This causes tracker-side stats problems when multiple users share one IP address.
How's the peer ID generated?
?info_hash=<>&peer_id=-lt0D20-9%27%96k%24%B0%DC%8F%14%CC2%F9&key=3c7e178b&ip=<>&compact=1&numwant=100&port=54946&uploaded=1221299856&downloaded=8642776720&left=0
?info_hash=<>&peer_id=-lt0D20-9%27%96k%24%B0%DC%8F%14%CC2%F9&key=3c7e178b&ip=<>&compact=1&numwant=100&port=56056&uploaded=6619008928&downloaded=8642776720&left=0
the check for c++11 while using latest clang does not work now. Im sure exactly which commit it was, but it used to work.
this is the failure: https://pastee.org/cqc4j
gcc 4.7.0 passes this test
this isnt much of a complaint/issue, just an observation
When calling ./configure -h, "--enable-ipv6" option is described as " disable ipv6 [default=no]". Typo ?
I got this message when configure a rtorrent, libtorrent cloned from master and installed by checkinstall
and I try though make && make install
, and got some result.
It would be nice if rtorrent was a "good citizen" and seeded magnet metadata after downloading it, and also provided a way to start a new magnet seed, so that rtorrent could be used as the initial peer for a torrent distributed via magnet link.
New make error with latest git source:
holmen@filserver:~/source/libtorrent$ make -j4 | grep error
log.cc: In function 'void torrent::log_gz_file_write(std::tr1::shared_ptrtorrent::log_gz_output&, const char_, size_t, int)':
log.cc:368:59: error: expected ')' before 'PRIu64'
const char_ fmt = (group >= LOG_NON_CASCADING) ? ("%" PRIu64) : ("%" PRIu64 " %c");
^
log.cc:368:87: error: expected ':' before ';' token
const char* fmt = (group >= LOG_NON_CASCADING) ? ("%" PRIu64) : ("%" PRIu64 " %c");
^
log.cc:368:87: error: expected primary-expression before ';' token
make[4]: *** [log.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Trying to compile the latest and get this error:
Making install in src
make[1]: Entering directory /usr/src/libtorrent/src' Making install in torrent make[2]: Entering directory
/usr/src/libtorrent/src/torrent'
Making install in data
make[3]: Entering directory `/usr/src/libtorrent/src/torrent/data'
/bin/sh ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -g -O2 -g -DDEBUG -fvisibility=hidden -pthread -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -MT block.lo -MD -MP -MF .deps/block.Tpo -c -o block.lo block.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -g -O2 -g -DDEBUG -fvisibility=hidden -pthread -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -MT block.lo -MD -MP -MF .deps/block.Tpo -c block.cc -fPIC -DPIC -o .libs/block.o
In file included from ./../../protocol/peer_connection_base.h:54:0,
from block.cc:44:
./../../manager.h:44:25: fatal error: thread_disk.h: No such file or directory
compilation terminated.
This file doesn't exist in the archive. It doesn't exist on my server. It doesn't exist anywhere in any of Debian's packages. In fact, Google says that thread_disk.h literally does not exist on the web.
What is thread_disk.h? Where do I find it?
Trying to compile latest version (i.e., commit d5be349)…
make[2]: Entering directory `/home/ryan/code/torrent/libtorrent/test'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I. -I.. -I../src -g -O2 -g -DDEBUG -fvisibility=hidden -I/usr/kerberos/include -I/usr/include/sigc++-2.0 -I/usr/lib64/sigc++-2.0/include -MT LibTorrentTest-allocators_test.o -MD -MP -MF ".deps/LibTorrentTest-allocators_test.Tpo" -c -o LibTorrentTest-allocators_test.o `test -f 'rak/allocators_test.cc' || echo './'`rak/allocators_test.cc; \
then mv -f ".deps/LibTorrentTest-allocators_test.Tpo" ".deps/LibTorrentTest-allocators_test.Po"; else rm -f ".deps/LibTorrentTest-allocators_test.Tpo"; exit 1; fi
In file included from rak/allocators_test.cc:5:
rak/allocators_test.h:1:45: error: cppunit/extensions/HelperMacros.h: No such file or directory
rak/allocators_test.h:7: error: ‘CppUnit’ has not been declared
rak/allocators_test.h:7: error: expected `{' before ‘TestFixture’
rak/allocators_test.h:7: error: invalid function declaration
rak/allocators_test.cc:7: error: expected constructor, destructor, or type conversion before ‘;’ token
rak/allocators_test.cc:15: error: invalid use of undefined type ‘class AllocatorsTest’
rak/allocators_test.h:7: error: forward declaration of ‘class AllocatorsTest’
rak/allocators_test.cc: In member function ‘void AllocatorsTest::testAlignment()’:
rak/allocators_test.cc:16: error: ‘aligned_vector_type’ was not declared in this scope
rak/allocators_test.cc:16: error: expected `;' before ‘v1’
rak/allocators_test.cc:17: error: expected `;' before ‘v2’
rak/allocators_test.cc:18: error: expected `;' before ‘v3’
rak/allocators_test.cc:19: error: expected `;' before ‘v4’
rak/allocators_test.cc:20: error: expected `;' before ‘v5’
rak/allocators_test.cc:22: error: ‘v1’ was not declared in this scope
rak/allocators_test.cc:22: error: ‘CPPUNIT_ASSERT’ was not declared in this scope
rak/allocators_test.cc:23: error: ‘v2’ was not declared in this scope
rak/allocators_test.cc:24: error: ‘v3’ was not declared in this scope
rak/allocators_test.cc:25: error: ‘v4’ was not declared in this scope
rak/allocators_test.cc:26: error: ‘v5’ was not declared in this scope
make[2]: *** [LibTorrentTest-allocators_test.o] Error 1
make[2]: Leaving directory `/home/ryan/code/torrent/libtorrent/test'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/home/ryan/code/torrent/libtorrent/test'
make: *** [check-recursive] Error 1
make[4]: Entering directory /home/edent/libtorrent/src/torrent/utils' /bin/bash ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -g -O2 -g -DDEBUG -fvisibility=hidden -pthread -MT thread_base.lo -MD -MP -MF .deps/thread_base.Tpo -c -o thread_base.lo thread_base.cc libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -g -O2 -g -DDEBUG -fvisibility=hidden -pthread -MT thread_base.lo -MD -MP -MF .deps/thread_base.Tpo -c thread_base.cc -fPIC -DPIC -o .libs/thread_base.o thread_base.cc: In static member function 'static void* torrent::thread_base::event_loop(torrent::thread_base*)': thread_base.cc:136:36: error: invalid conversion from 'const char*' to 'pthread_t {aka long unsigned int}' [-fpermissive] thread_base.cc:136:36: error: too few arguments to function 'int pthread_setname_np(pthread_t, const char*)' /usr/include/pthread.h:435:12: note: declared here make[4]: *** [thread_base.lo] Error 1 make[4]: Leaving directory
/home/edent/libtorrent/src/torrent/utils'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory /home/edent/libtorrent/src/torrent' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory
/home/edent/libtorrent/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/edent/libtorrent'
make: *** [all] Error 2
rtorrent does not honour the -i flag at all.
I have multiple interfaces and the main interface is used to seed/download.
it says it binds to the ip but it does not.
other programs (irssi) binds correctly
When a torrent download has completed, completion notification is typically queued for the next announce (in TrackerController::send_completed_event()
).
If a manual update is then requested before the tracker timeout is reached, TrackerController::send_update_event()
sends an announce without any event parameter.
Upon returning to TrackerController::receive_success()
all mask_send
flags are cleared, including flag_send_completed
.
This results in the completed event never being reported to the tracker.
(tracker_controller.cc:270` might refer to this scenario?)
I think it's something related to zlib, I already googled and found nothing:
/bin/bash ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -g -O2 -g -DDEBUG -fvisibility=hidden -pthread -MT log.lo -MD -MP -MF .deps/log.Tpo -c -o log.lo log.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../.. -I. -I./.. -I./../.. -I../../.. -g -O2 -g -DDEBUG -fvisibility=hidden -pthread -MT log.lo -MD -MP -MF .deps/log.Tpo -c log.cc -fPIC -DPIC -o .libs/log.o
log.cc: In member function ‘bool torrent::log_gz_output::set_buffer(unsigned int)’:
log.cc:81: error: ‘gzbuffer’ was not declared in this scope
make[4]: *** [log.lo] Error 1
If you need more logs/information just let me know!
Thanks for your support (and for creating the rtorrent project, it's awesome :).
Hello,
This problem very like http://libtorrent.rakshasa.no/ticket/1637,
I'm running centos 6.2 32bit in VirtualBox 4.1.18 and compiled libtorrent and rtorrent (0.13.2/0.9.2).
When I try to download into vboxfs, I receive the storage error [File chunk write error: Invalid argument].
I found somebody have the same problem in https://www.virtualbox.org/ticket/819#comment:50
I don't sure where is the problem but virtualbox developers looks like they don't hear anybody's opinion after purchased.
Here is a part of strace output:
gettimeofday({1341038606, 429890}, NULL) = 0
gettimeofday({1341038606, 430156}, NULL) = 0
gettimeofday({1341038606, 430336}, NULL) = 0
gettimeofday({1341038606, 431489}, NULL) = 0
gettimeofday({1341038606, 431700}, NULL) = 0
epoll_wait(3, {{EPOLLIN, {u32=43, u64=43}}}, 1024, 570) = 1
recv(43, "\0\0\0\1\1", 64, 0) = 5
epoll_ctl(3, EPOLL_CTL_MOD, 43, {EPOLLIN|EPOLLOUT|EPOLLERR, {u32=43, u64=43}}) = 0
gettimeofday({1341038606, 589685}, NULL) = 0
gettimeofday({1341038606, 590016}, NULL) = 0
gettimeofday({1341038606, 590342}, NULL) = 0
gettimeofday({1341038606, 590602}, NULL) = 0
gettimeofday({1341038606, 590832}, NULL) = 0
epoll_wait(3, {{EPOLLOUT, {u32=43, u64=43}}}, 1024, 410) = 1
send(43, "\0\0\0\r\6\0\0\1\267\0\1\200\0\0\0@\0\0\0\0\r\6\0\0\1\267\0\1\300\0\0\0"..., 34, 0) = 34
epoll_ctl(3, EPOLL_CTL_MOD, 43, {EPOLLIN|EPOLLERR, {u32=43, u64=43}}) = 0
gettimeofday({1341038606, 593303}, NULL) = 0
gettimeofday({1341038606, 593545}, NULL) = 0
gettimeofday({1341038606, 593822}, NULL) = 0
gettimeofday({1341038606, 594021}, NULL) = Regards0
gettimeofday({1341038606, 594328}, NULL) = 0
epoll_wait(3, {{EPOLLIN, {u32=61, u64=61}}}, 1024, 407) = 1
recv(61, "\342\365\375\vFd\206\3070Z\301\224*u\5\372\347@<s\17\310}\323\240\314\222\222\236\2003l"..., 64, 0) = 64
fstat64(7, {st_mode=S_IFREG|0664, st_size=729808896, ...}) = 0
fstat64(7, {st_mode=S_IFREG|0664, st_size=729808896, ...}) = 0
mmap2(NULL, 262144, PROT_READ|PROT_WRITE, MAP_SHARED, 7, 0x6dc0) = -1 EINVAL (Invalid argument)
epoll_ctl(3, EPOLL_CTL_MOD, 61, {EPOLLERR, {u32=61, u64=61}}) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 61, {0, {u32=61, u64=61}}) = 0
close(61) = 0
I need your help, thanks.
Pyec.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.