`notarytool` crashes when run from Jenkins job

For a few days now, notarytool is crashing whenever I'm running one of my Jenkins jobs where notarytool is called from a shell script.

Based on the debug log, the crash appears round at the time that the upload of the binary to be notarized is attempted. When a runloop should be started to run the upload via an async http request:

Debug [TASKMANAGER] Starting Task Manager loop to wait for asynchronous HTTP calls.

The specific job setup looks like this: Jenkins Job › Run shell script phase › Shell script › Second shell script › notarytool call.

Running the notarytool directly from Terminal works and completes as expected.

Crashlog Snippet:

Path:                  /Applications/Xcode-14.2.app/Contents/Developer/usr/bin/notarytool
Identifier:            notarytool
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        launchd [1]
Responsible:           java [428]

OS Version:            macOS 12.6.2 (21G320)

Crashed Thread:        1  Dispatch queue: com.apple.NSURLSession-work

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 4 Illegal instruction: 4
Terminating Process:   exc handler [18889]

Application Specific Signatures:
API Misuse

Thread 1 Crashed::  Dispatch queue: com.apple.NSURLSession-work
0   libxpc.dylib                  	    0x7ff81aa2720e _xpc_api_misuse + 117
1   libxpc.dylib                  	    0x7ff81aa128bb xpc_connection_set_target_uid + 193
2   AppSSOCore                    	    0x7ff8264facaa -[SOServiceConnection _connectToService] + 533
3   AppSSOCore                    	    0x7ff8264faa6f -[SOServiceConnection initWithQueue:] + 102
4   AppSSOCore                    	    0x7ff8264fa98a -[SOClient init] + 122
5   AppSSOCore                    	    0x7ff8264fa855 -[SOConfigurationClient init] + 180
6   AppSSOCore                    	    0x7ff8264fa78c __38+[SOConfigurationClient defaultClient]_block_invoke + 16
7   libdispatch.dylib             	    0x7ff81ab1c317 _dispatch_client_callout + 8
8   libdispatch.dylib             	    0x7ff81ab1d4fa _dispatch_once_callout + 20
9   AppSSOCore                    	    0x7ff8264fa77a +[SOConfigurationClient defaultClient] + 117
10  AppSSOCore                    	    0x7ff8264fa6af +[SOAuthorizationCore _canPerformAuthorizationWithURL:responseCode:callerBundleIdentifier:useInternalExtensions:] + 130
11  AppSSOCore                    	    0x7ff8264f9df0 appSSO_willHandle + 64

Back in January the exact same setup was still working. Same macOS version. Xcode version might have been different.

Would really appreciate some help since for now re-implementing notarytool appears to be the only solution.

Well, that’s weird. I’ve literally never seen notarytool crash before.

Regardless of the context, notarytool shouldn’t crash. Please grab the notarytool from the latest Xcode [1] and try to reproduce the problem with that. If it still happens, file a bug, including a sysdiagnose log taken shortly after you see the problem, and then post your bug number here.

Share and Enjoy

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

[1] Apple wrote notarytool with this in mind. It’s completely self contained, so you can extract notarytool from a modern Xcode and run it on an older system.

Thank you for looking into this!

Unfortunately I think we already have the newest Xcode with 14.2. Path to notarytool is /Applications/Xcode-14.2.app/Contents/Developer/usr/bin/notarytool It appears.

Fortunately notarytool is not hard to re-implement, so making headway with a python version which should hopefully not crash then.

`notarytool` crashes when run from Jenkins job
 
 
Q