how to find symbol of TRAP_BRKPT - ios

i have a crash on iOS from the wild which looks something like the following
Exception Type: SIGTRAP
Exception Codes: TRAP_BRKPT at 0xe7ffdefe
Crashed Thread: 0
Application Specific Information:
*** Terminating app due to uncaught exception '', reason: ''
Thread 0 Crashed:
0 MyApp 0x002bf4d8 0xdb000 + 1983704
1 MyApp 0x002bf4f4 0xdb000 + 1983732
2 MyApp 0x004e17ef 0xdb000 + 4220911
first question: I'm under the impression SIGTRAP is related to the debugger. how does this happen in production?
I am able to sylbolicate correctly, but not this TRAP_BRKPT at 0xe7ffdefe
I think knowing what lives at 0xe7ffdefe will help me figure out what's going on. so the the second question is how do i find out what is living at 0xe7ffdefe?
I've tried running
atos -l -arch armv7 -o ./MyApp 0xe7ffdefe
and got the output
0x00004014 (in MyApp)
0x0000400a (in MyApp)
Edit:
figured i might as well provide the symbolicated results
0 MyApp 0x000000010027c5d8 MyController.viewDidLoad() -> () (MyViewController.swift:26)
1 MyApp 0x000000010027c5f8 #objc MyViewController.viewDidLoad() -> () (MyViewController.swift:0)
where line 26 is self.webView.loadHTMLString(self.staticScreen.body, baseURL: nil)

Related

How to reproduce or symbolicate error log from reviewer?

Recently I submitted an app to appstore but I keep getting some error logs that I can't reproduce. I tried many times on simulator and device with the same ios version but no result. The error log is like below:
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: some.identifier [877]
Date/Time: 2018-02-15 08:54:22.2476 -0800
Launch Time: 2018-02-15 08:54:15.9742 -0800
OS Version: iPhone OS 11.2.5 (15D60)
Baseband Version:
Report Version: 104
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000100c8c704
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
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 hc-ios-consumer 0x0000000100c8c704 0x100c70000 + 116484
1 Alamofire 0x0000000100f67268 0x100f30000 + 225896
2 Alamofire 0x0000000100f495c0 0x100f30000 + 103872
3 libdispatch.dylib 0x0000000183fbea54 0x183fbd000 + 6740
4 libdispatch.dylib 0x0000000183fbea14 0x183fbd000 + 6676
5 libdispatch.dylib 0x0000000183fcb698 0x183fbd000 + 59032
6 CoreFoundation 0x00000001845e7344 0x1844fc000 + 963396
7 CoreFoundation 0x00000001845e4f20 0x1844fc000 + 954144
8 CoreFoundation 0x0000000184504c58 0x1844fc000 + 35928
9 GraphicsServices 0x00000001863b0f84 0x1863a6000 + 44932
10 UIKit 0x000000018dc5d5c4 0x18dbea000 + 472516
11 some-identifier 0x0000000100c751d8 0x100c70000 + 20952
12 libdyld.dylib
How can I find what causes the crash?

Xcode 9 GM - Export and Upload to App Store crashing

I'm trying to upload my app that uses ARKit (Unity build) to iTunes Connect for TestFlight distribution. While both exporting and uploading to app store processes from Xcode -> Organizer I see crash on "Stripping extended attributes for APPNAME.app".
I checked all configuration of bitcode and symbols on/off, signing automatically, manually. Deployment target of my project is iOS 10, as 11 cannot be set.
I also tried following steps from simillar thread (https://forums.developer.apple.com/thread/83219) and added App Store 1024 icon to Images.xcassets.
Any ideas why Xcode is crashing?
Screenshot from just before the crash:
Crash report:
Process: Xcode [10862]
Path: /Applications/Xcode-9b6.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 9.0 (13238.4)
Build Info: IDEFrameworks-13238004000000000~11
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [10862]
User ID: 501
Date/Time: 2017-09-10 14:56:10.196 +0100
OS Version: Mac OS X 10.12.6 (16G29)
Report Version: 12
Anonymous UUID: FD8390BC-9E7B-969D-15A2-22A8DBBD050D
Time Awake Since Boot: 16000 seconds
System Integrity Protection: enabled
Crashed Thread: 17 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 0000000103625000-0000000103627000 [ 8K] r-x/rwx SM=COW /Applications/Xcode-9b6.app/Contents/MacOS/Xcode
Application Specific Information:
ProductBuildVersion: 9M214v
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fffbb90634a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fffbb905797 mach_msg + 55
2 com.apple.CoreFoundation 0x00007fffa6037434 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fffa60368c1 __CFRunLoopRun + 1361
4 com.apple.CoreFoundation 0x00007fffa6036114 CFRunLoopRunSpecific + 420
5 com.apple.HIToolbox 0x00007fffa5596ebc RunCurrentEventLoopInMode + 240
6 com.apple.HIToolbox 0x00007fffa5596cf1 ReceiveNextEventCommon + 432
7 com.apple.HIToolbox 0x00007fffa5596b26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
8 com.apple.AppKit 0x00007fffa3b2fa54 _DPSNextEvent + 1120
9 com.apple.AppKit 0x00007fffa42ab7ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
10 com.apple.dt.DVTKit 0x0000000103eb58be -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 390
11 com.apple.AppKit 0x00007fffa3b243db -[NSApplication run] + 926
12 com.apple.AppKit 0x00007fffa3aeee0e NSApplicationMain + 1237
13 libdyld.dylib 0x00007fffbb7df235 start + 1
Edit
Running xcodebuild (through fastlane gym) produces the following:
+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/z1/m155xvnn42s7xl7hfw3_8w5w0000gn/T/gym_config20170912-61009-190kutb.plist -archivePath '/Users/wert/Library/Developer/Xcode/Archives/2017-09-12/towerar 2017-09-12 22.06.54.xcarchive' -exportPath /var/folders/z1/m155xvnn42s7xl7hfw3_8w5w0000gn/T/gym_output20170912-61009-42bo6w
2017-09-12 22:09:04.966 xcodebuild[62085:5372649] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/z1/m155xvnn42s7xl7hfw3_8w5w0000gn/T/Unity-iPhone_2017-09-12_22-09-04.966.xcdistributionlogs'.
2017-09-12 22:09:21.584 xcodebuild[62085:5372649] [MT] IDEDistribution: Step failed: <IDEDistributionPackagingStep: 0x7fc3c75f18b0>: <IDEDistributionPackagingStep: 0x7fc3c75f18b0>
2017-09-12 22:09:21.584 xcodebuild[62085:5372649] -[__NSCFString userInfo]: unrecognized selector sent to instance 0x7fc3c74d72f0
** INTERNAL ERROR: Uncaught exception **
Uncaught Exception: -[__NSCFString userInfo]: unrecognized selector sent to instance 0x7fc3c74d72f0
Stack:
0 __exceptionPreprocess (in CoreFoundation)
1 objc_exception_throw (in libobjc.A.dylib)
2 -[NSObject(NSObject) doesNotRecognizeSelector:] (in CoreFoundation)
3 ___forwarding___ (in CoreFoundation)
4 _CF_forwarding_prep_0 (in CoreFoundation)
5 __55-[Xcode3CommandLineBuildTool _distributeArchiveAndExit]_block_invoke (in Xcode3Core)
6 -[Xcode3CommandLineBuildTool _distributeArchiveAndExit] (in Xcode3Core)
7 -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
8 0x0000000104d752af (in xcodebuild)
9 start (in libdyld.dylib)
I've had to uncheck all checkboxes and use manual managing signing, then it was possible to proceed in the wizard.
Does the xattr command line tool work? It's possible your python installation is damaged, or if you've replaced the installed xattr module then you may need to reinstall the system provided one.
I had been experiencing same frustating problem and it happen almost all day , Xcode 9 suddenly crashes in the middle of the archiving process, resulting in the same error report.
#dangercheng gave me insight about archive process in xcode 9, which is, it needs the xattr command , therefore I go check xattr command in my macbook and somehow xattr doesn't work. From the verbose message, it reveals that the error is related to file permission owned by folders/files inside /Library/Python/2.7 . Somehow a user other than root has no right to write (w/ 2) on those files/folders.
From above facts I concluded that I need to change file permission in this case chmod -R 775 and apply it to all folders and its content on /Library/Python/2.7. After that my xattr is running well and my Archive process in Xcode 9 is running smoothly, experiencing no crash.
Thanks for all of you guys
In my case, it was due to permissions issues with python.
When running xattr from terminal I had the following error:
IOError: [Errno 13] Permission denied: '/Users/cb/Library/Python/2.7/lib/python/site-packages/zc.buildout-1.5.2-py2.7.egg-info/namespace_packages.txt'
Taking a look inside the /Users/cb/Library folder I found that all of the folders were owned by cb:staff (my currently logged in user and group) but the /Users/cb/Library/Python folder was owned by root:wheel
Running the following will eliminate the error:
sudo chown -R $USER:$(id -g) /Users/$USER/Library/Python
After the sudo chown you can run xattr again to verify. There should be no errors or other output from the xattr command.
Probably not your fault but do file a bug with Apple. But when the Xcode uploader fails for any reason try the good ol' Application Loader:
Xcode.app/Contents/Applications/Application Loader.app
run 'xattr' command in mac terminal,if result like bellow:
python version 2.7.10 can't run /usr/bin/xattr. Try the alternative(s):
/usr/bin/xattr-2.6 (uses python 2.6)
/usr/bin/xattr-2.7 (uses python 2.7)
Run "man python" for more information about multiple version support in
Mac OS X.
you should creat a new soft link to '/usr/bin/xattr-2.7'
run bellow commands:
cd /usr/bin
sudo rm xattr
sudo ln -s xattr-2.7 xattr
this solve my problem!
I solved my problem following #dangercheng's answer.
I upgraded my python to python 3.6 two days ago.And it seems that the xattr command was executed under python3.6 .
However, when I execute xattr in terminal.
File "/usr/bin/xattr", line 31
continue
^
TabError: inconsistent use of tabs and spaces in indentation
Something bad happened!
So I edit the source code of xattr.
for i in g:
vers = vpat.search(i)
if vers is None:
continue //add 4 space
sys.stderr.write("%s (uses python %s)\n" % (i, i[vers.start():vers.end()]))
n = 1
```
python version 3.6.3 can't run /usr/bin/xattr. Try the alternative(s):
(Error: no alternatives found)
Run "man python" for more information about multiple version support in
Mac OS X.
```
another error!
I guess the xattr command should judge the version of python and execute suitable codes and the code of python3 contains some error.
Finally I change the default version of python to python2.7 and replace softlink of xattr to xattr-2.7. It works.
Attention, when xcodebuild execute xattr command the path of python was "/usr/bin/python".
The path "/usr/bin/python" was softlink too.
So, I resolved this problem following this step.
Step1:
cd /usr/bin
Step2:
sudo rm python
sudo ln -s python2.7 python
Step3:
sudo rm xattr
sudo ln -s xattr-2.7 xattr
If you can not found python2.7 under "/usr/bin", please find another suitable python path such as "/Library/Frameworks/Python.framework/Versions/2.7" etc.

ios-sim stopped working "NSCFString containsString" error

I'm using Ionic to build a hybrid mobile app. Previously I've had no trouble launching the emulator via "ionic emulate ios" command. But all of a sudden the command started throwing errors.
I've tried removing then adding back the ios platform, uninstalling then re-installing ios-sim, but still get the same error message below. Any help would be much appreciated, thanks
2015-06-13 14:06:20.198 ios-sim[12997:507] -[__NSCFString containsString:]: unrecognized selector sent to instance 0x7f98e06006e0
2015-06-13 14:06:20.200 ios-sim[12997:507] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString containsString:]: unrecognized selector sent to instance 0x7f98e06006e0'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff9303925c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff9058ee75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff9303c12d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff92f97272 ___forwarding___ + 1010
4 CoreFoundation 0x00007fff92f96df8 _CF_forwarding_prep_0 + 120
5 ios-sim 0x0000000107511534 -[iPhoneSimulator runWithArgc:argv:] + 1313
6 ios-sim 0x0000000107511e79 main + 101
7 ios-sim 0x000000010750f0e0 start + 52
8 ??? 0x000000000000000a 0x0 + 10
)
libc++abi.dylib: terminating with uncaught exception of type NSException
What version of ios-sim are you using? (Run ios-sim --version to find out.)
The containsString crash on Mavericks is caused by this bug, which exists in v3.2.0 (see here).
If you downgrade to v3.1.1, or upgrade to v4.1.1, then ios-sim should work fine on Mavericks.

cant 'cordova emulate ios' from terminal

I updated Xcode. Not sure if that's the problem but it is where the problem started.
But long story short:
-"$ cordova emulate android" works
-"$ cordova emulate ios" does not work
It gives me (this is the last part of the output):
** BUILD SUCCEEDED **
2014-10-03 16:35:53.054 ios-sim[74808:507] stderrPath: /Users/doekewartena/Documents/jbc2014/platforms/ios/cordova/console.log
2014-10-03 16:35:53.055 ios-sim[74808:507] stdoutPath: /Users/doekewartena/Documents/jbc2014/platforms/ios/cordova/console.log
2014-10-03 16:35:53.085 ios-sim[74808:507] -[__NSArrayM localizedDescription]: unrecognized selector sent to instance 0x7fea40503090
2014-10-03 16:35:53.086 ios-sim[74808:507] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM localizedDescription]: unrecognized selector sent to instance 0x7fea40503090'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff98e1025c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8cc4ee75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff98e1312d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00007fff98d6e272 ___forwarding___ + 1010
4 CoreFoundation 0x00007fff98d6ddf8 _CF_forwarding_prep_0 + 120
5 ios-sim 0x00000001014b8e29 -[iPhoneSimulator LoadSimulatorFramework:] + 245
6 ios-sim 0x00000001014ba8e0 -[iPhoneSimulator runWithArgc:argv:] + 2271
7 ios-sim 0x00000001014bacb2 main + 101
8 ios-sim 0x00000001014b8ce4 start + 52
)
libc++abi.dylib: terminating with uncaught exception of type NSException
/Users/doekewartena/Documents/jbc2014/platforms/ios/cordova/run: line 158: 74808 Abort trap: 6 ios-sim launch "$SIMULATOR_APP_PATH" --stderr "$CORDOVA_PATH/console.log" --stdout "$CORDOVA_PATH/console.log" $TARGET_FLAG --exit
Error: /Users/doekewartena/Documents/jbc2014/platforms/ios/cordova/run: Command failed with exit code 134
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Process.ChildProcess._handle.onexit (child_process.js:822:5)
However, I can run the simulator fine from Xcode itself.
I have no clue what to do, I hope someone can help.
For Xcode 6 you'll need version 3 of ios-sim. Check your version by running ios-sim --version. Upgrade by running sudo npm update ios-sim -g.

