frostwire / frostwire-jlibtorrent

A swig Java interface for libtorrent by the makers of FrostWire. Develop libtorrent based apps with the joy of coding in Java.
http://www.frostwire.com
MIT License
446 stars 137 forks source link

[crash] on_resume_data_checked / ibtorrent::heterogeneous_queue<libtorrent::alert>::move<libtorrent::add_torrent_alert>(unsigned long*, unsigned long*) #151

Closed gubatron closed 7 years ago

gubatron commented 7 years ago

Might want to check this code. I'm checking a bug on which an alert listener isn't reporting when a torrent has finished. Whenever I delete the .torrent and the file to try again, it seems something in the jlibtorrent resuming logic is failing and causing a crash every time I try to start clean.

1.2.0.5 / MacOSX

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000127d54475, pid=52566, tid=67915
#
# JRE version: Java(TM) SE Runtime Environment (8.0_60-b27) (build 1.8.0_60-b27)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.60-b23 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libjlibtorrent.dylib+0x173475]  void libtorrent::heterogeneous_queue<libtorrent::alert>::move<libtorrent::add_torrent_alert>(unsigned long*, unsigned long*)+0x85
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/gubatron/workspace.frostwire/frostwire/desktop/hs_err_pid52566.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

here's another related stack trace

Thread 41 Crashed:
0   libsystem_kernel.dylib          0x00007fff8dc80dd6 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff8dd6c787 pthread_kill + 90
2   libsystem_c.dylib               0x00007fff8dbe6420 abort + 129
3   libjvm.dylib                    0x0000000103f70beb os::abort(bool) + 25
4   libjvm.dylib                    0x0000000104094a2a VMError::report_and_die() + 2304
5   libjvm.dylib                    0x0000000103f72816 JVM_handle_bsd_signal + 1131
6   libjvm.dylib                    0x0000000103f6ea7b signalHandler(int, __siginfo*, void*) + 47
7   libsystem_platform.dylib        0x00007fff8dd5fbba _sigtramp + 26
8   ???                             0x000000000000ffff 0 + 65535
9   libjlibtorrent.dylib            0x000000012788c19a 0x1276d1000 + 1814938
10  libjlibtorrent.dylib            0x0000000127885d75 0x1276d1000 + 1789301
11  libjlibtorrent.dylib            0x00000001278622be libtorrent::torrent::we_have(int) + 910
12  libjlibtorrent.dylib            0x0000000127862b5c libtorrent::torrent::on_resume_data_checked(libtorrent::status_t, libtorrent::storage_error const&) + 1500
13  libjlibtorrent.dylib            0x000000012777760f libtorrent::disk_io_job::call_callback() + 447
14  libjlibtorrent.dylib            0x000000012778044e libtorrent::disk_io_thread::call_job_handlers() + 142
15  libjlibtorrent.dylib            0x00000001277835f4 boost::asio::detail::completion_handler<std::__1::__bind<void (libtorrent::disk_io_thread::*)(), libtorrent::disk_io_thread*> >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) + 84
16  libjlibtorrent.dylib            0x00000001278076d1 0x1276d1000 + 1271505
17  libjlibtorrent.dylib            0x00000001278071a5 0x1276d1000 + 1270181
18  libjlibtorrent.dylib            0x0000000127806500 0x1276d1000 + 1266944
19  libsystem_pthread.dylib         0x00007fff8dd69aab _pthread_body + 180
20  libsystem_pthread.dylib         0x00007fff8dd699f7 _pthread_start + 286
21  libsystem_pthread.dylib         0x00007fff8dd691fd thread_start + 13
aldenml commented 7 years ago

Working in it here https://github.com/arvidn/libtorrent/pull/1769

aldenml commented 7 years ago

The PR was merged, I also added more fixes here https://github.com/arvidn/libtorrent/pull/1774