libtorrent icon indicating copy to clipboard operation
libtorrent copied to clipboard

Crash when rechecking torrents with missing empty files

Open half-duplex opened this issue 5 years ago • 0 comments

rtorrent reliably crashes when attempting to recheck open torrents that contain 0-byte files that don't exist on disk. I think this is a libtorrent issue, if not, apologies.

Reproduction steps:

  • Create example torrent:
mkdir test rtsession
echo hello >test/hello.txt
touch test/empty.txt
mktorrent -a http://localhost/announce -d test
  • rtorrent -n -o session=rtsession
  • [Backspace] test.torrent [Enter] to load.start the torrent
  • ^q to quit rtorrent
  • rm test/empty.txt
  • rtorrent -n -o session=rtsession
  • [Down] to select the torrent, ^r to recheck
  • Expected: Rechecks to 100%, possibly re-creates the empty file.
  • Observed: Kaboom:
Caught internal_error: FileList::mark_completed(...) received an invalid index. [#6E3F5340ACC2C8DD59264B7503CA0B8B9FBC2900]
/home/mal/rtdev/lib/libtorrent.so.21(_ZN7torrent14internal_error10initializeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x253) [0x7f64a7f4e0f3]
/home/mal/rtdev/lib/libtorrent.so.21(_ZN7torrent14internal_errorC2EPKcRKNS_10HashStringE+0x244) [0x7f64a7f25254]
/home/mal/rtdev/lib/libtorrent.so.21(+0x2ad73) [0x7f64a7f04d73]
/home/mal/rtdev/lib/libtorrent.so.21(+0xaab2c) [0x7f64a7f84b2c]
/home/mal/rtdev/lib/libtorrent.so.21(+0x889eb) [0x7f64a7f629eb]
/home/mal/rtdev/lib/libtorrent.so.21(_ZN7torrent15signal_bitfield4workEv+0x69) [0x7f64a7f49d89]
/home/mal/rtdev/lib/libtorrent.so.21(_ZN7torrent11thread_base10event_loopEPS0_+0x175) [0x7f64a7f49f15]
/home/mal/rtdev/bin/rtorrent(main+0xefe) [0x55812447339e]
/usr/lib/libc.so.6(__libc_start_main+0xf2) [0x7f64a7b1f002]
/home/mal/rtdev/bin/rtorrent(_start+0x2e) [0x558124473d0e]

libtorrent: c791ea3c72890ddde82ebc101c71afa1389ffc58 ./configure LDFLAGS=-rdynamic --prefix=/home/mal/rtdev --enable-debug --enable-extra-debug rtorrent: rakshasa/rtorrent@79765768ff3d93a511ceb90df24a8dbb0a62e4f5 PKG_CONFIG_PATH="/home/mal/rtdev/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig" ./configure LDFLAGS=-rdynamic --prefix=/home/mal/rtdev --enable-debug --enable-extra-debug (Ran as LD_LIBRARY_PATH="/home/mal/rtdev/lib/" rtdev/bin/rtorrent)

half-duplex avatar Aug 19 '20 20:08 half-duplex