Xcode 5.0.1 iOS 7.0.3 Error with instruments command line tool

I have consistently getting the following error message when trying to launch UIAutomation test with the instruments command line tool:
2013-10-30 12:08:47.868 ScriptAgent[4687:2e07] CLTilesManagerClient:
initialize, sSharedTilesManagerClient
2013-10-30 12:08:47.869 ScriptAgent[4687:2e07] CLTilesManagerClient:
init 2013-10-30 12:08:47.869 ScriptAgent[4687:2e07]
CLTilesManagerClient: reconnecting, 0xa5b0aa0 2013-10-30 12:09:17.989
ScriptAgent[4687:2e07] +[UIAXElement initializeAccessibility]:
UIAutomation never received kAXAccessibilityLoaded. Waited 30.02
seconds. 2013-10-30 12:09:17.990 ScriptAgent[4687:2e07] AXError: Could
not auto-register for pid status change 2013-10-30 12:09:18.008
ScriptAgent[4687:2e07] Failed to enable accessiblity,
kAXErrorServerNotFound 2013-10-30 12:09:18.381
instruments[4633:240f] Automation Instrument ran into an exception
while trying to run the script. UIAScriptAgentSignaledException
2013-10-30 11:09:18 +0000 Fail: An error occurred while trying to run
the script.
Anyone else have this issue?
Thanks for your help.
Try sudo rm /tmp/instruments_sock -- this is the socket file created by instruments.js to communicate with instruments. That file is probably not deleateable for some reason.
That command will delete the file. Alternatively try to change the permission settings for the file.
I also encounter this issue on Xcode 5.0.1, instruments doesn't work even start from UI
but instruments works fine with Xcode 5.0
After some investigation, I found that when instruments is starting, the scriptAgent in iPhoneSimulator SDK crashes.
Process: ScriptAgent [4297]
Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/usr/bin/ScriptAgent
Identifier: ScriptAgent
Version: 270
Code Type: X86 (Native)
Parent Process: instruments [4208]
Responsible: eclipse [1017]
User ID: 110125050
Date/Time: 2013-11-11 10:52:49.044 +0800
OS Version: Mac OS X 10.9 (13A603)
Report Version: 11
Anonymous UUID: A496DC68-476F-589B-352C-303FA1CD2355
Sleep/Wake UUID: F65E37D7-0AFF-4867-9538-8736C8F0B908
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
iPhone Simulator (external launch) , iPhone OS 7.0.3 (unknown/11B508)
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x02e94952 __pthread_kill + 10
1 libsystem_pthread.dylib 0x02e58167 pthread_kill + 101
2 libsystem_sim_c.dylib 0x02b6ae12 abort + 127
3 ScreenReaderCore 0x03db5853 SCRCUncaughtExceptionHandler + 111
4 CoreFoundation 0x005f7a1d __handleUncaughtException + 749
5 libobjc.A.dylib 0x0224ab5c _objc_terminate() + 100
6 libc++abi.dylib 0x02a5bf60 std::__terminate(void (*)()) + 14
7 libc++abi.dylib 0x02a5b97d __cxa_throw + 116
8 libobjc.A.dylib 0x0224a9cd objc_exception_throw + 323
9 CoreFoundation 0x005673bb +[NSException raise:format:] + 139
10 UIAutomation 0x00cbdf54 +[UIAXElement initializeAccessibility] + 668
11 UIAutomation 0x00cc1361 +[UIAXElement uiaxSystemWideElement] + 37
12 UIAutomation 0x00cd76d3 -[UIATarget init] + 317
13 UIAutomation 0x00cd758a +[UIATarget localTarget] + 65
14 ScriptAgent 0x0000ae25 0x1000 + 40485
15 ScriptAgent 0x00005e85 0x1000 + 20101
16 ScriptAgent 0x00008887 0x1000 + 30855
17 libdyld.dylib 0x02d5e70d start + 1
So I replaced iPhoneSimulator7.0.sdk with the one in Xcode 5.0, then this issue is solved.
But I am not sure whether this replacement has any side effect.

Resources