UI becomes unresponsive (r9942)

Ask for help and report issues with the Mac OS X version of Transmission
Post Reply
stern
Posts: 61
Joined: Sat Aug 09, 2008 11:00 am

UI becomes unresponsive (r9942)

Post by stern »

When opening some torrents, Transmission starts to beachball frequently. Process samples show this is because the main thread is blocking on some torrent's lock. The torrents this happens with tend to be of the "massive list of dubious trackers" kind, so maybe some operation which holds the lock in another thread is timing out waiting for the trackers?

When this happens, all upload/download traffic will usually stop, and only happen in short bursts every now and then.

Code: Select all

Sampling process 60579 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Transmission (pid 60579) every 1 millisecond
Call graph:
    2822 Thread_797690   DispatchQueue_1: com.apple.main-thread  (serial)
      2822 start
        2822 main
          2822 NSApplicationMain
            2822 -[NSApplication run]
              2822 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
                2822 _DPSNextEvent
                  2822 BlockUntilNextEventMatchingListInMode
                    2822 ReceiveNextEventCommon
                      2822 RunCurrentEventLoopInMode
                        2822 CFRunLoopRunSpecific
                          2822 __CFRunLoopRun
                            2822 __NSFireTimer
                              2822 -[Controller updateUI]
                                2822 -[NSArray makeObjectsPerformSelector:]
                                  2822 -[Torrent update]
                                    2822 tr_torrentStat
                                      2822 tr_lockLock
                                        2822 pthread_mutex_lock
                                          2822 semaphore_wait_signal_trap
    2822 Thread_797702   DispatchQueue_2: com.apple.libdispatch-manager  (serial)
      2822 start_wqthread
        2822 _pthread_wqthread
          2822 _dispatch_worker_thread2
            2822 _dispatch_queue_invoke
              2822 _dispatch_mgr_invoke
                2821 kevent
                1 _dispatch_run_timers
    2822 Thread_797708
      2822 thread_start
        2822 _pthread_start
          2822 libeventThreadFunc
            2822 event_base_loop
              2822 onUpkeepTimer
                2822 tr_runInEventThread
                  2822 addTask
                    2822 curl_multi_add_handle
                      2822 update_timer
                        2822 tr_multi_perform
                          2822 curl_multi_socket_action
                            2822 multi_socket
                              2822 multi_runsingle
                                2822 Curl_connect
                                  2822 create_conn
                                    2822 Curl_resolv_timeout
                                      2822 Curl_resolv
                                        2822 Curl_getaddrinfo
                                          2822 Curl_getaddrinfo_ex
                                            2822 getaddrinfo
                                              2822 si_addrinfo
                                                2822 search_addrinfo
                                                  2822 _mdns_addrinfo
                                                    2822 _mdns_search
                                                      2822 _mdns_query_mDNSResponder
                                                        2822 kevent
    2822 Thread_797713
      2822 thread_start
        2822 _pthread_start
          2822 __NSThread__main__
            2822 -[UKKQueue watcherThread:]
              2822 kevent
    2822 Thread_802617
      2822 thread_start
        2822 _pthread_start
          2822 __NSThread__main__
            2822 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
              2822 CFRunLoopRunSpecific
                2822 __CFRunLoopRun
                  2822 mach_msg
                    2822 mach_msg_trap
    2822 Thread_802626
      2822 thread_start
        2822 _pthread_start
          2822 __CFSocketManager
            2822 select$DARWIN_EXTSN
    2640 Thread_824578
      2640 start_wqthread
        2639 _pthread_wqthread
          2639 __workq_kernreturn
        1 _pthread_exit
    182 Thread_824984
      182 start_wqthread
        182 _pthread_wqthread
          182 __workq_kernreturn

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        kevent        8465
        mach_msg_trap        2822
        select$DARWIN_EXTSN        2822
        semaphore_wait_signal_trap        2822
        __workq_kernreturn        2821
Sample analysis of process 60579 written to file /dev/stdout

Code: Select all

