sentry-cli: Debug files upload crashes when running as Xcode build phase on 2.21.4

Environment

sentry-cli 2.21.4, macOS 14.1 (23B2073)

Steps to Reproduce

Running a standard version of the Xcode build phase script to upload dSYM files.

Expected/Actual Result

Expected: the upload to finish successfully. Actual: sentry-cli is started but never finished. Turns out it crashed midway.

I can reproduce the crash on 2.21.4 reliably, when running the Xcode build phase. Running the cli from terminal works correctly though.

Reverted back to 2.20.7 and it no longer crashes.

Logs

When filing a bug report, please attach debug logs, either by using --log-level=debug flag or SENTRY_LOG_LEVEL=debug environment variable.

Crash log from my machine:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               sentry-cli [71709]
Path:                  /usr/local/bin/sentry-cli
Identifier:            sentry-cli
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
Responsible:           Xcode [36652]
User ID:               501

Date/Time:             2023-11-13 16:48:39.1271 -0800
OS Version:            macOS 14.1 (23B2073)
Report Version:        12
Anonymous UUID:        95DC8AD3-070D-2C23-7F26-342E67361814

Sleep/Wake UUID:       3659381C-2547-48D7-89D1-11A8685D58E3

Time Awake Since Boot: 120000 seconds
Time Since Wake:       5385 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.root.user-interactive-qos

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000110
Exception Codes:       0x0000000000000001, 0x0000000000000110

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [71709]

VM Region Info: 0x110 is not in any region.  Bytes before following region: 4309450480
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      100dd0000-1013ec000    [ 6256K] r-x/r-x SM=COW  ...in/sentry-cli

Application Specific Information:
*** single-threaded process forked ***
crashed on child side of fork pre-exec


Thread 0 Crashed::  Dispatch queue: com.apple.root.user-interactive-qos
0   libdispatch.dylib             	       0x1866db454 _dispatch_apply_with_attr_f + 1160
1   libdispatch.dylib             	       0x1866db650 dispatch_apply + 96
2   CoreFoundation                	       0x186a7fe48 __103-[CFPrefsSearchListSource synchronouslySendSystemMessage:andUserMessage:andDirectMessage:replyHandler:]_block_invoke.52 + 132
3   CoreFoundation                	       0x186906b54 CFPREFERENCES_IS_WAITING_FOR_SYSTEM_AND_USER_CFPREFSDS + 100
4   CoreFoundation                	       0x186a7f040 -[CFPrefsSearchListSource synchronouslySendSystemMessage:andUserMessage:andDirectMessage:replyHandler:] + 232
5   CoreFoundation                	       0x186904e0c -[CFPrefsSearchListSource alreadylocked_generationCountFromListOfSources:count:] + 232
6   CoreFoundation                	       0x186904b14 -[CFPrefsSearchListSource alreadylocked_getDictionary:] + 484
7   CoreFoundation                	       0x186904688 -[CFPrefsSearchListSource alreadylocked_copyValueForKey:] + 172
8   CoreFoundation                	       0x1869045bc -[CFPrefsSource copyValueForKey:] + 52
9   CoreFoundation                	       0x186904570 __76-[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]_block_invoke + 32
10  CoreFoundation                	       0x1868fdbbc __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 376
11  CoreFoundation                	       0x186a806f0 -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 384
12  CoreFoundation                	       0x1868fd498 -[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:] + 156
13  CoreFoundation                	       0x1868fd3c0 _CFPreferencesCopyAppValueWithContainerAndConfiguration + 112
14  Security                      	       0x189876588 __SSLCreateContextWithRecordFuncs_block_invoke + 48
15  libdispatch.dylib             	       0x1866c7910 _dispatch_client_callout + 20
16  libdispatch.dylib             	       0x1866c914c _dispatch_once_callout + 32
17  Security                      	       0x1898762d0 SSLCreateContextWithRecordFuncs + 416
18  Security                      	       0x189876064 SSLCreateContext + 32
19  sentry-cli                    	       0x1011aeb54 0x100dd0000 + 4057940
20  sentry-cli                    	       0x1011acf28 0x100dd0000 + 4050728
21  sentry-cli                    	       0x1011806ac 0x100dd0000 + 3868332
22  sentry-cli                    	       0x10117c860 0x100dd0000 + 3852384
23  sentry-cli                    	       0x10117aa20 0x100dd0000 + 3844640
24  sentry-cli                    	       0x101199458 0x100dd0000 + 3970136
25  sentry-cli                    	       0x101199078 0x100dd0000 + 3969144
26  sentry-cli                    	       0x1011867f0 0x100dd0000 + 3893232
27  sentry-cli                    	       0x100ee1ae8 0x100dd0000 + 1121000
28  sentry-cli                    	       0x100e24688 0x100dd0000 + 345736
29  sentry-cli                    	       0x100e25d20 0x100dd0000 + 351520
30  sentry-cli                    	       0x100e1dc48 0x100dd0000 + 318536
31  sentry-cli                    	       0x100e204e0 0x100dd0000 + 328928
32  sentry-cli                    	       0x100e716d0 0x100dd0000 + 661200
33  sentry-cli                    	       0x100e714d8 0x100dd0000 + 660696
34  sentry-cli                    	       0x100e75160 0x100dd0000 + 676192
35  sentry-cli                    	       0x100e2e0a4 0x100dd0000 + 385188
36  sentry-cli                    	       0x100e3b740 0x100dd0000 + 440128
37  sentry-cli                    	       0x100de99a4 0x100dd0000 + 104868
38  sentry-cli                    	       0x100e6b034 0x100dd0000 + 634932
39  sentry-cli                    	       0x100de2754 0x100dd0000 + 75604
40  sentry-cli                    	       0x100e8d488 0x100dd0000 + 775304
41  dyld                          	       0x1864f90e0 start + 2360

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Reactions: 1
  • Comments: 25 (14 by maintainers)

Most upvoted comments

We just released version 2.23.0, which contains the fix for this issue

Update: it appears that the https://github.com/getsentry/sentry-cli/commit/40f86f64042626206a5731a74e3098e066b75409 commit’s lto = true line is causing the problems in Xcode Cloud. Sentry CLI appears to run correctly in Xcode Cloud when compiled with only this line removed.

I’ve also been having issues with the build phase never completing beginning with 2.21.3 when building via Xcode Cloud, eventually leading to a build timeout, but haven’t managed to grab any useful logs so far. 2.21.2 was working fine

As I mentioned above, we just released version 2.23.0 which should fix the bug in Xcode Cloud.

My local issues running with react-native run-ios are solved when I force install of 2.23.0 via yarn resolutions! So as soon as a new version of sentry-react-native is out pinning that version, it should hopefully work for everyone!

What sticks out here is that both @tianskylan and the Xcode Cloud machine are on macOS 14, whereas I’m still on 13. We’ll try to reproduce this under macOS 14.