iOS Xcode compile error: unable to execute command: Segmentation fault: 11 - ios

I have a project which compiled perfectly in the past, but after the last Xcode update (6.3.2) I get a compile error whenever I try to run it directly on a device. Building and Running it in the simulator works fine. The Archive function works fine as well. But no matter what device I connect or what iOS version the device is running, I always get the same compile error:
Stack dump:
0. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CIFilter.h:221:39: current parser token 'NS_REQUIRES_NIL_TERMINATION'
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: arm-apple-darwin14.3.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/p5/2yjs4f055hb0vvgl12yvj38r0000gq/T/SmallAdsSystem-a86b3e.m
clang: note: diagnostic msg: /var/folders/p5/2yjs4f055hb0vvgl12yvj38r0000gq/T/SmallAdsSystem-a86b3e.cache
clang: note: diagnostic msg: /var/folders/p5/2yjs4f055hb0vvgl12yvj38r0000gq/T/SmallAdsSystem-a86b3e.sh
clang: note: diagnostic msg:
********************
It shows me random files that I'm supposed to submit to the bug report.
I haven't made any code changes from a working version to the version causing the current problems and I even reverted to an earlier version which is live and running in the Appstore but still the same error.
I have deleted xcode and installed again trough the app store
I tried making changes to my code to maybe pinpoint any problems but since the source file of the problem changes every time, I don't really think anymore that it has anything to do with my code.
This is driving me mad.
Any help is much appreciated

I tried to add the paypal framework to my iOS Project (Using Xcode 7.2 and Objective-C language), When building it is not giving any error, but when I try to archive the Project and trying to make the IPA, I am getting that Error
unable to execute command: Segmentation fault: 11
Screenshot:
After huge trying I have disabled the Bitcode in Project's Target->Build Settings->Enable Bitcode. Now the build can be achieved. Please check the following screenshot.

I found a fix for my problem:
I'm using a virtual machine and opened the project directly in the shared folder. I moved the project to the documents and now it works!

unable to execute command: Segmentation fault: 11.
I was able to turn off the bitcode and able to achieve the ipa.
An in depth of what bitcode means can be seen here

We've just realized that segfault was caused by invalid unicode characters in our sources.

If you are using a virtual machine, then copy the files inside the virtual machine, don't import from your shared files, and it will work.

I had the exact same problem.
In my case I looked at the offending file and played around with it. I was able to resolve the error by commenting out a giant NSDictionary declaration:
NSDictionary* glyphNameToUnicode = [[NSDictionary alloc] initWithObjectsAndKeys:
#"A", #"A",
#"\u00C6", #"AE",
#"\u01FC", #"AEacute",
#"\u01E2", #"AEmacron",
This thing had probably 300 lines maybe more. Instead I moved the declaration into a file and loaded the dictionary from the file. Not sure if that helps, but in my case those files were not random...
Its deff a bug with xcode though...

Pods are provided xcode/.... path for installation from git and i installed xcode 7.3.1 and its named like xcode3 so i face this type of error but when i renamed it to xcode then this error is solved for me.
So In summary, First of all please check your xcode name in application section.
If it is not xcode then please rename it to xcode and try to run your app.

Apparently it was a bug in my Xcode version. Had to revert to an old one and everything worked again. With the newest update everything was working ok again.

In order to solve a problem (a known bug closed as a duplicate as of this writing) that caused apps built under 10.12 (macOS Sierra) to fail to launch under 10.9 (even when they'd done so without trouble previously), I'd installed 10.11 and Xcode 7.3.1 under a VMWare instance. Xcode (due to laziness on my part) was copied to the Desktop.
After reading SmarterSusheel's answer regarding a renamed Xcode, it dawned on me it may be path-related, so I moved Xcode to /Applications and tried again. Problem (mostly) solved. I say "mostly" because I also had to copy my project folder into the VMWare instance since it seemed to have issues building under the shared folder as well.

Setting Link-Time Optimization to NO in both Debug and Release mode is what resolved the problem for me.

I was facing similar issue:
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)
Simply updating from Xcode 7.2 to 7.3.1 has resolved the issue!

I only had problem for i386 architecture when building for iPhone 4s simulator running 9.3
When disabling bitcode didn't work (suggested above), i tried to look at the source code. I didn't find any ascii related stuff (suggested by others), so I tried to comment out method by method until I found the offending line. For me the error was caused by this:
let keyboardSize = ((info![UIKeyboardFrameBeginUserInfoKey] as AnyObject).cgRectValue.size)
Changed it into:
let keyboardSize = (info![UIKeyboardFrameBeginUserInfoKey] as! NSValue).cgRectValue.size

Quit and reopen the Xcode worked for me !
make sure you clean the build folder after reopening the Xcode !

I was facing similar issue:
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)
then i was change my Provisioning profile.

Related

Xcode 9 simulators does not run

I'm getting error while running an application on simulator using Xcode 9.2. Can not run project on simulator devices.
Error:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And in my CoreSimulator.log file I have seen:
Spawning processes in an unbooted state without setting kSimDeviceSpawnStandalone is deprecated.
I tried to remove derived data, quit Xcode and reopen does not solve my issue. Could you please help to solve this bad situation?
My mac OS version: 10.13.2(High Sierra)
Xcode version: 9.2
I found solution;
In my target -> build phases -> link binary with libraries section
lib386.a
multiplexed. Because of my third party's "xxx.a" library which contains "lib386.a".
Deleted "lib386.a" in link binary section and then simulator runs.
Thanks all.

clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)

I don't know what causes it.
It does not happen at iPhone 5 and simulators. It have been happened only my original device iPhone 7.
fatal error: error in backend: Error while trying to spill X0 from class GPR64: Cannot scavenge register without an emergency spill slot!
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Apple LLVM version 9.0.0 (clang-900.0.34.1)
Target: aarch64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/xg/tgwkzqt15xd9jprnv9f0gn4c0000gn/T/CityArray-6e6c1e.m
clang: note: diagnostic msg: /var/folders/xg/tgwkzqt15xd9jprnv9f0gn4c0000gn/T/CityArray-6e6c1e.cache
clang: note: diagnostic msg: /var/folders/xg/tgwkzqt15xd9jprnv9f0gn4c0000gn/T/CityArray-6e6c1e.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: /Users/junhyun/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg:
********************
I got this error when i was archiving my app with xcode - while running on sim and physical device worked -, but had my physical device still selected as a scheme. Solution worked for me: clean build folder, and select 'Generic IOS Device' as the scheme.
Delete ~/Library/Developer/Xcode/DerivedData worked for me.
Issue is due to cache, since your using pods - you need to remove old references
This has been driving me nuts and I still can not pinpoint the reason for the crash. But a few of these steps or a combination of these seems to remedy it in the meanwhile.
Try doing a clean build.
Run pod install / pod deintegrate.
Run npm install if you are working on a react native app after deleting node_modules
Close xcode and then delete ~/Library/Developer/Xcode/DerivedData
If nothing works try restarting the system.
Delete ~/Library/Developer/Xcode/DerivedData worked for me.
I got this error when I hardcoded a massive array into a .h file. Worked fine on simulator, threw this error on device.
Changed the array to be empty and it compiled just fine.
I used the following steps to get rid of the error:
Clean cache from Xcode Product->Clean Build Folder
npm install
run react-native run-ios
Build the app using Xcode.
I was getting this error because while cleaning my hard drive I was removed everything from ~/Library/Developer/Xcode/DerivedData
After having removed that data turned out when you run react native's build command to develop locally it depends on some cached files in DerivedData so my builds were failing.
I removed the installed pods, node_modules and build folder in my react native project and just rebuilt them and it worked fine after that.

Unity4XC plug-in error

I'm using Unity 4.6 and Xcode. After updating Xcode to 7.1 version I'm getting this error while trying to run build for iphone:
Unexpected code bundle “Unity4XC.xcplugin”
The “Unity4XC.xcplugin” code bundle is not provided by Apple. Loading code not provided by Apple can have a negative effect on the safety and stability of Xcode or related tools.
I clicked on "Load Bundle".
Since then I'm getting this error:
Xcode quit unexpectedly while using the Unity4XC plug-in.
Click Reopen to open the application again. Click Report to see more detailed information and send a report to Apple.
I tried to open the project from within the Xcode program and it still not working.
If I try to open the project manually I get this error in xcode:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there a connection to the problem?
What should try to do now?
Thanks.
Unfortunately, it's currently a known issue:
http://issuetracker.unity3d.com/issues/ios-build-and-run-doesnt-work-with-xcode-7-and-7-dot-1

openFrameworks / freeimage.a cause error with ios arm 64

i'm using assimp.a and freeimage.a with voufria ar base on
https://github.com/DrNeuroSurg/REVu/tree/master/REVU_IOS
I'm trying to build an app I've been working on for 64-bit iOS and it's failing at the linker. The error is this:
ld: 128-bit LDR/STR not 16-byte aligned: from __ZN13CResizeEngine16horizontalFilterEP8FIBITMAPjjjjPK10tagRGBQUADS1_j (0x1006FFF20) to l005#0x00000850 (0x100B825D8) in '__ZN13CResizeEngine16horizontalFilterEP8FIBITMAPjjjjPK10tagRGBQUADS1_j' from /Users/xxxxx/Desktop/sharq_final/El-shareq/AR/QCAR/REVU_IOS/FreeImage/lib/ios/freeimage.a(Resize.o-arm64) for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Anybody run across something like this while porting to 64-bit (or ever)?
I believe this is due to a clash of clangs. FreeImage.a was built with the latest clang from Xcode 6.3.1.
Make sure you have the latest Xcode Installed.
Do a clean, restart your Mac and try again.
The only reference I could find similar to this issue was at this link, and it was solved with these steps:
http://www.politepix.com/forums/topic/linked-errors-with-openears-iphone-5s/
I have posted an issue on the openFrameworks github as well with some more information:
https://github.com/openframeworks/openFrameworks/issues/3984

Apple Mach-O Linker Errors after restarting mac

I was prompted to restart the computer after a few updates were installed and since then my app keeps failing to build. It was working fine prior to restarting the computer. I don't believe xcode was one of the updates. I am currently running Xcode Version 4.6.3 (4H1503).
Apple Mach-O Linker errors:
(null): "_main", referenced from:
(null): Linker command failed with exit code 1 (use -v to see invocation)
I have tried removing all frameworks and adding them back.
Any idea what is causing the app to fail to build now?
After spending many hours trying to figure out what happened I finally discovered that somehow with the installation of the updates and restarting the computer many files were no longer listed in the Compile Sources section.
I have no idea why it happened.
To solve the issue I just had to add the files back.
If you're like me and have no clue what files actually are suppose to be there I just added all files available and then Xcode raised a warning stating which files it could not understand. I just went and removed any file that xcode didn't like in the Compiled Sources section.
Yes I know this a very crude way of handling it, but my project is working again now and that makes me happy. :-)

Resources