Skip to content
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

Crash in ASRunLoopQueue.mm line 270 #27

Closed
levi opened this issue Apr 18, 2017 · 1 comment
Closed

Crash in ASRunLoopQueue.mm line 270 #27

levi opened this issue Apr 18, 2017 · 1 comment

Comments

@levi
Copy link
Contributor

levi commented Apr 18, 2017

ASRunLoopQueue.mm line 270
-[ASRunLoopQueue processQueue]

Pinterest 1 (pinterest)
Issue #161748 (Level 1)

System: 9.3.3 (13G34) 9.3.3 (13G34) on Apple iPhone 6 (arm64)
Storage: disk 33% free (3951 MB) and memory 6% free (226 MB)
Orientation: device is portrait and UI is portrait
Session: 1011ce535ff34084b0ffef6ade2dc6ec_0d6cdab239624d62b83bce44eff6b0bd_0_v1
Timestamp: 2017-04-17T11:28:43.000Z

[Thread 0] Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000001365d788
  0 libobjc.A.dylib                6453648272 objc_msgSend + 16
  1 Foundation                     6473769012 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] + 356
  2 Foundation                     6473068480 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 64
  3 Foundation                     6473759544 _NSSetPointValueAndNotify + 284
  4 UIKit                          6552282908 -[UIScrollView(UIScrollViewInternal) _adjustContentOffsetIfNecessary] + 60
  5 UIKit                          6549898028 -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 460
  6 UIKit                          6549897504 -[UIScrollView removeFromSuperview] + 40
  7 UIKit                          6548949284 -[UIView dealloc] + 952
  8 Foundation                     6473427408 -[NSConcretePointerArray replacePointerAtIndex:withPointer:] + 192
> 9 Pinterest                      4302444428 -[ASRunLoopQueue processQueue] (ASRunLoopQueue.mm:270)
 10 CoreFoundation                 6463342376 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
 11 CoreFoundation                 6463333580 __CFRunLoopDoObservers + 372
 12 CoreFoundation                 6463334652 __CFRunLoopRun + 928
 13 CoreFoundation                 6462458960 CFRunLoopRunSpecific + 384
 14 GraphicsServices               6488572040 GSEventRunModal + 180
 15 UIKit                          6549397640 UIApplicationMain + 204
 16 Pinterest                      4295564372 main (main.m:74)
 17 libdispatch.dylib              6457862328  + 0

[Thread 1] com.apple.libdispatch-manager
  0 libsystem_kernel.dylib         6459036888 kevent_qos + 8
  1 libdispatch.dylib              6457739224 _dispatch_mgr_invoke + 232
  2 libdispatch.dylib              6457669192 _dispatch_source_invoke + 50

[Thread 2]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4

[Thread 3] com.apple.NSURLConnectionLoader
  0 libsystem_kernel.dylib         6458920920 mach_msg_trap + 8
  1 libsystem_kernel.dylib         6458920532 mach_msg + 72
  2 CoreFoundation                 6463343712 __CFRunLoopServiceMachPort + 196
  3 CoreFoundation                 6463334756 __CFRunLoopRun + 1032
  4 CoreFoundation                 6462458960 CFRunLoopRunSpecific + 384
  5 CFNetwork                      6470327244 +[NSURLConnection(Loader) _resourceLoadLoop:] + 412
  6 Foundation                     6473956940 __NSThread__start__ + 1000
  7 libsystem_pthread.dylib        6459865896 _pthread_body + 156
  8 libsystem_pthread.dylib        6459865740 _pthread_body + 154
  9 libsystem_pthread.dylib        6459854888 thread_start + 4

[Thread 4] com.twitter.crashlytics.ios.MachExceptionServer
  0 Pinterest                      4306014612 CLSProcessRecordAllThreads + 1000568
  1 Pinterest                      4306014612 CLSProcessRecordAllThreads + 1000568
  2 Pinterest                      4306014288 CLSProcessRecordAllThreads + 1000244
  3 Pinterest                      4305950736 CLSHandler + 936692
  4 Pinterest                      4305930164 CLSMachExceptionServer + 916120
  5 libsystem_pthread.dylib        6459865896 _pthread_body + 156
  6 libsystem_pthread.dylib        6459865740 _pthread_body + 154
  7 libsystem_pthread.dylib        6459854888 thread_start + 4

