Skip to content

libtorrent v2-only torrent segfault #8817

@qstokkink

Description

@qstokkink

When there are too many torrents (11) in a session (13 with other hops included), loading a v2-only torrent checkpoint causes a segfault (Ubuntu):

Thread 31 "python" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff81ffb640 (LWP 11244)]
___pthread_mutex_lock (mutex=0x10) at ./nptl/pthread_mutex_lock.c:80
80	./nptl/pthread_mutex_lock.c: No such file or directory.
(gdb) backtrace
#0  ___pthread_mutex_lock (mutex=0x10) at ./nptl/pthread_mutex_lock.c:80
#1  0x00007ffff3c35f6e in libtorrent::part_file::hash2(libtorrent::lcrypto::hasher256&, long, libtorrent::aux::strong_typedef<int, libtorrent::aux::piece_index_tag, void>, int, boost::system::error_code&) ()
   from /home/python/site-packages/libtorrent/__init__.cpython-312-x86_64-linux-gnu.so
#2  0x00007ffff3ad0f12 in libtorrent::mmap_storage::hash2(libtorrent::settings_interface const&, libtorrent::lcrypto::hasher256&, long, libtorrent::aux::strong_typedef<int, libtorrent::aux::piece_index_tag, void>, int, libtorrent::flags::bitfield_flag<unsigned int, libtorrent::aux::open_mode_tag, void>, libtorrent::flags::bitfield_flag<unsigned char, libtorrent::disk_job_flags_tag, void>, libtorrent::storage_error&) ()
   from /home/python/site-packages/libtorrent/__init__.cpython-312-x86_64-linux-gnu.so
#3  0x00007ffff3ac7dd4 in libtorrent::mmap_disk_io::do_hash(libtorrent::aux::mmap_disk_job*) ()
   from /home/python/site-packages/libtorrent/__init__.cpython-312-x86_64-linux-gnu.so
#4  0x00007ffff3ac5ebc in libtorrent::mmap_disk_io::perform_job(libtorrent::aux::mmap_disk_job*, libtorrent::tailqueue<libtorrent::aux::mmap_disk_job>&) ()
   from /home/python/site-packages/libtorrent/__init__.cpython-312-x86_64-linux-gnu.so
#5  0x00007ffff3ac5ff9 in libtorrent::mmap_disk_io::execute_job(libtorrent::aux::mmap_disk_job*) ()
   from /home/python/site-packages/libtorrent/__init__.cpython-312-x86_64-linux-gnu.so
#6  0x00007ffff3ac66d9 in libtorrent::mmap_disk_io::thread_fun(libtorrent::mmap_disk_io::job_queue&, libtorrent::aux::disk_io_thread_pool&) ()
   from /home/python/site-packages/libtorrent/__init__.cpython-312-x86_64-linux-gnu.so
#7  0x00007ffff3b197ee in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (libtorrent::aux::pool_thread_interface::*)(libtorrent::aux::disk_io_thread_pool&, boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void>), libtorrent::aux::pool_thread_interface*, std::reference_wrapper<libtorrent::aux::disk_io_thread_pool>, boost::asio::executor_work_guard<boost::asio::io_context::basic_executor_type<std::allocator<void>, 0ul>, void, void> > > >::_M_run() ()
   from /home/python/site-packages/libtorrent/__init__.cpython-312-x86_64-linux-gnu.so
#8  0x00007ffff3e15220 in execute_native_thread_routine ()
   from /home/python/site-packages/libtorrent/__init__.cpython-312-x86_64-linux-gnu.so
#9  0x00007ffff7494ac3 in start_thread (arg=<optimized out>)
    at ./nptl/pthread_create.c:442
#10 0x00007ffff75268c0 in clone3 ()
    at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

The same torrent loads just fine with only a few (3) other torrents active.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions