Sometimes my apps crash on launch at _libsecinit_appsandbox.cold.6

I first started observing this behaviour through the crash logs of one of my App Store apps which are downloaded by Xcode. Then 3 days ago the same crash happened when launching one of my other apps on my own Mac. On the next try, the app launched correctly.

The crash logs don't show any of my app's symbols, only a single thread that does something with libsecinit.

I have no idea what the problem is, and since these crashes are also downloaded by Xcode, one would get the impression it’s a fault in my programming… but without any hint as to what I’m doing wrong, I have no chance to fix it, and so I get the feeling that it’s actually a macOS bug.

I created FB22712334.

Answered by DTS Engineer in 886997022

I discuss the most common causes of problems like this in Resolving App Sandbox Inheritance Problems. However, those are all 100% reproducible. A given executable will either crash on launch or not. An intermittent problem like this is much less common.

The crash report you posted has this:

The code signature is not valid: Impossibile completare l’operazione. (Errore OSStatus -67034).

where error -67034 is errSecCSStaticCodeChanged. That suggests that you’re hitting the issue described in Updating Mac Software, or something like it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

What do you find if you ask a search engine about 'Termination Reason: Namespace SIGNAL, Code 5, Trace/BPT trap: 5'?

Well, for instance https://developer.apple.com/documentation/xcode/identifying-the-cause-of-common-crashes says

If the Swift runtime encounters a programming error, the runtime catches the error and intentionally crashes the app.

But again the question is, if this is really a programming error on my side, how do I find it?

I discuss the most common causes of problems like this in Resolving App Sandbox Inheritance Problems. However, those are all 100% reproducible. A given executable will either crash on launch or not. An intermittent problem like this is much less common.

The crash report you posted has this:

The code signature is not valid: Impossibile completare l’operazione. (Errore OSStatus -67034).

where error -67034 is errSecCSStaticCodeChanged. That suggests that you’re hitting the issue described in Updating Mac Software, or something like it.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

That suggests that you’re hitting the issue described in Updating Mac Software, or something like it.

That's weird. My apps do include a software updater (Sparkle) for the versions I sell on my website, but for the App Store versions, the updater is not included. I have separate Xcode targets for the two versions, and the App Store target (the one for which Xcode downloads the crash reports) doesn't even link to the updater. And when running the apps locally (including when the only crash on my Mac happened, which wasn't in Xcode, but just launching the debug build from Spotlight), I always run the App Store version.

If I were in your shoes I’d try to capture a log snapshot — ideally a sysdiagnose log, which contains that snapshot — immediately after reproducing the problem, and then look in the system log for background as to why you got this error. Your Friend the System Log has lots of info about the system log.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Sometimes my apps crash on launch at _libsecinit_appsandbox.cold.6
 
 
Q