[Thread 5]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4

[Thread 6] com.apple.CFSocket.private
  0 libsystem_kernel.dylib         6459032388 __select + 8
  1 CoreFoundation                 6463369672 __CFSocketManager + 648
  2 libsystem_pthread.dylib        6459865896 _pthread_body + 156
  3 libsystem_pthread.dylib        6459865740 _pthread_body + 154
  4 libsystem_pthread.dylib        6459854888 thread_start + 4

[Thread 7]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4

[Thread 8] AVAudioSession Notify Thread
  0 libsystem_kernel.dylib         6458920920 mach_msg_trap + 8
  1 libsystem_kernel.dylib         6458920532 mach_msg + 72
  2 CoreFoundation                 6463343712 __CFRunLoopServiceMachPort + 196
  3 CoreFoundation                 6463334756 __CFRunLoopRun + 1032
  4 CoreFoundation                 6462458960 CFRunLoopRunSpecific + 384
  5 libAVFAudio.dylib              6570957280 GenericRunLoopThread::Entry(void*) + 164
  6 libAVFAudio.dylib              6570780508 CAPThread::Entry(CAPThread*) + 84
  7 libsystem_pthread.dylib        6459865896 _pthread_body + 156
  8 libsystem_pthread.dylib        6459865740 _pthread_body + 154
  9 libsystem_pthread.dylib        6459854888 thread_start + 4

[Thread 9] ASDeallocQueue
  0 libsystem_kernel.dylib         6458920920 mach_msg_trap + 8
  1 libsystem_kernel.dylib         6458920532 mach_msg + 72
  2 CoreFoundation                 6463343712 __CFRunLoopServiceMachPort + 196
  3 CoreFoundation                 6463334756 __CFRunLoopRun + 1032
  4 CoreFoundation                 6462458960 CFRunLoopRunSpecific + 384
  5 CoreFoundation                 6462776228 CFRunLoopRun + 112
  6 Pinterest                      4302442152 -[ASDeallocQueue threadMain] (ASRunLoopQueue.mm:99)
  7 Foundation                     6473956940 __NSThread__start__ + 1000
  8 libsystem_pthread.dylib        6459865896 _pthread_body + 156
  9 libsystem_pthread.dylib        6459865740 _pthread_body + 154
 10 libsystem_pthread.dylib        6459854888 thread_start + 4

[Thread 10]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4

[Thread 11]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4

[Thread 12] Deadlock Detection Thread
  0 libsystem_kernel.dylib         6459032604 __semwait_signal + 8
  1 libsystem_c.dylib              6458102316 nanosleep + 212
  2 Foundation                     6473954040 +[NSThread sleepForTimeInterval:] + 136
  3 Pinterest                      4295972552 +[PIDeadlockDetector detectionThreadLoop:] (PIDeadlockDetector.m:134)
  4 Foundation                     6473956940 __NSThread__start__ + 1000
  5 libsystem_pthread.dylib        6459865896 _pthread_body + 156
  6 libsystem_pthread.dylib        6459865740 _pthread_body + 154
  7 libsystem_pthread.dylib        6459854888 thread_start + 4

[Thread 13]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4

[Thread 14]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4

[Thread 15]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4

[Thread 16]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4

[Thread 17]
  0 libsystem_kernel.dylib         6459034440 __workq_kernreturn + 8
  1 libsystem_pthread.dylib        6459856176 _pthread_wqthread + 1284
  2 libsystem_pthread.dylib        6459854880 start_wqthread + 4
@Adlai-Holler
Copy link
Member

@levi It looks like someone is using KVO to observe UIScrollView.contentOffset and the scroll view is trying to send KVO notifications from inside dealloc and messaging a dangling pointer. Looking into the code a bit, it seems likely that since the object argument to FBKVOController block is strong, the mechanism is trying to retain the scroll view, which is prohibited from within dealloc.

  • Using KVO to observe UIKit properties is not supported.
  • If you have to keep doing this, ensure that the KVO observation is torn down before the scroll view enters dealloc. One workaround is to pass retainObserved:YES into FBKVOController.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants