I have a build of my app that only crashes when running instruments. The repro case is 100%, but does not crash when running a release build without instruments nor when running a debug build. As Instruments runs a release build I can;t step through and figure out exactly what is crashing. When the build crashes, it does so silently, with no output that I can find. It only crashes with Allocations running in instruments.
I am having difficulty tracking down what is happening, Is there an instruments mode I am not aware of that will trap this error and report the specifics to me?
I have read similar questions on Stackoverflow but those questions have not helped me.
The crash acts like a zombie, but only happens when instruments are running, and 'zombie detection enabled' doesn't indicate a zombie.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
CoreSimulator 209.19 - Device: iPad Air 2 - Runtime: iOS 9.3 (13E230) - DeviceType: iPad Air 2
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libswiftCore.dylib 0x0000000109f03dc0 swift_retainCount + 0
1 liboainject.dylib 0x000000010335d223 oa_swift_tryRetain + 297
2 libswiftCore.dylib 0x0000000109f14d69 -[SwiftObject retainWeakReference] + 9
3 libobjc.A.dylib 0x00000001098b8b6b weak_read_no_lock + 89
4 libobjc.A.dylib 0x00000001098b94c6 objc_loadWeakRetained + 104
5 libobjc.A.dylib 0x00000001098b94f2 objc_loadWeak + 15
6 com.apple.Foundation 0x0000000108da975c empty + 35
7 com.apple.Foundation 0x0000000108da96fa -[NSConcreteHashTable dealloc] + 46
8 libobjc.A.dylib 0x00000001098b9afe objc_object::sidetable_release(bool) + 232
9 liboainject.dylib 0x000000010335c6e9 ___swapMethods_block_invoke_4 + 272 ````
It happens the same things to me on Xcode 9 using the iOS 10 simulator, default is iOS 11 simulator but I wanted to test also on iOS 10.
So far so bad, any instrument manipulation is causing my application to crash with almost the same backtrace than the one shown here when using iOS 10 simulator.
I tried many things and at last I thought that there may be some incompatibility of Xcode 9 Instrument with older simulator SDK.
So I switched to the iOS11 simulator which is the default one on Xcode 9 and it solve my Instruments issue.
I'm now able to use instrument for memory investigation on my app.
Related
I am working on an iPhone app which already has approx thousands of active users across globe. The app already has crashlytics integrated.
Previously the app has CoreData related issues, which used to get reported on crashlytics and those issues state that the crash occurred in CoreData related class. But recently I am getting a frequent crash from a user who has iPhone Xs Max. The error does not have much detail, which could be helpful. The crash shows this stack
0 libsystem_platform.dylib 0x1b3bdbf64 os_unfair_lock_lock + 16
1 CoreFoundation 0x1b3da9bc4 -[__NSDictionaryM
dealloc] + 76 2 (Missing) 0x7c1b7c81b3c0a400
(Missing) 3 (Missing) 0x0 (Missing) 4 (Missing)
0x0 (Missing)
The log shows around 500mb of free ram.
The Crash log looks like this
I've tried in every way but couldn't find the issue.
I have many phones but not iPhone Xs Max. All tests go bug free and crash free.
Please Let me know if anyone of you observing same thing in latest iPhones and have found any solution.
I have started getting huge number of the crash reported from Fabric for my iOS application which is already distributed on the App Store. Crashes are started reporting from 18 Sep onwards for iOS 13 only. Here is the crash log for the main thread which is getting crashed.
Crashed: com.apple.main-thread
0 CoreFoundation 0x185180408 OUTLINED_FUNCTION_0 + 4
1 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
2 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
3 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
4 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
5 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
6 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
7 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
8 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
9 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
10 CoreFoundation 0x18525bd68 __CFStringCollectionCopy.cold.1 + 14
Anyone facing a similar crash? How can I get rid of this issue?
My app has same situation.
After I change data protection to "Complete until first user authentication", my app is no more crash about it.
As par Alex's solution,
It seems that the dyld3 saves the generated clojure files in the app
tmp directory and if you use NSFileProtectionComplete the closure
files have this property too.
To generate a crahs close the app, lock the phone, send a push that
will wake up the app and then the crash is generated.
The solution seems to be simple, just change the permissions for the
app tmp direcptry to
NSFileProtectionCompleteUntilFirstUserAuthentication and the app will
not crash. I really don't know why apple did this.
This worked for me.
Reproduction & Test
Rayns comments
You don't necessarily need to use push notifications to reproduce the
issue. If your app is configured to use complete file protection in
the entitlements, any code that runs while protected data is
unavailable will cause the app to crash. For example, my company's app
has a background task that takes longer than 10 seconds to execute.
Since protected data becomes unavailable around 10 seconds after
locking the device, the app will crash before the background task can
finish executing (despite having more time available on the
assertion).
My app crash on start up, on splash screen. After it crashes, double click home button, and I find that it is in "app gallery", just like as if it went to the background. Click it, splash window came again and this time, it launch normally. This very strange.
I've got the crash log, but I lost the dSYM file for some reason, so I can't exactly locate the bug. The crash log is just like this:
(yes, only one thread in crash log; there should be many in fact.)
0 CoreFoundation 0x0000000182538f60 <redacted> + 148
1 libobjc.A.dylib 0x0000000197087f80 objc_exception_throw + 56
2 CoreFoundation 0x0000000182538e90 <redacted> + 0
3 stockmap-ios 0x00000001005d6fc4 stockmap-ios + 5156804
4 libsystem_platform.dylib 0x0000000197ab593c _sigtramp + 52
5 stockmap-ios 0x00000001003fa7ec stockmap-ios + 3205100
Another thing make me upset is that, I can only reproduce this crash on production mode (after build to .ipa), but I'm not able to do this on development mode. That makes me crazy... As you know I lack dSYM so the crash log is to some extent useless.
For my code, What are the differences between this two modes?
env info:
os: ios 9
device: at least, happens on Ipad2, Iphone6, Iphone6s. unknow about others.
I am using Armchair framework (https://github.com/UrbanApps/Armchair) as the app review manager for my app. The app is written in Swift (complies with Swift 1.1) and I am running Xcode 6.2 with base SDK 8.2 and deployment target of 8.0.
I am facing a curious issue while doing a release/ad-hoc build of the app- the app crashes right after getting started. I symbolicated the crash logs and here's what I see-
Version: 1 (1.0)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2015-05-08 13:01:54.192 -0700
Launch Time: 2015-05-08 13:01:52.013 -0700
OS Version: iOS 8.3 (12F70)
Report Version: 105
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001007643d8
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
__TFC8Armchair7ManagerP33_0F5394B43958D8E2A7FE7B1C7DE959CE18defaultReviewTitlefS0_FT_SS Armchair.swift:1566
__TFC8Armchair7ManagerP33_0F5394B43958D8E2A7FE7B1C7DE959CE18defaultReviewTitlefS0_FT_SS Armchair.swift:695
__TFC8Armchair7ManagerP33_0F5394B43958D8E2A7FE7B1C7DE959CE15showRatingAlertfS0_FT_T_ Armchair.swift:699
__dispatch_call_block_and_release + 20
__dispatch_client_callout + 12
__dispatch_main_queue_callback_4CF + 1604
___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
___CFRunLoopRun + 1488
_CFRunLoopRunSpecific + 392
_GSEventRunModal + 164
_UIApplicationMain + 1484
11 <MyAppName> 0x0000000100292560 0x1000e8000 + 1746272
_tlv_get_addr + 176
When I run the app on simulator/run directly on the device from Xcode, everything runs perfectly.
Any pointers from anyone?
The first thing I would do is update to the latest Xcode (6.3.1). You will have to scurry around to fix your Swift because of changes in the language. But this version of Swift also fixes a number of memory management bugs that cause crashes in Release builds (and do not show up in Debug builds).
Of course, that might not help if all you've got is the compiled code for this third-party framework.
My app is in App Store so that means my app has passed Apple's review but when my friend install and download the app she couldn't even see the splash screen and it crashed right after she tapped the app icon. What can be the reason for this problem?
EDIT:
Here is the meat of your crash log. Based on the error it appears that #ThomasW and #rahul-vyas are correct that the deployment target inside your Build Settings is likely set to iOS6.x. I would recommend checking both the Target and the Project settings to make sure they're set to iOS5.1.
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x00000001, 0xe7ffdefe
Crashed Thread: 0
Dyld Error Message:
Symbol not found: _objc_setProperty_nonatomic_copy
Referenced from: /var/mobile/Applications/B4F5424C-1593-4150-9AD0-6CF3FE3BD3E5/TubeNoStop.app/TubeNoStop
Expected in: /usr/lib/libobjc.A.dylib
Dyld Version: 199.6
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 dyld 0x2fe2a080 dyld_fatal_error + 0
1 dyld 0x2fe2cefc dyld::halt(char const*) + 72
2 dyld 0x2fe2cfda dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 214
3 libdyld.dylib 0x36aa83ec dyld_stub_binder + 12
Have your friend install this: iPhone Configuration Utility 3.6.2 for Windows
She can use that to email the crash report to you. Then import the crash report into the organiser in xcode, and "symbolicate" it to find where it crashed.
But before doing any of that, run it in the iOS 5.1 Simulator in Xcode. Chances are it will crash there too. If you don't have the 5.1 simulator you can install it from settings (it uses a couple GB of disk space)