iOS App crashes under 3.1.3 when compiled with LLVM2 - ios

I have an iOS app with the following (selected) build settings in XCode 4.0.1:
Architecture = Standard (armv6 armv7)
Base SDK = Latest iOS (iOS 4.3)
iOS Deployment Target = iOS3.1
Other linker flags = -lxml2 -weak-library /usr/lib/libSystem.B.dylib
Under Targets/Build Phases, I have libSystem.B.dylib as Optional (Link Binary With Libraries).
On a 1st gen iPod Touch, I'm getting the following results:
Debug Build, C/C++ Compiler Version = LLVM Compiler 2.0, all OK
Ad Hoc Release Build, C/C++ Compiler Version = GCC 4.2, all OK
Ad Hoc Release Build, C/C++ Compiler Version = LLVM GCC 4.2, all OK
Ad Hoc Release Build, C/C++ Compiler Version = LLVM Compiler 2.0, crash a few seconds after starting.
In case 4., the crash report looks like this:
Incident Identifier: 10B8B9C5-0FA5-4C83-AB13-4C3F59D5962D
CrashReporter Key: 29f7901a33e9b055c9034cd051902ea0c87e61f6
Process: TPE [1484]
Path: /var/mobile/Applications/4FA4C8CA-DB5D-4096-8458-C76382E68D02/TPE.app/TPE
Identifier: TPE
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-04-09 17:56:58.188 +1000
OS Version: iPhone OS 3.1.3 (7E18)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0000000000 0 + 0
Thread 1:
0 libSystem.B.dylib 0x00001488 mach_msg_trap + 20
1 libSystem.B.dylib 0x00004064 mach_msg + 60
etc.
The crash happens after a number of routines in my code have executed (I can see console output confirming it).
Does anyone have any ideas what would cause this to work under GCC4.2, but crash under LLVM2?

It's just a wild guess, but there was a compiler bug recently in llvm2 that made our app crash the same way. It only happened in release mode with full optimization and only on older devices (probably a specific processor). We switched back to gcc and everything was fine again. Apple updated their compiler in mean time which "fixes bugs for iOS", but we didn't test it yet.

The same problem still occurs with XCode 4.2 (4D199) when code is generated with Apple LLVM compiler 3.0.
AdHoc App works fine on iOS5 on simulator, iPad1 and iPhone4.
Same AdHoc code crashes on iPhone 3 and iPod3 on iOS 4.2.1 (8C148).
Debug code works fine on all platforms.
When the problem occurs the console log shows the following:
SpringBoard[25] <Warning>: Received memory warning. Level=1
MobileSafari[283] <Warning>: Received memory warning. Level=1
configd[23] <Notice>: jetsam: kernel memory event (93), free: 241, active: 1109, inactive: 760, purgeable: 0, wired: 7878
configd[23] <Notice>: jetsam: kernel termination snapshot being created
com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilesafari[0xc614]) Exited: Killed
com.apple.launchd[1] <Notice>: (UIKitApplication:com.myapp.test[0x47db]) Exited: Killed
SpringBoard[25] <Warning>: Application 'MyApp' exited abnormally with signal 9: Killed
Peak memory usage of the App is a couple Mb. The debug code never reaches a critical memory limit.
The problem disappears when either:
Optimization Level for AdHoc is set to None (-O0)
The compiler is changed to LLVM GCC 4.2
So far, extensive analyzes of code and memory management have not provided an indication what might be causing this. It seems like a compiler bug...

Related

Xcode 9 crashes while exporting ipa from archive

