-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
race condition in tr_torrentPeers() #6762
Comments
This is closely related to 5853 so yeah the argument that this is a duplicate makes sense. Just on a practical level though, the race conditions in My vote:
|
Kindly grant me power to rename issues. :D I'll prepare a revert PR. |
Oh whoah:
That hardware is 11.5 years old. I can see why there may be performance issues with a thousand torrents and Inspector opened. But anyway, I made a revert PR that would hopefully return things to their previous higher performances when Inspector is opened: #6766. |
I did reproduce on macOS by doing cmd+A (to select all torrents) while I was on tearfur/pool branch:
|
What is the issue?
Mac mini (late 2012, 2.5-GHz 4-Core i5), 16GB RAM, plus an assortment of USB & FW HDs.
macOS 14.4.1 Sonoma (w/OCLP 1.4.2), PIA 3.5.7, and Xcode.
Pipe is 450 Mbps wifi to Comcast coax 100/25 Mbps, with PIA beaming me thru to Canada.
Running Transmission-87862e506d Build #9564
Launched with all torrents (~950) paused. Transmission took a long time to load / bring up the Main window. After a while (20+ mins), I opened the Inspector window then resumed all torrents. Got a couple dozen peers going. Then I started playing in the Main window, selecting and unselecting various torrents. Tried to select a whole large group of torrents - when I clicked, Transmission crashed immediately.
Translated Report (Full Report Below)
Process: Transmission [7601]
Path: /Users/USER/*/Transmission-87862e506d Build #9564.app/Contents/MacOS/Transmission
Identifier: org.m0k.transmission
Version: 4.1.0-dev (14718.1.0)
Code Type: X86-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2024-03-31 23:43:19.2122 -0400
OS Version: macOS 14.4.1 (23E224)
Report Version: 12
Anonymous UUID: C5048D24-7417-7AA9-D745-755E4ED63C56
Time Awake Since Boot: 200000 seconds
System Integrity Protection: enabled
Crashed Thread: 1
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000040
Exception Codes: 0x0000000000000001, 0x0000000000000040
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [7601]
VM Region Info: 0x40 is not in any region. Bytes before following region: 4344172480
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 102eed000-103161000 [ 2512K] r-x/r-x SM=COW /Users/USER/*/Transmission-87862e506d Build #9564.app/Contents/MacOS/Transmission
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x7ff802a69f7a __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x7ff802aa76f3 _pthread_cond_wait + 1211
2 libc++.1.dylib 0x7ff8029e0d12 std::__1::condition_variable::wait(std::__1::unique_lockstd::__1::mutex&) + 18
3 libc++.1.dylib 0x7ff8029e3ec7 std::__1::__assoc_sub_state::__sub_wait(std::__1::unique_lockstd::__1::mutex&) + 45
4 libc++.1.dylib 0x7ff8029e3f2e std::__1::__assoc_sub_state::wait() + 46
5 Transmission 0x10300b7cd std::__1::future::wait() const + 9 (future:1249) [inlined]
6 Transmission 0x10300b7cd tr_peerMgrPeerStats(tr_torrent const*, unsigned long*) + 280 (peer-mgr.cc:1853)
7 Transmission 0x102f402a1 -[Torrent peers] + 59 (Torrent.mm:947)
8 Transmission 0x102f87786 -[InfoPeersViewController updateInfo] + 1260 (InfoPeersViewController.mm:161)
9 Transmission 0x102f4bbb4 -[InfoWindowController updateInfoStats] + 48 (InfoWindowController.mm:469)
10 Transmission 0x102f0458e -[Controller updateUI] + 904 (Controller.mm:2386)
11 Foundation 0x7ff803ad4814 __NSFireTimer + 67
12 CoreFoundation 0x7ff802b9f509 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
13 CoreFoundation 0x7ff802b9f0b9 __CFRunLoopDoTimer + 785
14 CoreFoundation 0x7ff802b9ecea __CFRunLoopDoTimers + 285
15 CoreFoundation 0x7ff802b830ad __CFRunLoopRun + 2108
16 CoreFoundation 0x7ff802b822a9 CFRunLoopRunSpecific + 557
17 HIToolbox 0x7ff80da6d829 RunCurrentEventLoopInMode + 292
18 HIToolbox 0x7ff80da6d636 ReceiveNextEventCommon + 665
19 HIToolbox 0x7ff80da6d381 _BlockUntilNextEventMatchingListInModeWithFilter + 66
20 AppKit 0x7ff80614bbe5 _DPSNextEvent + 880
21 AppKit 0x7ff806a5bfe9 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1273
22 AppKit 0x7ff80613d005 -[NSApplication run] + 603
23 AppKit 0x7ff806110ff1 NSApplicationMain + 816
24 Transmission 0x102ef2e7f main + 73 (main.mm:17)
25 dyld 0x7ff80271b366 start + 1942
Thread 1 Crashed:
0 Transmission 0x10301f8d8 (anonymous namespace)::peer_stat_helpers::get_peer_stats(tr_peerMsgs const*, long, unsigned long long) + 71 (peer-mgr.cc:1734) [inlined]
1 Transmission 0x10301f8d8 auto tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8::operator()() const::'lambda'(auto const*)::operator()<tr_peerMsgs>(auto const*) const + 71 (peer-mgr.cc:1850) [inlined]
2 Transmission 0x10301f8d8 tr_peer_stat* std::__1::transform<std::__1::__wrap_iter<tr_peerMsgs* const*>, tr_peer_stat*, tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8::operator()() const::'lambda'(auto const*)>(auto, auto, tr_peer_stat*, tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8::operator()() const::'lambda'(auto const*)) + 78 (transform.h:29) [inlined]
3 Transmission 0x10301f8d8 tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8::operator()() const + 159 (peer-mgr.cc:1846) [inlined]
4 Transmission 0x10301f8d8 decltype(static_cast<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8&>(fp)()) std::__1::__invoke<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8&>(tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8&) + 159 (type_traits:3918) [inlined]
5 Transmission 0x10301f8d8 std::__1::__bind_return<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8, std::__1::tuple<>, std::__1::tuple<>, __is_valid_bind_return<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8, std::__1::tuple<>, std::__1::tuple<>>::value>::type std::__1::__apply_functor<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8, std::__1::tuple<>, std::__1::tuple<>>(tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8&, std::__1::tuple<>&, std::__1::__tuple_indices<>, std::__1::tuple<>&&) + 159 (bind.h:257) [inlined]
6 Transmission 0x10301f8d8 std::__1::__bind_return<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8, std::__1::tuple<>, std::__1::tuple<>, __is_valid_bind_return<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8, std::__1::tuple<>, std::__1::tuple<>>::value>::type std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>::operator()<>() + 159 (bind.h:292) [inlined]
7 Transmission 0x10301f8d8 decltype(static_cast<std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>&>(fp)()) std::__1::__invoke<std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>&>(std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>&) + 159 (type_traits:3918) [inlined]
8 Transmission 0x10301f8d8 void std::__1::__invoke_void_return_wrapper<void, true>::__call<std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>&>(std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>&) + 159 (invoke.h:61) [inlined]
9 Transmission 0x10301f8d8 std::__1::__function::__alloc_func<std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>, std::__1::allocator<std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>>, void ()>::operator()() + 159 (function.h:178) [inlined]
10 Transmission 0x10301f8d8 std::__1::__function::__func<std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>, std::__1::allocator<std::__1::__bind<tr_peerMgrPeerStats(tr_torrent const*, unsigned long*)::$_8>>, void ()>::operator()() + 196 (function.h:352)
11 Transmission 0x102ff399b std::__1::__function::__value_func<void ()>::operator()() const + 15 (function.h:505) [inlined]
12 Transmission 0x102ff399b std::__1::function<void ()>::operator()() const + 15 (function.h:1182) [inlined]
13 Transmission 0x102ff399b tr_session_thread_impl::on_work_available() + 121 (session-thread.cc:272)
14 Transmission 0x1030b77c0 event_process_active_single_queue + 502 (event.c:1691)
15 Transmission 0x1030b48cb event_process_active + 220 [inlined]
16 Transmission 0x1030b48cb event_base_loop + 1134 (event.c:2006)
17 Transmission 0x102ff3755 tr_session_thread_impl::session_thread_func(event_base*) + 87 (session-thread.cc:244)
18 Transmission 0x102ff3b5f decltype(static_cast<tr_session_thread_impl>(fp0).fp(static_cast<event_base>(fp1))) std::__1::__invoke<void (tr_session_thread_impl::)(event_base), tr_session_thread_impl*, event_base*, void>(void (tr_session_thread_impl::&&)(event_base), tr_session_thread_impl*&&, event_base*&&) + 30 (type_traits:3859) [inlined]
19 Transmission 0x102ff3b5f void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct>, void (tr_session_thread_impl::)(event_base), tr_session_thread_impl*, event_base*, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct>, void (tr_session_thread_impl::)(event_base), tr_session_thread_impl*, event_base*>&, std::__1::__tuple_indices<2ul, 3ul>) + 30 (thread:287) [inlined]
20 Transmission 0x102ff3b5f void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct>, void (tr_session_thread_impl::)(event_base), tr_session_thread_impl*, event_base*>>(void*) + 63 (thread:298)
21 libsystem_pthread.dylib 0x7ff802aa718b _pthread_start + 99
22 libsystem_pthread.dylib 0x7ff802aa2ae3 thread_start + 15
Thread 2:
0 libsystem_kernel.dylib 0x7ff802a69e46 __semwait_signal + 10
1 libsystem_c.dylib 0x7ff80295c531 nanosleep + 199
2 libc++.1.dylib 0x7ff8029f10b4 std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l>> const&) + 73
3 Transmission 0x103044bb2 void std::__1::this_thread::sleep_for<long long, std::__1::ratio<1l, 1000l>>(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l>> const&) + 17 (thread:386) [inlined]
4 Transmission 0x103044bb2 tr_web::Impl::curlThreadFunc() + 448 (web.cc:717)
5 Transmission 0x103044e4b decltype(static_cast<tr_web::Impl>(fp0).fp()) std::__1::__invoke<void (tr_web::Impl::)(), tr_web::Impl*, void>(void (tr_web::Impl::&&)(), tr_web::Impl&&) + 26 (type_traits:3859) [inlined]
6 Transmission 0x103044e4b void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct>, void (tr_web::Impl::)(), tr_web::Impl, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct>, void (tr_web::Impl::)(), tr_web::Impl>&, std::__1::__tuple_indices<2ul>) + 26 (thread:287) [inlined]
7 Transmission 0x103044e4b void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct>, void (tr_web::Impl::)(), tr_web::Impl>>(void*) + 59 (thread:298)
8 libsystem_pthread.dylib 0x7ff802aa718b _pthread_start + 99
9 libsystem_pthread.dylib 0x7ff802aa2ae3 thread_start + 15
Thread 3:: VDKQueue
0 libsystem_kernel.dylib 0x7ff802a6c0ae kevent + 10
1 Transmission 0x102f9b1a8 -[VDKQueue watcherThread:] + 240 (VDKQueue.mm:183)
2 Foundation 0x7ff803a8e3cc NSThread__start + 1013
3 libsystem_pthread.dylib 0x7ff802aa718b _pthread_start + 99
4 libsystem_pthread.dylib 0x7ff802aa2ae3 thread_start + 15
Thread 4:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x7ff802a673ce mach_msg2_trap + 10
1 libsystem_kernel.dylib 0x7ff802a75c88 mach_msg2_internal + 84
2 libsystem_kernel.dylib 0x7ff802a6e510 mach_msg_overwrite + 653
3 libsystem_kernel.dylib 0x7ff802a676bd mach_msg + 19
4 CoreFoundation 0x7ff802b84359 __CFRunLoopServiceMachPort + 143
5 CoreFoundation 0x7ff802b82dcc __CFRunLoopRun + 1371
6 CoreFoundation 0x7ff802b822a9 CFRunLoopRunSpecific + 557
7 AppKit 0x7ff8062a8abc _NSEventThread + 122
8 libsystem_pthread.dylib 0x7ff802aa718b _pthread_start + 99
9 libsystem_pthread.dylib 0x7ff802aa2ae3 thread_start + 15
Thread 5:
0 libsystem_pthread.dylib 0x7ff802aa2ac0 start_wqthread + 0
Thread 6:
0 libsystem_pthread.dylib 0x7ff802aa2ac0 start_wqthread + 0
Thread 7:
0 libsystem_pthread.dylib 0x7ff802aa2ac0 start_wqthread + 0
Thread 1 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x00007ff0fe054cc0 rcx: 0x0000000000000010 rdx: 0xffffffffffffffd0
rdi: 0x000070000c3a3d08 rsi: 0x00007ff0f821ee00 rbp: 0x000070000c3a3e10 rsp: 0x000070000c3a3d00
r8: 0x0000000000000000 r9: 0x0000000000000002 r10: 0x00007ff1018df200 r11: 0x00000ff0f1cb0ee0
r12: 0x000070000c3a3d08 r13: 0x00006000024eac10 r14: 0x00000000660a2d12 r15: 0x00007ff0f821ee00
rip: 0x000000010301f8d8 rfl: 0x0000000000010293 cr2: 0x0000000000000040
Logical CPU: 3
Error Code: 0x00000004 (no mapping for user data read)
Trap Number: 14
Thread 1 instruction stream:
48 8b 40 10 48 8b 18 49-83 c6 c4 48 89 9d 20 ff H.@.H..I...H.. .
ff ff 4d 8b 7d 00 0f 57-c0 0f 29 45 c0 0f 29 45 ..M.}..W..)E..)E
b0 0f 29 45 a0 0f 29 45-90 0f 29 45 80 0f 29 85 ..)E..)E..)E..).
70 ff ff ff 0f 29 85 60-ff ff ff 0f 29 85 50 ff p....).`....).P.
ff ff 0f 29 85 40 ff ff-ff 0f 29 85 30 ff ff ff ...).@....).0...
49 8b 07 4c 8d a5 f8 fe-ff ff 4c 89 e7 4c 89 fe I..L......L..L..
[ff]50 40 ba 2e 00 00 00-4c 89 e7 48 8d b5 3e ff .P@.....L..H..>. <==
ff ff e8 ad 7e fc ff 49-8b 87 e0 09 00 00 48 89 ....~..I......H.
45 90 0f b7 85 0c ff ff-ff 66 89 85 3c ff ff ff E........f..<...
49 8b 87 d0 09 00 00 8a-40 36 88 85 3a ff ff ff I.......@6..:...
49 8b 07 4c 89 ff ff 50-20 48 89 c7 e8 73 03 00 I..L...P H...s..
00 f3 0f 11 45 98 41 8a-87 f2 09 00 00 88 85 30 ....E.A........0
Which application of Transmission?
macOS app
Which version of Transmission?
Transmission-87862e506d Build #9564
The text was updated successfully, but these errors were encountered: