SIGSEGV(Bad Memory Access) error while profiling in Instruments


SIGSEGV(Bad Memory Access) error while profiling in Instruments



I'm trying to catch memory leak and retain cycles with Leak Profiler in Instruments tool. However, whenever I click the record button in Instruments, app looks like to start then crash. If I open the app from Xcode and transfer it to Instruments, App crash after I click any of the UIButton. If I open app from Simulator, I can get the second screen but then It also crashes. In addition, App doesn't show any leak in memory graph and also doesn't crash on normal usage.


UIButton



Here is the crash log;



Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000018 VM Region Info: 0x18 is not
in any region. Bytes before following region: 4377985000
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 0000000104f2c000-0000000104fbc000 [ 576K] r-x/r-x SM=COW ...ti App Test]



Termination Signal: Segmentation fault: 11 Termination Reason:
Namespace SIGNAL, Code 0xb Terminating Process: exc handler [0]
Triggered by Thread: 0



Filtered syslog: None found



Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0
Crashed: 0 libswiftCore.dylib 0x000000010597b2b4
0x1058cc000 + 717492 1 libswiftCore.dylib
0x000000010598823c 0x1058cc000 + 770620 2 UIFoundation
0x000000018f01fbdc attributeDictionaryHash + 460 3 Foundation
0x0000000185417edc hashProbe + 72 4 Foundation
0x0000000185417e7c -[NSConcreteHashTable getItem:] + 40 5
UIFoundation 0x000000018f01fd54
+[NSAttributeDictionary newWithDictionary:] + 136 6 Foundation 0x000000018542666c -[NSConcreteAttributedString
initWithString:attributes:] + 124 7 My App Test
0x0000000104fbb894 0x104f2c000 + 587924 8 My App Test
0x0000000104fba588 0x104f2c000 + 583048 9 My App Test
0x0000000104fba494 0x104f2c000 + 582804 10 My App Test
0x0000000104fb9964 0x104f2c000 + 579940 11 My App Test
0x0000000104fb9830 0x104f2c000 + 579632 12 My App Test
0x0000000104fcb608 0x104f2c000 + 652808 13 My App Test
0x0000000104fccea4 0x104f2c000 + 659108 14 My App Test
0x0000000104fcc50c 0x104f2c000 + 656652 15 My App Test
0x0000000104fcc5a0 0x104f2c000 + 656800 16 UIKit
0x000000018df36bfc -[UIViewController loadViewIfRequired] + 1040 17
UIKit 0x000000018df367d4 -[UIViewController
view] + 28 18 My App Test 0x0000000104f85b6c 0x104f2c000
+ 367468 19 My App Test 0x0000000104f85470 0x104f2c000 + 365680 20 My App Test 0x0000000104f85688 0x104f2c000 +
366216 21 UIKit 0x000000018df6b20c
-[UIApplication sendAction:to:from:forEvent:] + 96 22 UIKit 0x000000018df6b18c -[UIControl sendAction:to:forEvent:] + 80 23
UIKit 0x000000018df55f4c -[UIControl
_sendActionsForEvents:withEvent:] + 440 24 UIKit 0x000000018df6aa80 -[UIControl touchesEnded:withEvent:] + 576 25
UIKit 0x000000018df6a5a0 -[UIWindow
_sendTouchesForEvent:] + 2544 26 UIKit 0x000000018df65a70 -[UIWindow sendEvent:] + 3208 27 UIKit
0x000000018df37078 -[UIApplication sendEvent:] + 340 28 UIKit
0x000000018e876f98 dispatchPreprocessedEventFromEventQueue + 2364
29 UIKit 0x000000018e879408
__handleEventQueueInternal + 4760 30 UIKit 0x000000018e872574 __handleHIDEventFetcherDrain + 152 31
CoreFoundation 0x0000000184ad0358
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
+ 24 32 CoreFoundation 0x0000000184ad02d8 __CFRunLoopDoSource0
+ 88 33 CoreFoundation 0x0000000184acfb60 __CFRunLoopDoSources0 + 204 34 CoreFoundation 0x0000000184acd738 __CFRunLoopRun + 1048 35 CoreFoundation
0x00000001849ee2d8 CFRunLoopRunSpecific + 436 36 GraphicsServices
0x000000018687ff84 GSEventRunModal + 100 37 UIKit
0x000000018df9a880 UIApplicationMain + 208 38 My App Test
0x0000000104f97854 0x104f2c000 + 440404 39 libdyld.dylib
0x000000018451256c start + 4