I created an archive for any project in Xcode 9. Then I try to create an ipa file (either development or ad-hoc). I first try to export the archive. Then I select either Development or AdHoc Distribution. The Xcode 9 crashes. I even added 'compile bitcode' option in the app's info.plist. I am able to create an ipa with the same project in Xcode 8.
Bug report :
Process: Xcode [6854]
Path: /Applications/Xcode9.0.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 9.0 (13247)
Build Info: IDEFrameworks-13247000000000000~26
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [6854]
User ID: 501
Date/Time: 2017-11-07 16:13:32.644 +0530
OS Version: Mac OS X 10.12.6 (16G29)
Report Version: 12
Anonymous UUID: E7160691-62F7-DE54-A767-EF456EC37FEC
Time Awake Since Boot: 10000 seconds
System Integrity Protection: enabled
Crashed Thread: 15 Dispatch queue: ConcurrentQueue: -[IDEDistributionPackagingStepViewController viewDidInstall]_block_invoke
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000020
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
VM Regions Near 0x20:
-->
__TEXT 000000010b094000-000000010b096000 [ 8K] r-x/rwx SM=COW /Applications/Xcode9.0.app/Contents/MacOS/Xcode
Application Specific Information:
ProductBuildVersion: 9A235
....
In my case this was due to a pending Apple license agreement that was causing Xcode's automatic provisioning to crash.
Log onto developer.apple.com and make sure you do not have a license update pending agreement.
Expired provision profile was the cause of this same issue. After renewal, everything is now working.
The "Apple Developer Program License Agreement" has been updated.
So I have to accept pending License Agreement.
When I select Manual manage signing and try to download profile then I got following error
Try export with Manually first after that you can comeback with Automatically. I think this one fault when apple server return data for exporting process. It can be reset the process with manually option.

What is a fence-hang / handling fence / blown-fence error?

I had an iOS iPad app crash and got the following crash log from the Devices tab:
Date/Time: 2017-10-13 15:06:22 -0600
OS Version: iPhone OS 11.1 (Build 15B5066f)
Architecture: arm64
Report Version: 26
Data Source: KPerf Lightweight PET
Kernel Cache: 0xffffffe000000000 1C4A9D92-74B9-1F20-096E-27915D7A6C03
Reason: Fence-hang-Vocab: 505ms handling fence, blown-fence (fence duration=505ms)
Command: Vocab
Path: /private/var/containers/Bundle/Application/9F4A7C15-D23E-46C8-B724-84C57D83B455/Vocab.app/Vocab
Identifier: com.mycompany.Vocab
Version: 1.4.0 (420)
Parent: debugserver [1467]
PID: 1469
Duration: 0.55s
Steps: 11 (50ms sampling interval)
Hardware model: J71AP
Active cpus: 2
Any insight into what this error is and what causes it?
According to this Apple Developer Forums Thread, one cause of blown fence errors is due to high memory pressure.
The developer of the app in question might be able to monitor memory pressure of the app, which could be a cause for the app being terminated.

Xcode crashes when trying to run project due to LLDB