Sampling process 60579 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Transmission (pid 60579) every 1 millisecond
Call graph:
    2768 Thread_797690   DispatchQueue_1: com.apple.main-thread  (serial)
      2768 start
        2768 main
          2768 NSApplicationMain
            2768 -[NSApplication run]
              2768 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
                2768 _DPSNextEvent
                  2768 BlockUntilNextEventMatchingListInMode
                    2768 ReceiveNextEventCommon
                      2768 RunCurrentEventLoopInMode
                        2768 CFRunLoopRunSpecific
                          2768 __CFRunLoopRun
                            2768 __NSFireTimer
                              2768 -[Controller updateUI]
                                2768 -[NSArray makeObjectsPerformSelector:]
                                  2768 -[Torrent update]
                                    2768 tr_torrentStat
                                      2768 tr_lockLock
                                        2768 pthread_mutex_lock
                                          2768 semaphore_wait_signal_trap
    2768 Thread_797702   DispatchQueue_2: com.apple.libdispatch-manager  (serial)
      2768 start_wqthread
        2768 _pthread_wqthread
          2768 _dispatch_worker_thread2
            2768 _dispatch_queue_invoke
              2768 _dispatch_mgr_invoke
                2768 kevent
    2768 Thread_797708
      2768 thread_start
        2768 _pthread_start
          2768 libeventThreadFunc
            2768 event_base_loop
              2768 onUpkeepTimer
                2768 tr_runInEventThread
                  2768 addTask
                    2768 curl_multi_add_handle
                      2768 update_timer
                        2768 tr_multi_perform
                          2768 curl_multi_socket_action
                            2768 multi_socket
                              2768 multi_runsingle
                                2768 Curl_connect
                                  2768 create_conn
                                    2768 Curl_resolv_timeout
                                      2768 Curl_resolv
                                        2768 Curl_getaddrinfo
                                          2768 Curl_getaddrinfo_ex
                                            2768 getaddrinfo
                                              2768 si_addrinfo
                                                2768 search_addrinfo
                                                  2768 _mdns_addrinfo
                                                    2768 _mdns_search
                                                      2768 _mdns_query_mDNSResponder
                                                        2768 kevent
    2768 Thread_797713
      2768 thread_start
        2768 _pthread_start
          2768 __NSThread__main__
            2768 -[UKKQueue watcherThread:]
              2768 kevent
    2768 Thread_802617
      2768 thread_start
        2768 _pthread_start
          2768 __NSThread__main__
            2768 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
              2768 CFRunLoopRunSpecific
                2768 __CFRunLoopRun
                  2768 mach_msg
                    2768 mach_msg_trap
    2768 Thread_802626
      2768 thread_start
        2768 _pthread_start
          2768 __CFSocketManager
            2768 select$DARWIN_EXTSN
    2768 Thread_824326
      2768 thread_start
        2768 _pthread_start
          2768 __NSThread__main__
            2768 -[NSUIHeartBeat _heartBeatThread:]
              2669 usleep
                2663 nanosleep
                  2663 __semwait_signal
                6 cerror
              88 -[NSWindow(NSWindow_Theme) heartBeat:]
                87 -[NSButtonCell(NSDefaultButtonIndicatorPrivate) heartBeat:]
                  77 -[NSView _lightWeightRecursiveDisplayInRect:]
                    57 CFArrayApplyFunction
                      57 _lightWeightRecursiveDisplayInRect2
                        57 -[NSView _lightWeightRecursiveDisplayInRect:]
                          54 CFArrayApplyFunction
                            54 _lightWeightRecursiveDisplayInRect2
                              52 -[NSView _lightWeightRecursiveDisplayInRect:]
                                46 -[NSView _drawRect:clip:]
                                  44 -[NSControl drawRect:]
                                    43 -[NSButtonCell drawWithFrame:inView:]
                                      33 CUIRenderer::Draw(CGRect, CGContext*, __CFDictionary const*, __CFDictionary const**)
                                        30 CUIRenderer::DrawPushButton(CUIDescriptor const*)
                                          23 CGContextDrawImages
                                            23 ripc_DrawImages
                                              22 ripc_RenderImage
                                                22 ripl_BltImage
                                                  21 ripl_Mark
                                                    21 argb32_image
                                                      19 argb32_image_mark
                                                        10 argb32_image_mark
                                                        6 argb32_sample_argb32
                                                        3 argb32_sample_ARGB32
                                                      2 argb32_image_mark_RGB32
                                                  1 ripd_Mark
                                                    1 argb32_image
                                                      1 CGSBlendABGR8888toRGBA8888
                                                        1 sseCGSBlendXXXX8888Transpose
                                              1 ripc_AcquireImage
                                                1 CGSImageDataHandleLock
                                          5 CGContextEndTransparencyLayer
                                            5 ripc_EndLayer
                                              5 ripc_RenderImage
                                                5 ripl_BltImage
                                                  5 ripd_Mark
                                                    5 argb32_image
                                                      5 CGSBlendRGBA8888toRGBA8888
                                                        5 sseCGSBlendXXXX8888
                                          1 CGContextBeginTransparencyLayerWithRect
                                            1 ripc_BeginLayer
                                              1 ripc_GetRenderingState
                                                1 ripc_GetClipState
                                          1 PreparePushButtonInstructions(_QSIContext*, CUIDescriptor const*, CUIElement&, CUIElement&, CGImage**, CGRect*, CGRect*, double*, CGRect*, CGSize*)
                                            1 CGImageGetHeight
                                        2 CUIRenderer::DecodeToCUIInfo(CGRect, CGContext*, __CFDictionary const*, CUIInfo*)
                                          2 CFDictionaryGetValue
                                            2 CFBasicHashFindBucket
                                              2 ___CFBasicHashFindBucket1
                                                1 CFHash
                                                1 __CFBasicHashStandardCallback
                                                  1 CFEqual
                                        1 CGContextSaveGState
                                          1 CGGStackSave
                                            1 CGGStateCreateCopy
                                              1 calloc
                                                1 malloc_zone_calloc
                                                  1 szone_malloc_should_clear
                                                    1 memset
                                      8 -[NSButtonCell drawInteriorWithFrame:inView:]
                                        8 -[NSButtonCell _configureAndDrawTitleWithRect:cellFrame:controlView:]
                                          3 CGContextDrawImage
                                            3 ripc_DrawImage
                                              1 free
                                              1 ripc_AcquireImage
                                                1 CGSImageDataLock
                                                  1 img_data_lock
                                                    1 malloc
                                              1 ripc_RenderImage
                                                1 ripl_BltImage
                                                  1 ripd_Mark
                                                    1 argb32_image
                                                      1 argb32_mark
                                                        1 argb32_mark_pixelshape
                                          2 -[NSButtonCell titleRectForBounds:]
                                            2 -[NSCell _unformattedAttributedStringValue:]
                                              2 -[NSConcreteAttributedString initWithString:attributes:]
                                                1 __spin_lock
                                                1 objc_msgSend_vtable7
                                          2 -[NSCell _unformattedAttributedStringValue:]
                                            2 -[NSConcreteAttributedString initWithString:attributes:]
                                              2 +[NSAttributeDictionary newWithDictionary:]
                                                2 -[NSConcreteHashTable getItem:]
                                                  2 hashProbe
                                                    1 attributeDictionaryHash
                                                      1 objc_msgSend
                                                    1 attributeDictionaryIsEqual
                                                      1 -[NSAttributeDictionary isEqualToDictionary:]
                                                        1 objc_msgSend_vtable9
                                          1 -[NSSnapshotContextSignature isApplicableForRect:context:hints:]
                                            1 NSImageColorSpaceForReferenceContext_hints_
                                              1 CGColorTransformGetColorSpace
                                                1 pthread_mutex_lock
                                      2 -[NSButtonCell drawBezelWithFrame:inView:]
                                        2 -[NSButtonCell _coreUIBezelDrawOptionsWithFrame:inView:]
                                          1 +[NSNumber numberWithDouble:]
                                            1 -[NSPlaceholderNumber initWithDouble:]
                                              1 CFNumberCreate
                                                1 _CFRuntimeCreateInstance
                                          1 CFDictionarySetValue
                                            1 CFBasicHashSetValue
                                              1 __CFBasicHashAddValue
                                                1 __CFBasicHashRehash
                                                  1 ___CFBasicHashFindBucket1
                                    1 -[NSControl _shouldShowFirstResponderForCell:]
                                      1 -[NSControl _findCurrentEditor]
                                  1 -[NSView convertRect:toView:]
                                    1 objc_msgSend
                                  1 CGSNewRegionWithRect
                                    1 shape_alloc_bounds
                                2 -[NSView lockFocusIfCanDraw]
                                  2 -[NSFocusStack focusView:inWindow:]
                                    2 objc_addExceptionHandler
                                      2 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
                                        1 __bzero
                                        1 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::setInfoBasedOnIPRegister(bool)
                                          1 _dyld_find_unwind_sections
                                            1 client_dyld_find_unwind_sections(void*, dyld_unwind_sections*)
                                              1 dyld::findImageContainingAddress(void const*)
                                2 -[NSView unlockFocus]
                                  2 -[NSFocusStack popTopView]
                                    2 +[NSGraphicsContext restoreGraphicsState]
                                      1 -[NSObject(NSObject) retain]
                                        1 __CFDoExternRefOperation
                                          1 CFBasicHashAddValue
                                            1 ___CFBasicHashFindBucket1
                                      1 CFArrayGetCount
                                1 -[NSWindow release]
                                  1 NSDecrementExtraRefCountWasZero
                                    1 __CFDoExternRefOperation
                                      1 CFBasicHashRemoveValue
                                1 objc_msgSend
                              1 -[NSConcreteMapTable setObject:forKey:]
                                1 objc_msgSend
                              1 objc_msgSend_vtable1
                          2 -[NSView lockFocusIfCanDraw]
                            1 -[NSFocusState flush]
                              1 CGContextClipToRect
                                1 CGGStateClipToRect
                                  1 CGRectApplyAffineTransform
                            1 -[NSView canDraw]
                          1 -[NSView _drawRect:clip:]
                            1 CGContextClipToRects
                              1 CGContextClipToRect
                                1 CGGStateClipToRect
                                  1 CGClipStackAddRect
                                    1 CGRectIntersection
                    13 -[NSView _drawRect:clip:]
                      7 -[NSThemeFrame drawRect:]
                        7 -[NSFrameView drawThemeContentFill:inView:]
                          7 -[NSThemeFrame drawWindowBackgroundRect:]
                            6 NSDrawWindowBackground
                              5 NSRectFillUsingOperation
                                5 CGContextFillRect
                                  5 CGContextFillRects
                                    5 ripc_DrawRects
                                      5 ripc_Render
                                        5 ripl_BltShape
                                          3 ripd_Lock
                                            3 CGSDeviceLock
                                              3 _CGSLockWindow
                                                3 _CGSSynchronizeWindowBackingStore
                                                  3 mach_msg
                                                    3 mach_msg_trap
                                          1 CGSDeviceUnlock
                                            1 _CGSUnlockWindow
                                          1 argb32_mark
                                            1 argb32_mark_constshape
                              1 CGGStateSetCompositeOperation
                            1 objc_msgSend
                      4 -[NSThemeFrame _regionForOpaqueDescendants:forMove:]
                        4 -[NSView _regionForOpaqueDescendants:forMove:]
                          3 -[NSView _regionForOpaqueDescendants:forMove:]
                            1 -[NSView isRotatedFromBase]
                            1 NSIsEmptyRect
                            1 objc_msgSend_stret
                          1 -[NSView isRotatedFromBase]
                      1 -[NSView _liveResizeCachedImageIsValid]
                      1 CGSNewRegionWithRect
                        1 shape_alloc_bounds
                          1 malloc_zone_malloc
                            1 szone_malloc_should_clear
                    6 -[NSView lockFocusIfCanDraw]
                      3 -[NSFocusState flush]
                        1 -[NSWindow _windowDeviceRound]
                          1 -[NSWindow _threadContext]
                            1 +[NSUIHeartBeat isHeartBeatThread]
                              1 _NSThreadGet0
                                1 CFDictionaryGetValue
                                  1 CFBasicHashFindBucket
                                    1 ___CFBasicHashFindBucket1
                        1 CGGStateReset
                          1 strokeStateReset
                        1 _CFRelease
                      2 -[NSFocusStack focusView:inWindow:]
                        2 objc_addExceptionHandler
                          1 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
                            1 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::setInfoBasedOnIPRegister(bool)
                              1 _dyld_find_unwind_sections
                                1 client_dyld_find_unwind_sections(void*, dyld_unwind_sections*)
                                  1 dyld::findImageContainingAddress(void const*)
                          1 unw_init_local
                            1 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::setInfoBasedOnIPRegister(bool)
                              1 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::getInfoFromCompactEncodingSection(unsigned long long, unsigned long long, unsigned long long)
                      1 -[NSView _focusFromView:withContext:]
                        1 -[NSView _gatherFocusStateInto:upTo:withContext:]
                          1 -[NSView _focusInto:withClip:]
                            1 -[NSFocusState clip:]
                              1 -[NSPSMatrix transformRect:]
                    1 _NSLessCoalescedViewDrawing
                  4 -[NSView lockFocusIfCanDraw]
                    3 -[NSFocusState flush]
                      1 -[NSFocusState reset]
                        1 _CFRelease
                          1 __CFArrayReleaseValues
                            1 objc_msgSend
                      1 -[NSWindow _windowDeviceRound]
                        1 CGContextResetClip
                      1 CGContextClipToRect
                        1 CGGStateClipToRect
                    1 -[NSView _focusFromView:withContext:]
                      1 +[NSFocusState sharedFocusState]
                        1 objc_msgSend
                  3 -[_NSDisplayOperationStack exitDisplayOperationForWindow:]
                    3 _CFArrayReplaceValues
                      3 __CFArrayReleaseValues
                        3 -[_NSDisplayOperation dealloc]
                          2 -[NSConcreteMapTable dealloc]
                            1 -[NSConcreteMapTable dealloc]
                            1 dealloc
                              1 empty
                                1 -[NSRectSet dealloc]
                          1 -[NSObject(NSObject) release]
                            1 __CFDoExternRefOperation
                              1 CFBasicHashRemoveValue
                                1 ___CFBasicHashFindBucket1
                  2 -[_NSDisplayOperationStack enterDisplayOperationForWindow:windowRegion:]
                    1 -[NSCFArray insertObject:atIndex:]
                      1 _CFArrayReplaceValues
                    1 -[NSCountedSet addObject:]
                      1 CFDictionarySetValue
                        1 CFBasicHashSetValue
                          1 __CFBasicHashAddValue
                  1 -[NSButton _focusRingBleedRegion]
                1 NSIsEmptyRect
              6 _CFAutoreleasePoolPop
                2 -[NSConcreteAttributedString dealloc]
                  1 -[NSObject(NSObject) release]
                    1 __CFDoExternRefOperation
                      1 CFBasicHashRemoveValue
                        1 ___CFBasicHashFindBucket1
                  1 -[NSRLEArray dealloc]
                    1 -[NSAttributeDictionary release]
                1 -[NSConcreteMutableData dealloc]
                  1 -[NSObject(NSObject) dealloc]
                    1 _internal_object_dispose
                      1 szone_free_definite_size
                1 -[NSObject(NSObject) release]
                  1 __CFDoExternRefOperation
                    1 CFBasicHashRemoveValue
                      1 ___CFBasicHashFindBucket1
                1 -[NSWindow release]
                  1 NSDecrementExtraRefCountWasZero
                1 _CFRelease
                  1 objc_removeAssociatedObjects
                    1 _class_instancesHaveAssociatedObjects
              3 -[NSSet makeObjectsPerformSelector:]
                3 -[NSWindow flushWindow]
                  2 ripc_Operation
                    2 CGSDeviceSynchronize
                      2 _CGSFlushRegionInline
                        1 _CGSFlushRegionInline
                        1 mach_msg
                          1 mach_msg_trap
                  1 objc_msgSend
              1 -[NSApplication _keyWindowForHeartBeat]
                1 objc_msgSend_vtable13
              1 objc_msgSend
    2768 Thread_824327
      2768 start_wqthread
        2768 _pthread_wqthread
          2768 __workq_kernreturn