Thread 1: 0 libsystem_kernel.dylib 0x0000000184641dbc
__workq_kernreturn + 8 1 libsystem_pthread.dylib 0x0000000184753144 _pthread_wqthread + 1288 2
libsystem_pthread.dylib 0x0000000184752c30 start_wqthread + 4



Thread 2: 0 libsystem_pthread.dylib 0x0000000184752c2c
start_wqthread + 0



Thread 3 name: com.apple.uikit.eventfetch-thread Thread 3: 0
libsystem_kernel.dylib 0x0000000184620bc4 mach_msg_trap + 8 1
libsystem_kernel.dylib 0x0000000184620a3c mach_msg + 72 2
CoreFoundation 0x0000000184acfce4
CFRunLoopServiceMachPort + 196 3 CoreFoundation 0x0000000184acd8b0 __CFRunLoopRun + 1424 4 CoreFoundation
0x00000001849ee2d8 CFRunLoopRunSpecific + 436 5 Foundation
0x00000001854166e4 -[NSRunLoop+ 50916 (NSRunLoop)
runMode:beforeDate:] + 304 6 Foundation
0x0000000185435afc -[NSRunLoop+ 178940 (NSRunLoop) runUntilDate:] +
96 7 UIKit 0x000000018eae602c
-[UIEventFetcher threadMain] + 136 8 Foundation 0x0000000185517860 __NSThread__start
+ 996 9
libsystem_pthread.dylib 0x000000018475432c _pthread_body + 308
10 libsystem_pthread.dylib 0x00000001847541f8 _pthread_body +
0 11 libsystem_pthread.dylib 0x0000000184752c38 thread_start +
4



Thread 4: 0 libsystem_pthread.dylib 0x0000000184752c2c
start_wqthread + 0



Thread 5 name: com.apple.NSURLConnectionLoader Thread 5: 0
libsystem_kernel.dylib 0x0000000184620bc4 mach_msg_trap + 8 1
libsystem_kernel.dylib 0x0000000184620a3c mach_msg + 72 2
CoreFoundation 0x0000000184acfce4
CFRunLoopServiceMachPort + 196 3 CoreFoundation 0x0000000184acd8b0 __CFRunLoopRun + 1424 4 CoreFoundation
0x00000001849ee2d8 CFRunLoopRunSpecific + 436 5 CFNetwork
0x0000000185157b40 +[NSURLConnection+ 715584 (Loader)
_resourceLoadLoop:] + 404 6 Foundation 0x0000000185517860 __NSThread__start
+ 996 7
libsystem_pthread.dylib 0x000000018475432c _pthread_body + 308
8 libsystem_pthread.dylib 0x00000001847541f8 _pthread_body +
0 9 libsystem_pthread.dylib 0x0000000184752c38 thread_start +
4



Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x00000001c4227ac0 x1: 0x000000018eca2db2 x2: 0x000000016aecf908 x3: 0x0000000000000000
x4: 0x0000000000000000 x5: 0x0000000000000020 x6: 0x0000000185426654 x7: 0x0000000000000130
x8: 0x0000000000000000 x9: 0x0000000000000000 x10: 0x0119490101194980 x11: 0x0000000001194901 x12: 0x0000000001194800
x13: 0x0000000000000001 x14: 0x0000000000000000 x15:
0x01194901011949c0 x16: 0x0000000000000000 x17: 0x0000000105988228
x18: 0x0000000000000000 x19: 0x00000001c4227ac0 x20:
0x00000001c4227ac0 x21: 0x00000001b5421000 x22: 0x00000001c0124f60
x23: 0x0000000000000000 x24: 0x00000001c0200730 x25:
0x0000000000000000 x26: 0x000000018eca3f46 x27: 0x00000001b3bca000
x28: 0x00000001c04578e0 fp: 0x000000016aecf4f0 lr:
0x000000010598823c
sp: 0x000000016aecf4e0 pc: 0x000000010597b2b4 cpsr: 0x20000000



I was searching this for a month and I'm not sure If It is a Instruments bug. I checked below posts;



Xcode Instruments: Leaks - App crashes on launch



Instruments crashing while using Leaks instrument



xcode instruments causing app crash



Looking for an answer drawing from credible and/or official sources.



I'm waiting for an answer which will explain why I'm getting this error and Is it related with Instruments tool? In addition, why Instruments crash on leak checks and how can I solve it?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

List of Kim Possible characters

Audio Livestreaming with Python & Flask

NSwag: Generate C# Client from multiple Versions of an API