When I click 'Run', Xcode crashes instantly, regardless of my code.
The crash report says that the LLDB plugin can not be read correctly:
Error getting value for key 'workerClass' of extension 'Xcode.DebuggerFoundation.Debugger.LLDB' in plug-in 'com.apple.dt.dbg.DebuggerLLDB'
The crash report:
Process: Xcode [2184]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.0.2 (3335.32)
Build Info: IDEApplication-3335032000000000~4
Code Type: X86-64 (Native)
Parent Process: launchd [147]
Responsible: Xcode [2184]
User ID: 501
Date/Time: 2014-02-26 18:41:28.657 +0100
OS Version: Mac OS X 10.9.2 (13C64)
Report Version: 11
Anonymous UUID: B5F54D76-660F-C9CE-0C9C-D0D41BA7332B
Sleep/Wake UUID: 9A19E5A2-14DE-40FF-8993-668257EF9F44
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
Sending performRunAction: to <IDERunPauseContinueToolbarButton: 0x7f8494673e80> from <IDERunPauseContinueToolbarButton: 0x7f8494673e80>
ProductBuildVersion: 5A3005
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): Error getting value for key 'workerClass' of extension 'Xcode.DebuggerFoundation.Debugger.LLDB' in plug-in 'com.apple.dt.dbg.DebuggerLLDB'
UserInfo: {
NSUnderlyingError = "Error Domain=DVTPlugInErrorDomain Code=2 \"Loading a plug-in failed.\" UserInfo=0x7f8496dca9a0 {DVTPlugInIdentifierErrorKey=com.apple.dt.dbg.DebuggerLLDB, DVTPlugInExecutablePathErrorKey=/Applications/Xcode.app/Contents/PlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB, NSLocalizedRecoverySuggestion=The plug-in or one of its prerequisite plug-ins may be missing or damaged and may need to be reinstalled., NSLocalizedDescription=Loading a plug-in failed., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/DebuggerLLDB.ideplugin, NSLocalizedFailureReason=The plug-in \U201ccom.apple.dt.dbg.DebuggerLLDB\U201d at path \U201c/Applications/Xcode.app/Contents/PlugIns/DebuggerLLDB.ideplugin\U201d could not be loaded. The plug-in or one of its prerequisite plug-ins may be missing or damaged., NSUnderlyingError=0x7f8496dc98f0 \"The bundle \U201cDebuggerLLDB\U201d couldn\U2019t be loaded because it is damaged or missing necessary resources.\"}";
}
Hints:
0: Sending performRunAction: to <IDERunPauseContinueToolbarButton: 0x7f8494673e80> from <IDERunPauseContinueToolbarButton: 0x7f8494673e80>
1: Sending performAction: to <DVTDelayedMenuButtonCell: 0x7f8494674490> from <IDERunPauseContinueToolbarButton: 0x7f8494673e80>
Backtrace:
0 0x00007fff91211244 __exceptionPreprocess (in CoreFoundation)
1 0x00000001082ddd73 DVTFailureHintExceptionPreprocessor (in DVTFoundation)
2 0x00007fff940a2e75 objc_exception_throw (in libobjc.A.dylib)
3 0x000000010826bcd2 -[DVTExtension valueForKey:] (in DVTFoundation)
4 0x000000010d3d1109 -[DBGLLDBDebugLocalService operationWorkerWithLaunchSession:error:] (in DebuggerLLDBService)
5 0x0000000110106e17 -[IDERuniPhoneSimulatorService operationWorkerWithLaunchSession:error:] (in IDEiOSSupportCore)
6 0x0000000108d38d49 -[IDERunDestination runWorkerForLaunchSession:error:] (in IDEFoundation)
7 0x0000000108d38a74 -[IDERunDestination runOperationForLaunchSession:error:] (in IDEFoundation)
8 0x0000000108da0fee -[IDELaunchSchemeAction runOperationForExecutionEnvironment:withBuildOperation:buildParameters:buildableProductDirectories:schemeActionRecord:outError:actionCallbackBlock:] (in IDEFoundation)
9 0x0000000108d94f5b -[IDEScheme _executionOperationForExecutionEnvironment:build:onlyBuild:buildPurpose:buildCommand:schemeCommand:title:overridingProperties:destination:buildLog:filePath:overridingBuildConfiguration:restorePersistedBuildResults:invocationRecord:overridingTestingSpecifiers:error:actionCallbackBlock:] (in IDEFoundation)
This may happen due to a broken LLDB debugger, which could only be solved by Apple.
However, I haven't found many similar problems from others on the internet yet, so this may only happen with my Xcode.
I had the same problem: was not able to run any Xcode projects. Reason was I was playing around on Python and downgraded it to 2.6.8 from 2.7.x. So, I have updated the python to 2.7.8 from older version, No problems so far, Xcode deploys everything very smoothly. Other things that I have tried was even uninstalling the X-code and install again, this didn't help. Very useful page to upgrade your python on macbook : http://wolfpaulus.com/jounal/mac/installing_python_osx/
It has nothing to do with your project. Somehow the Xcode.app that you launched has been damaged. Try downloading the latest Xcode from the App Store or ADC.
If this don't helps, try to report your problem: Apple Bug Reporter
If anyone still has the same problem, Apple told me that this happens if a wrong "custom" version of Python is installed. I installed Python 2.7.6 and it worked.