Total number in stack (recursive counted multiple, when >=5):
        9       objc_msgSend
        7       ___CFBasicHashFindBucket1
        5       __CFDoExternRefOperation
        5       _pthread_start
        5       thread_start

Sort by top of stack, same collapsed (when >= 5):
        kevent        8304
        mach_msg_trap        2772
        __workq_kernreturn        2768
        select$DARWIN_EXTSN        2768
        semaphore_wait_signal_trap        2768
        __semwait_signal        2663
        argb32_image_mark        10
        objc_msgSend        9
        ___CFBasicHashFindBucket1        6
        argb32_sample_argb32        6
        cerror        6
        sseCGSBlendXXXX8888        5
Sample analysis of process 60579 written to file /dev/stdout

Code: Select all

Sampling process 60579 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Transmission (pid 60579) every 1 millisecond
Call graph:
    2746 Thread_797690   DispatchQueue_1: com.apple.main-thread  (serial)
      2746 start
        2746 main
          2746 NSApplicationMain
            2746 -[NSApplication run]
              2746 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
                2746 _DPSNextEvent
                  2746 BlockUntilNextEventMatchingListInMode
                    2746 ReceiveNextEventCommon
                      2746 RunCurrentEventLoopInMode
                        2746 CFRunLoopRunSpecific
                          2746 __CFRunLoopRun
                            2746 __NSFireTimer
                              2746 -[Controller updateUI]
                                2746 -[NSArray makeObjectsPerformSelector:]
                                  2746 -[Torrent update]
                                    2746 tr_torrentStat
                                      2746 tr_lockLock
                                        2746 pthread_mutex_lock
                                          2746 semaphore_wait_signal_trap
    2746 Thread_797702   DispatchQueue_2: com.apple.libdispatch-manager  (serial)
      2746 start_wqthread
        2746 _pthread_wqthread
          2746 _dispatch_worker_thread2
            2746 _dispatch_queue_invoke
              2746 _dispatch_mgr_invoke
                2746 kevent
    2746 Thread_797708
      2746 thread_start
        2746 _pthread_start
          2746 libeventThreadFunc
            2746 event_base_loop
              2746 bandwidthPulse
                2746 peerPulse
                  2746 readOrWritePiece
                    2746 tr_fdFileCheckout
                      2746 TrCloseFile
                        2746 close
    2746 Thread_797713
      2746 thread_start
        2746 _pthread_start
          2746 __NSThread__main__
            2746 -[UKKQueue watcherThread:]
              2746 kevent
    2746 Thread_802617
      2746 thread_start
        2746 _pthread_start
          2746 __NSThread__main__
            2746 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
              2746 CFRunLoopRunSpecific
                2746 __CFRunLoopRun
                  2746 mach_msg
                    2746 mach_msg_trap
    2746 Thread_802626
      2746 thread_start
        2746 _pthread_start
          2746 __CFSocketManager
            2746 select$DARWIN_EXTSN
    2746 Thread_823234
      2746 start_wqthread
        2746 _pthread_wqthread
          2746 __workq_kernreturn

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        kevent        5492
        __workq_kernreturn        2746
        close        2746
        mach_msg_trap        2746
        select$DARWIN_EXTSN        2746
        semaphore_wait_signal_trap        2746
