Crash on launch (SIGTRAP) App Review only

Here's a crash log from an app review rejection that I've been unable to reproduce. I've resorted to trial and error to narrow it down. The app passes review without some new button images and a bit of rearranging in the storyboard and crashes with it.


Here's the crash log:


{"app_name":"wallPaint","timestamp":"2018-07-13 10:13:56.06 -0700","app_version":"1.02","slice_uuid":"3c3820a8-cafe-39d1-8c89-31e6ff5c3d47","adam_id":1373908946,"build_version":"1","bundleID":"com.capella.wallpaint","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 11.4 (15F79)","incident_id":"B446EA50-D34D-4BD3-AA8D-455CE729D07F","name":"wallPaint"}

Incident Identifier: B446EA50-D34D-4BD3-AA8D-455CE729D07F

CrashReporter Key: 7bb21d19dfff187389b4b5f6efc502752f1fd68a

Hardware Model: xxx

Process: wallPaint [899]

Path: /private/var/containers/Bundle/Application/96BA792D-996A-47C8-AEF5-9429EE15A2D0/wallPaint.app/wallPaint

Identifier: com.capella.wallpaint

Version: 1 (1.02)

Code Type: ARM-64 (Native)

Role: Foreground

Parent Process: launchd [1]

Coalition: com.capella.wallpaint [663]



Date/Time: 2018-07-13 10:13:55.9356 -0700

Launch Time: 2018-07-13 10:13:55.7538 -0700

OS Version: iPhone OS 11.4 (15F79)

Baseband Version: 6.60.00

Report Version: 104


Exception Type: EXC_BREAKPOINT (SIGTRAP)

Exception Codes: 0x0000000000000001, 0x0000000101274d3c

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 libswiftCore.dylib 0x0000000101274d3c 0x1010c4000 + 1772860

1 libswiftCore.dylib 0x0000000101274d3c 0x1010c4000 + 1772860

2 libswiftCore.dylib 0x000000010110c094 0x1010c4000 + 295060

3 wallPaint 0x0000000100e521c4 @objc AppDelegate.applicationWillResignActive(_:) + 221636 (AppDelegate.swift:0)

4 UIKit 0x000000018aeb2dbc -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 408

5 UIKit 0x000000018aeb21c4 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3484

6 UIKit 0x000000018ae7f5e0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1680

7 UIKit 0x000000018b4afb1c __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 784

8 UIKit 0x000000018ae7edd0 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160

9 UIKit 0x000000018ae7ec6c -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 240

10 UIKit 0x000000018ae7dafc -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 724

11 UIKit 0x000000018bb1384c __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 296

12 UIKit 0x000000018ae7d1ec -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 432

13 UIKit 0x000000018b8f8ac8 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220

14 UIKit 0x000000018ba46bf8 _performActionsWithDelayForTransitionContext + 112

15 UIKit 0x000000018ae7cc0c -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 248

16 UIKit 0x000000018ae7c5a8 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 368

17 UIKit 0x000000018ae795e0 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540

18 UIKit 0x000000018ae79330 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 364

19 FrontBoardServices 0x0000000183aa7470 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 364

20 FrontBoardServices 0x0000000183aafd6c __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 224

21 libdispatch.dylib 0x0000000180b98a60 _dispatch_client_callout + 16

22 libdispatch.dylib 0x0000000180ba0170 _dispatch_block_invoke_direct$VARIANT$mp + 224

23 FrontBoardServices 0x0000000183adb878 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36

24 FrontBoardServices 0x0000000183adb51c -[FBSSerialQueue _performNext] + 404

25 FrontBoardServices 0x0000000183adbab8 -[FBSSerialQueue _performNextFromRunLoopSource] + 56

26 CoreFoundation 0x000000018124f404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24

27 CoreFoundation 0x000000018124ec2c __CFRunLoopDoSources0 + 276

28 CoreFoundation 0x000000018124c79c __CFRunLoopRun + 1204

29 CoreFoundation 0x000000018116cda8 CFRunLoopRunSpecific + 552

30 GraphicsServices 0x0000000183151020 GSEventRunModal + 100

31 UIKit 0x000000018b189758 UIApplicationMain + 236

32 wallPaint 0x0000000100e251f4 main + 37364 (ViewController+Actions.swift:12)

33 libdyld.dylib 0x0000000180bfdfc0 start + 4


Thread 1:

0 libsystem_kernel.dylib 0x0000000180d2dd84 __workq_kernreturn + 8

1 libsystem_pthread.dylib 0x0000000180ecc0a0 _pthread_wqthread + 1420

2 libsystem_pthread.dylib 0x0000000180ecbb08 start_wqthread + 4


Thread 2:

0 libsystem_pthread.dylib 0x0000000180ecbb04 start_wqthread + 0


Thread 3:

0 libsystem_kernel.dylib 0x0000000180d2dd84 __workq_kernreturn + 8

1 libsystem_pthread.dylib 0x0000000180ecc0a0 _pthread_wqthread + 1420

2 libsystem_pthread.dylib 0x0000000180ecbb08 start_wqthread + 4


Thread 4:

0 libsystem_kernel.dylib 0x0000000180d2dd84 __workq_kernreturn + 8

1 libsystem_pthread.dylib 0x0000000180ecc0a0 _pthread_wqthread + 1420

2 libsystem_pthread.dylib 0x0000000180ecbb08 start_wqthread + 4


Thread 5 name: com.apple.uikit.eventfetch-thread

Thread 5:

0 libsystem_kernel.dylib 0x0000000180d0be08 mach_msg_trap + 8

1 libsystem_kernel.dylib 0x0000000180d0bc80 mach_msg + 72

2 CoreFoundation 0x000000018124ee40 __CFRunLoopServiceMachPort + 196

3 CoreFoundation 0x000000018124c908 __CFRunLoopRun + 1568

4 CoreFoundation 0x000000018116cda8 CFRunLoopRunSpecific + 552

5 Foundation 0x0000000181be1674 -[NSRunLoop+ 34420 (NSRunLoop) runMode:beforeDate:] + 304

6 Foundation 0x0000000181be14dc -[NSRunLoop+ 34012 (NSRunLoop) runUntilDate:] + 84

7 UIKit 0x000000018ae6e768 -[UIEventFetcher threadMain] + 136

8 Foundation 0x0000000181cf1efc __NSThread__start__ + 1040

9 libsystem_pthread.dylib 0x0000000180ecd220 _pthread_body + 272

10 libsystem_pthread.dylib 0x0000000180ecd110 _pthread_body + 0

11 libsystem_pthread.dylib 0x0000000180ecbb10 thread_start + 4


Thread 6:

0 libsystem_kernel.dylib 0x0000000180d2dd84 __workq_kernreturn + 8

1 libsystem_pthread.dylib 0x0000000180ecc0a0 _pthread_wqthread + 1420

2 libsystem_pthread.dylib 0x0000000180ecbb08 start_wqthread + 4


Thread 7:

0 libsystem_pthread.dylib 0x0000000180ecbb04 start_wqthread + 0


Thread 8:

0 libsystem_pthread.dylib 0x0000000180ecbb04 start_wqthread + 0


Thread 0 crashed with ARM Thread State (64-bit):

x0: 0x00000001016e9200 x1: 0x00000001c8095310 x2: 0x0000000000000008 x3: 0x0000000180d7506c

x4: 0x0000000000000011 x5: 0x0000000000000020 x6: 0x0082000004210103 x7: 0x00000000000010ff

x8: 0x00000001c80952c0 x9: 0x0000000000000000 x10: 0x0000000000000004 x11: 0xbaddc0dedeadbead

x12: 0x0000000000000001 x13: 0x0000000000000002 x14: 0x0000000000000000 x15: 0x000000000000598f

x16: 0x0000000180ec78cc x17: 0x0000000020000000 x18: 0x0000000000000000 x19: 0x000000000000003d

x20: 0x0000000100e59350 x21: 0x0000000000000000 x22: 0x0000000000000026 x23: 0x0000000100e59390

x24: 0x0000000000000011 x25: 0x0000000000000002 x26: 0x0000000100e58c42 x27: 0x00000001c8095310

x28: 0x0000000000000000 fp: 0x000000016efe17a0 lr: 0x0000000101274d3c

sp: 0x000000016efe1740 pc: 0x0000000101274d3c cpsr: 0x60000000

Answered by Tim R in 322812022

Ok, I've found the problem through a long process of trial and error, waiting for app aproval or rejection after each trial. I had updated some of my images by dragging and dropping the new version from finder to each of the images in Xcode. This works fine as long as the image is named exactly the same thing as the old one. In my case I had a different name, which causes a crash on launch for the app review team. The strange thing is for me it never crashed on launch whether running in the debugger, a release build, from testflight, etc. I'm not sure why that would be the case.


Here's an example of what happens to the imageset when you drag and drop a file of a different name. I have an image called "Restart", so my Assets.xcassets folder contains this folder with these three files:


Restart.imageset

Contents.json

Restart@3x.png

Restart@2x.png


After copying a new version of the file called "Reset", it looks like this:


Restart.imageset

Contents.json

Reset@3x.png

Reset@2x.png


The Contents.json file looks like this:


{

"images" : [

{

"idiom" : "universal",

"scale" : "1x"

},

{

"idiom" : "universal",

"filename" : "Reset@2x.png",

"scale" : "2x"

},

{

"idiom" : "universal",

"filename" : "Reset@3x.png",

"scale" : "3x"

}

],

"info" : {

"version" : 1,

"author" : "xcode"

}

}


Something about the app review process doesn't like that the folder is named Restart.imageset but the files in it are called Reset@....

Accepted Answer

Ok, I've found the problem through a long process of trial and error, waiting for app aproval or rejection after each trial. I had updated some of my images by dragging and dropping the new version from finder to each of the images in Xcode. This works fine as long as the image is named exactly the same thing as the old one. In my case I had a different name, which causes a crash on launch for the app review team. The strange thing is for me it never crashed on launch whether running in the debugger, a release build, from testflight, etc. I'm not sure why that would be the case.


Here's an example of what happens to the imageset when you drag and drop a file of a different name. I have an image called "Restart", so my Assets.xcassets folder contains this folder with these three files:


Restart.imageset

Contents.json

Restart@3x.png

Restart@2x.png


After copying a new version of the file called "Reset", it looks like this:


Restart.imageset

Contents.json

Reset@3x.png

Reset@2x.png


The Contents.json file looks like this:


{

"images" : [

{

"idiom" : "universal",

"scale" : "1x"

},

{

"idiom" : "universal",

"filename" : "Reset@2x.png",

"scale" : "2x"

},

{

"idiom" : "universal",

"filename" : "Reset@3x.png",

"scale" : "3x"

}

],

"info" : {

"version" : 1,

"author" : "xcode"

}

}


Something about the app review process doesn't like that the folder is named Restart.imageset but the files in it are called Reset@....

Hello @Tim R, Thank you for posting this. I wanted to reply, as I had the same issue, "Crash on launch (SIGTRAP)." The solution for me was not above, but reading through your post jogged my memory, and led to the sollution that worked for me. I thought you or others might find this sollution useful.


I imported a .DAE file to use in an ARKit scene. The first time I built the project to a local device, it crashed.


After days of toiling, I figured out that Xcode does not like Extended Attributes in source files, in my case the supporting file textures from the .DAE modle, both .JPG and .PNG image files.


Extended Attributes are metadata components that can be unique to specific files and file types on Mac OS. Think of f-stop and shutter speed or location information embeded by a camera. I suspect that these attributes could lead to a security risk.


There was nothing out of the ordinary about how my file textures were created. I simply saved them in Photoshop.


With a little research, I found a comand that can be exicuted in Terminal to remove all Extended Attributes from these files.


xattr -lr


xattr -c /path_to_file/file_name.jpg (drag files to Terminal window for pathname)


Once I repeated this comand for all of the file textures, the project built successfully.


I kind of forgot about this with subsiqent projects, becase it only occured intermitantly. But when I tryed to publish one of these projects to the App Store, I recieved the "Crash on launch (SIGTRAP)" error.


After reading your account, I remembered this and stripped the Extended Attributes from all the image files, and the project no longer crashed at App Review. This was the only change I made.


Here is an article about Extended Attributes, http://osxdaily.com/2018/05/03/view-remove-extended-attributes-file-mac/.


Good luck!

Crash on launch (SIGTRAP) App Review only
 
 
Q