Cordova 2.6 / 2.7 iOS app timing out

I have an app that I've been running successfully for the best part of a year built with Cordova 2.1. Recently I decided to start a new build with 2.6 and it runs fine on iOS 5, but not iOS 6. Went through the crash logs which all point to "[app] failed to launch in time". Unhelpfully it also has 'backtrace not available'.
To try to pin down what I'm doing wrong, I basically started from scratch - create a default Cordova app. However when I run that - just the very basic app that is created when you create a new project from the command line - it also has the same error. Get the splash screen, stalls and then crashes with the failed to launch in time error.
The apps run fine in the simulator, but when I run them on a device from Xcode or archive them and install them, nothin'.
Im using Cordova 2.7.0, Xcode 4.6.2 on OSX 10.7.5. If it helps, one of the full crash logs is below...
Incident Identifier: EDD1A74C-953F-4D66-9199-2D87E3AD9D3F
CrashReporter Key: e72939db0dce8f4abf935c5b5c7e2aa4a2a4b880
Hardware Model: iPhone3,1
Process: test01 [10376]
Path: /var/mobile/Applications/3AEE3B27-11B9-48FA-9190
A7A53BF78E48/test01.app/test01
Identifier: test01
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-05-01 11:00:55.046 +1000
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x000000008badf00d
Highlighted Thread: 0
Application Specific Information:
[app] failed to launch in time
Elapsed total CPU time (seconds): 20.000 (user 20.000, system 0.000), 100% CPU
Elapsed application CPU time (seconds): 0.000, 0% CPU
Backtrace not available
Unknown thread crashed with unknown flavor: 5, state_count: 1
Binary Images:
0x2fe70000 - 0x2fe90fff dyld armv7 <280610df5ed43ec7aa00629a27009302> /usr/lib/dyld
Any help is greatly appreciated.

"clang quit unexpectedly" (xcode Crash)

When i try to Analyze my code (Product -> Analyze), the xcode crash with this title "clang quit unexpectedly"
Process: clang [10074]
Path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Identifier: clang
Version: 3.1 (318.0.61)
Code Type: X86-64 (Native)
Parent Process: clang [10073]
Date/Time: 2012-07-13 18:46:29.862 +0100
OS Version: Mac OS X 10.7.4 (11E53)
Report Version: 9
Interval Since Last Report: 140604 sec
Crashes Since Last Report: 50
Per-App Crashes Since Last Report: 39
Anonymous UUID: E974A614-4831-478E-8B68-8FE005A98F19
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
VM Regions Near 0:
-->
__TEXT 000000010180f000-00000001029c8000 [ 17.7M] r-x/rwx SM=COW /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 clang 0x00000001018dc780 clang::Stmt::getSourceRange() const + 16
1 clang 0x00000001021ce0c6 _ZL22getValidSourceLocationPKN5clang4StmtEN4llvm12PointerUnionIPKNS_15LocationContextEPNS_19AnalysisDeclContextEEE + 86
2 clang 0x00000001021ce5d3 clang::ento::PathDiagnosticLocation::genLocation(clang::SourceLocation, llvm::PointerUnion) const + 35
my guest is because LLVM ? i have Apple LLVM compiler 3.1
Thanks!
Edit:
Xcode Version 4.3.3 (4E3002)
I have a file that always crashes clang when analyzed. I submitted abut report on it and Apple dupped the bug - so obviously they know of some bugs already. Note that Xcode 4.4 will be released in a week or two with llvm 4.0 so just wait for it, and if you still get crashes please enter a bug report at bug reporter.apple.com
Edit: my bug report was against 4.3.3

Resources