Sample analysis of process 60579 written to file /dev/stdout
livings124
Transmission Developer
Posts: 3142
Joined: Fri Jan 13, 2006 8:08 pm

Re: UI becomes unresponsive (r9942)

Post by livings124 »

This should hopefully fixed in r9947 and later. Can you give it a try and report back, good or bad? http://transmission.xpjets.com/
stern
Posts: 61
Joined: Sat Aug 09, 2008 11:00 am

Re: UI becomes unresponsive (r9942)

Post by stern »

Tested with r9950, no change. I don't think the beachballing is a problem in libevent, but rather an architectural one in that the main thread is allowed to block on network access which does not have a guaranteed response time.

Code: Select all

Call graph:
    5822 Thread_833952   DispatchQueue_1: com.apple.main-thread  (serial)
      5822 start
        5822 main
          5822 NSApplicationMain
            5822 -[NSApplication run]
              5822 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
                5822 _DPSNextEvent
                  5822 BlockUntilNextEventMatchingListInMode
                    5822 ReceiveNextEventCommon
                      5822 RunCurrentEventLoopInMode
                        5822 CFRunLoopRunSpecific
                          5822 __CFRunLoopRun
                            5822 __NSFireTimer
                              5822 -[Controller updateUI]
                                5822 -[NSArray makeObjectsPerformSelector:]
                                  5822 -[Torrent update]
                                    5822 tr_torrentStat
                                      5822 tr_lockLock
                                        5822 pthread_mutex_lock
                                          5822 semaphore_wait_signal_trap
    5822 Thread_833963   DispatchQueue_2: com.apple.libdispatch-manager  (serial)
      5822 start_wqthread
        5822 _pthread_wqthread
          5822 _dispatch_worker_thread2
            5822 _dispatch_queue_invoke
              5822 _dispatch_mgr_invoke
                5822 kevent
    5822 Thread_833968
      5822 thread_start
        5822 _pthread_start
          5822 libeventThreadFunc
            5822 event_base_loop
              5822 onUpkeepTimer
                5822 tr_runInEventThread
                  5822 addTask
                    5822 curl_multi_add_handle
                      5822 update_timer
                        5822 tr_multi_perform
                          5822 curl_multi_socket_action
                            5822 multi_socket
                              5822 multi_runsingle
                                5822 Curl_connect
                                  5822 create_conn
                                    5822 Curl_resolv_timeout
                                      5822 Curl_resolv
                                        5822 Curl_getaddrinfo
                                          5822 Curl_getaddrinfo_ex
                                            5822 getaddrinfo
                                              5822 si_addrinfo
                                                5822 search_addrinfo
                                                  5822 _mdns_addrinfo
                                                    5822 _mdns_search
                                                      5822 _mdns_query_mDNSResponder
                                                        5822 kevent
    5822 Thread_833969
      5822 thread_start
        5822 _pthread_start
          5822 dht_bootstrap
            5822 bootstrap_done
              5822 bootstrap_done
                5822 tr_dhtStatus
                  5822 usleep
                    5821 nanosleep
                      5821 __semwait_signal
                    1 cerror
                      1 cthread_set_errno_self
                        1 __error
    5822 Thread_833976
      5822 thread_start
        5822 _pthread_start
          5822 __NSThread__main__
            5822 -[UKKQueue watcherThread:]
              5822 kevent
    5822 Thread_834577
      5822 thread_start
        5822 _pthread_start
          5822 __NSThread__main__
            5822 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
              5822 CFRunLoopRunSpecific
                5822 __CFRunLoopRun
                  5822 mach_msg
                    5822 mach_msg_trap
    5822 Thread_834583
      5822 start_wqthread
        5822 _pthread_wqthread
          5822 __workq_kernreturn
    5822 Thread_834591
      5822 thread_start
        5822 _pthread_start
          5822 __CFSocketManager
            5822 select$DARWIN_EXTSN
    2555 Thread_834667
      2555 thread_start
        2555 _pthread_start
          2555 si_async_launchpad
            2555 si_addrinfo
              2555 search_addrinfo
                2555 _mdns_addrinfo
                  2555 _mdns_search
                    2555 _mdns_query_mDNSResponder
                      2555 kevent
    2176 Thread_834641
      2176 thread_start
        2176 _pthread_start
          2176 si_async_launchpad
            2176 si_addrinfo
              2176 search_addrinfo
                2176 _mdns_addrinfo
                  2176 _mdns_search
                    2176 _mdns_query_mDNSResponder
                      2176 kevent

Total number in stack (recursive counted multiple, when >=5):
        7       _pthread_start
        7       thread_start
        5       kevent

Sort by top of stack, same collapsed (when >= 5):
        kevent        22197
        __workq_kernreturn        5822
        mach_msg_trap        5822
        select$DARWIN_EXTSN        5822
        semaphore_wait_signal_trap        5822
        __semwait_signal        5821
Post Reply