Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: error : strip exited with code 139 #19157

Closed
dotMorten opened this issue Oct 11, 2023 · 104 comments
Closed

Regression: error : strip exited with code 139 #19157

dotMorten opened this issue Oct 11, 2023 · 104 comments
Labels
bug If an issue is a bug or a pull request a bug fix
Milestone

Comments

@dotMorten
Copy link
Contributor

dotMorten commented Oct 11, 2023

Please file a feedback ticket with Apple if you run into this issue

See this comment for more information: #19157 (comment)


Steps to Reproduce

  1. Create a new .NET MAUI App (net8 rc2)
  2. Add package Esri.ArcGISRuntime v200.2.0 <PackageReference Include="Esri.ArcGISRuntime" Version="200.2.0" />
  3. Build and deploy to a physical device with XCode 15 installed (This didn't happen with xcode 14)
  4. Observe build error:
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.8968-net8-rc2\tools\msbuild\iOS\Xamarin.Shared.targets(2750,3): error : strip exited with code 139

Note that if you skip step 2, there is no issue. Something about this library causes the stripper to crash.

Workaround

Add

    <PropertyGroup >
        <MtouchNoSymbolStrip Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">True</MtouchNoSymbolStrip>
    </PropertyGroup>

This is quite a showstopper for us, as this prevents any of our users from using our nuget packages.
We are fairly certain the issue is connected to the XCode 15 upgrade.

Expected Behavior

App builds and deploys.

Actual Behavior

Crash in the stripper

Environment

VS Preview 17.8 p3+remote macos host, or just .NET 8 RC2 commandline on macos with XCode.
We have reproduced on multiple machines, Windows and Mac.

Build Logs

1>/usr/bin/ditto /Users/mort5161/Library/Caches/Xamarin/mtbs/builds/MauiApp10/45615ce3ae59fa5d7b49616b08a491ce70088b1a274c6bd0fc1cb4b5a8be76d0/C:/Users/mort5161/.nuget/packages/esri.arcgisruntime.runtimes.ios/200.2.0/framework/ios-arm64/native/ArcGIS-arm64.framework/ /Users/mort5161/Library/Caches/Xamarin/mtbs/builds/MauiApp10/45615ce3ae59fa5d7b49616b08a491ce70088b1a274c6bd0fc1cb4b5a8be76d0/bin/Debug/net8.0-ios/ios-arm64/device-builds/iphone11.6-16.7/MauiApp10.app/Frameworks/ArcGIS-arm64.framework --arch arm64
1>/usr/bin/ditto /Users/mort5161/Library/Caches/Xamarin/mtbs/builds/MauiApp10/45615ce3ae59fa5d7b49616b08a491ce70088b1a274c6bd0fc1cb4b5a8be76d0/C:/Users/mort5161/.nuget/packages/esri.arcgisruntime.runtimes.ios/200.2.0/framework/ios-arm64/native/Runtimecore.framework/ /Users/mort5161/Library/Caches/Xamarin/mtbs/builds/MauiApp10/45615ce3ae59fa5d7b49616b08a491ce70088b1a274c6bd0fc1cb4b5a8be76d0/bin/Debug/net8.0-ios/ios-arm64/device-builds/iphone11.6-16.7/MauiApp10.app/Frameworks/Runtimecore.framework --arch arm64
1>Tool xcrun execution finished (exit code = 139).
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.8968-net8-rc2\tools\msbuild\iOS\Xamarin.Shared.targets(2750,3): error : strip exited with code 139
1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.8968-net8-rc2\tools\msbuild\iOS\Xamarin.Shared.targets(2750,3): error :

Example Project (If Possible)

Repro project. Just try and deploy to an iPhone device:
MauiArcGISApp1.zip

@rolfbjarne
Copy link
Member

I can reproduce the problem, and it seems to be a buffer overrun in the strip command. I'm still investigating to figure out if this is something we can work around somehow.

@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Oct 12, 2023
@rolfbjarne rolfbjarne added this to the .NET 8 milestone Oct 12, 2023
@madmapper
Copy link

Thanks for spotting this @dotMorten - we are in the middle of updating an app with Runtime 200 and this was driving me nuts

@adamdeets-hdr
Copy link

Seeing the same issue.

@madmapper
Copy link

FYI unchecking "Strip native debugging symbols" in the Project Properties accomplishes the same thing and everything seems to work as expected.
image

@dotMorten
Copy link
Contributor Author

FYI unchecking "Strip native debugging symbols" in the Project Properties accomplishes the same thing

Yup that's the same as setting MtouchNoSymbolStrip (but the designer always does it bad with weird conditions so I like doing it in the project directly).
Just note that this is not a workaround you really want - this should be considered a temporary fix to unblock our work, until this issue has been addressed.

A better workaround is probably to move back to xcode 14 for now.

@dotMorten
Copy link
Contributor Author

Just posting the comments from Discord triage here (thanks @rolfbjarne):

Crash report using locally built strip (click to expand)
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               strip [86963]
Path:                  /Users/USER/Library/Developer/Xcode/DerivedData/cctools-ecihfcsnwddndhafbgntrrwrjzti/Build/Products/Debug/strip
Identifier:            strip
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        zsh [77528]
Responsible:           iTerm2 [1785]
User ID:               501

Date/Time:             2023-10-12 16:47:41.8244 +0200
OS Version:            macOS 13.6 (22G120)
Report Version:        12
Anonymous UUID:        F22C0F06-0F16-E475-C0CB-264A0FF4F6A3

Sleep/Wake UUID:       231EDA49-965B-462F-B819-4068587485EA

Time Awake Since Boot: 160000 seconds
Time Since Wake:       32896 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

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

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

VM Region Info: 0x2fd865d7c is not in any region.  Bytes after previous region: 2835570045  Bytes before following region: 54802358916
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      unused __TEXT               25482c000-254830000    [   16K] r--/r-- SM=COW  ...ed lib __TEXT
--->  GAP OF 0xd6b7d0000 BYTES
      commpage (reserved)         fc0000000-1000000000   [  1.0G] ---/--- SM=NUL  ...(unallocated)

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   strip                         	       0x102967bd0 strip_symtab + 16332 (strip.c:4334)
1   strip                         	       0x10295fee0 strip_object + 4080 (strip.c:1421)
2   strip                         	       0x10295ed8c strip_arch + 3296 (strip.c:1047)
3   strip                         	       0x10295dc70 strip_file + 268 (strip.c:746)
4   strip                         	       0x10295d6fc main + 3404 (strip.c:670)
5   dyld                          	       0x180bfbf28 start + 2236


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000001   x1: 0x0000000148110001   x2: 0x0000000000000018   x3: 0xffffffffffffff88
    x4: 0x000000000000005f   x5: 0x00000000000000d7   x6: 0x0000000000000001   x7: 0x0000000000000bd0
    x8: 0x0000000000002252   x9: 0x0000000158008000  x10: 0x000000006961775f  x11: 0x0000000000031a88
   x12: 0x0000000000000018  x13: 0x0000000000006360  x14: 0x0000000102a4ec78  x15: 0x0000000000000000
   x16: 0x0000000180f7fb30  x17: 0x00000001e0b03eb8  x18: 0x0000000000000000  x19: 0x000000010295c9b0
   x20: 0x00000001029c4000  x21: 0x00000001029c5910  x22: 0x000000016d4a30d0  x23: 0x0000000180c763c6
   x24: 0x000000016d4a3050  x25: 0x0000000000000001  x26: 0x0000000000000000  x27: 0x0000000000000000
   x28: 0x0000000000000000   fp: 0x000000016d4a2750   lr: 0x6e4b000102967adc
    sp: 0x000000016d4a2530   pc: 0x0000000102967bd0 cpsr: 0x60001000
   far: 0x00000002fd865d7c  esr: 0x92000046 (Data Abort) byte write Translation fault

Binary Images:
       0x10295c000 -        0x1029abfff strip (*) <8c1ad0f9-0260-3651-a493-86eaa10b50b0> /Users/USER/Library/Developer/Xcode/DerivedData/cctools-ecihfcsnwddndhafbgntrrwrjzti/Build/Products/Debug/strip
       0x180bf6000 -        0x180c84587 dyld (*) <49204446-242b-3d1e-9704-32f8ac99723e> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 29
    thread_create: 0
    thread_set_state: 236

VM Region Summary:
ReadOnly portion of Libraries: Total=807.8M resident=0K(0%) swapped_out_or_unallocated=807.8M(100%)
Writable regions: Total=786.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=786.4M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                   32K        1 
MALLOC                           154.2M       14 
MALLOC guard page                   96K        5 
MALLOC_MEDIUM (reserved)         240.0M        2         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
STACK GUARD                       56.0M        1 
Stack                             8176K        1 
__AUTH                              46K       11 
__AUTH_CONST                        72K       38 
__DATA                             193K       37 
__DATA_CONST                       199K       40 
__DATA_DIRTY                        78K       22 
__LINKEDIT                       802.3M        2 
__OBJC_RO                         66.4M        1 
__OBJC_RW                         2012K        1 
__TEXT                            5600K       42 
dyld private memory                272K        2 
mapped file                       12.2M        1 
shared memory                       16K        1 
===========                     =======  ======= 
TOTAL                              1.7G      223 
TOTAL, minus reserved VM space     1.1G      223 



-----------
Full Report
-----------

{"app_name":"strip","timestamp":"2023-10-12 16:47:42.00 +0200","app_version":"","slice_uuid":"8c1ad0f9-0260-3651-a493-86eaa10b50b0","build_version":"","platform":1,"share_with_app_devs":1,"is_first_party":1,"bug_type":"309","os_version":"macOS 13.6 (22G120)","roots_installed":0,"incident_id":"DB17380A-FB8B-4C80-8089-0FC2724F5519","name":"strip"}
{
  "uptime" : 160000,
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "Mac14,12",
  "coalitionID" : 959,
  "osVersion" : {
    "train" : "macOS 13.6",
    "build" : "22G120",
    "releaseType" : "User"
  },
  "captureTime" : "2023-10-12 16:47:41.8244 +0200",
  "incident" : "DB17380A-FB8B-4C80-8089-0FC2724F5519",
  "pid" : 86963,
  "translated" : false,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2023-10-12 16:47:41.7251 +0200",
  "procStartAbsTime" : 3960627086216,
  "procExitAbsTime" : 3960629463314,
  "procName" : "strip",
  "procPath" : "\/Users\/USER\/Library\/Developer\/Xcode\/DerivedData\/cctools-ecihfcsnwddndhafbgntrrwrjzti\/Build\/Products\/Debug\/strip",
  "parentProc" : "zsh",
  "parentPid" : 77528,
  "coalitionName" : "com.googlecode.iterm2",
  "crashReporterKey" : "F22C0F06-0F16-E475-C0CB-264A0FF4F6A3",
  "responsiblePid" : 1785,
  "responsibleProc" : "iTerm2",
  "codeSigningID" : "strip-555549448c1ad0f902603651a49386eaa10b50b0",
  "codeSigningTeamID" : "",
  "codeSigningFlags" : 570425861,
  "codeSigningValidationCategory" : 10,
  "codeSigningTrustLevel" : 0,
  "wakeTime" : 32896,
  "sleepWakeUUID" : "231EDA49-965B-462F-B819-4068587485EA",
  "sip" : "enabled",
  "vmRegionInfo" : "0x2fd865d7c is not in any region.  Bytes after previous region: 2835570045  Bytes before following region: 54802358916\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      unused __TEXT               25482c000-254830000    [   16K] r--\/r-- SM=COW  ...ed lib __TEXT\n--->  GAP OF 0xd6b7d0000 BYTES\n      commpage (reserved)         fc0000000-1000000000   [  1.0G] ---\/--- SM=NUL  ...(unallocated)",
  "exception" : {"codes":"0x0000000000000001, 0x00000002fd865d7c","rawCodes":[1,12843375996],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x00000002fd865d7c"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":86963},
  "vmregioninfo" : "0x2fd865d7c is not in any region.  Bytes after previous region: 2835570045  Bytes before following region: 54802358916\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      unused __TEXT               25482c000-254830000    [   16K] r--\/r-- SM=COW  ...ed lib __TEXT\n--->  GAP OF 0xd6b7d0000 BYTES\n      commpage (reserved)         fc0000000-1000000000   [  1.0G] ---\/--- SM=NUL  ...(unallocated)",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":236,"task_for_pid":29},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":3477797,"threadState":{"x":[{"value":1},{"value":5504040961},{"value":24},{"value":18446744073709551496},{"value":95},{"value":215},{"value":1},{"value":3024},{"value":8786},{"value":5771395072},{"value":1767995231},{"value":203400},{"value":24},{"value":25440},{"value":4339330168},{"value":0},{"value":6458702640,"symbolLocation":0,"symbol":"_platform_strcmp"},{"value":8064614072},{"value":0},{"sourceLine":407,"value":4338338224,"sourceFile":"strip.c","symbol":"main","symbolLocation":0},{"value":4338761728},{"value":4338768144},{"value":6128546000},{"value":6455518150},{"value":6128545872},{"value":1},{"value":0},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":7947445971763755740},"cpsr":{"value":1610616832},"fp":{"value":6128543568},"sp":{"value":6128543024},"esr":{"value":2449473606,"description":"(Data Abort) byte write Translation fault"},"pc":{"value":4338383824,"matchesCrashFrame":1},"far":{"value":12843375996}},"queue":"com.apple.main-thread","frames":[{"imageOffset":48080,"sourceLine":4334,"sourceFile":"strip.c","symbol":"strip_symtab","imageIndex":0,"symbolLocation":16332},{"imageOffset":16096,"sourceLine":1421,"sourceFile":"strip.c","symbol":"strip_object","imageIndex":0,"symbolLocation":4080},{"imageOffset":11660,"sourceLine":1047,"sourceFile":"strip.c","symbol":"strip_arch","imageIndex":0,"symbolLocation":3296},{"imageOffset":7280,"sourceLine":746,"sourceFile":"strip.c","symbol":"strip_file","imageIndex":0,"symbolLocation":268},{"imageOffset":5884,"sourceLine":670,"sourceFile":"strip.c","symbol":"main","imageIndex":0,"symbolLocation":3404},{"imageOffset":24360,"symbol":"start","symbolLocation":2236,"imageIndex":1}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4338335744,
    "size" : 327680,
    "uuid" : "8c1ad0f9-0260-3651-a493-86eaa10b50b0",
    "path" : "\/Users\/USER\/Library\/Developer\/Xcode\/DerivedData\/cctools-ecihfcsnwddndhafbgntrrwrjzti\/Build\/Products\/Debug\/strip",
    "name" : "strip"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6454992896,
    "size" : 583048,
    "uuid" : "49204446-242b-3d1e-9704-32f8ac99723e",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 6454329344,
  "size" : 3553476608,
  "uuid" : "c26be8cd-619e-3513-8673-3ff826317005"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=807.8M resident=0K(0%) swapped_out_or_unallocated=807.8M(100%)\nWritable regions: Total=786.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=786.4M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nKernel Alloc Once                   32K        1 \nMALLOC                           154.2M       14 \nMALLOC guard page                   96K        5 \nMALLOC_MEDIUM (reserved)         240.0M        2         reserved VM address space (unallocated)\nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nSTACK GUARD                       56.0M        1 \nStack                             8176K        1 \n__AUTH                              46K       11 \n__AUTH_CONST                        72K       38 \n__DATA                             193K       37 \n__DATA_CONST                       199K       40 \n__DATA_DIRTY                        78K       22 \n__LINKEDIT                       802.3M        2 \n__OBJC_RO                         66.4M        1 \n__OBJC_RW                         2012K        1 \n__TEXT                            5600K       42 \ndyld private memory                272K        2 \nmapped file                       12.2M        1 \nshared memory                       16K        1 \n===========                     =======  ======= \nTOTAL                              1.7G      223 \nTOTAL, minus reserved VM space     1.1G      223 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "logWritingSignature" : "e244ac45ba14187a789b5cee536003d494cdd86c",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "6112d17137f5d11121dcd4e2",
      "factorPackIds" : {

      },
      "deploymentId" : 240000413
    },
    {
      "rolloutId" : "60186475825c62000ccf5450",
      "factorPackIds" : {

      },
      "deploymentId" : 240000062
    }
  ],
  "experiments" : [
    {
      "treatmentId" : "6dd670af-0633-45e4-ae5f-122ae4df02be",
      "experimentId" : "64406ba83deb637ac8a04419",
      "deploymentId" : 900000017
    }
  ]
}
}

It's a buffer overrun:

t's a buffer overrun
diff --git a/misc/strip.c b/misc/strip.c
index 2a04cec..0c004bb 100644
--- a/misc/strip.c
+++ b/misc/strip.c
@@ -4058,6 +4058,7 @@ enum bool *nlist_outofsync_with_dyldinfo)
            new_strsize = rnd32(new_strsize, sizeof(int32_t));
        else
            new_strsize = rnd32(new_strsize, sizeof(int64_t));
+       new_strsize *= 2;
        new_strings = (char *)allocate(new_strsize);

        /*

looks like the code that computes the size of all the strings doesn't quite match the code that copies strings around

@dotMorten
Copy link
Contributor Author

With the latest RC2.1 workload update that shipped yesterday, it appears that Xcode 15 is now required, so we no longer can work around this issue. This makes it a complete showstopper today, rather than in May when XCode 15 will be required by the app store.

@dalexsoto
Copy link
Member

dalexsoto commented Nov 1, 2023

@dotMorten I know it's not ideal but can you try Xcode 15.1 Beta 2 to see if it is solved there? We do need some validation.

@rolfbjarne
Copy link
Member

This is not fixed in Xcode 15.1 beta 2 :/

@rolfbjarne
Copy link
Member

I submitted a ticket using Apple's feedback assistant (FB13327641), let's see what they say.

If I have time, I'll try to see if there's a way to work around it (won't be this week unfortunately).

@dalexsoto
Copy link
Member

Thanks a lot @rolfbjarne!

rolfbjarne added a commit to rolfbjarne/cctools that referenced this issue Nov 6, 2023
Indirect symbols are copied twice to the 'p' variable, this is the second time:

https://github.com/apple-oss-distributions/cctools/blob/cbe977a1db16a2ca268124f6825535aeb670404c/misc/strip.c#L4217-L4228

This means we need to add the size of the indirect symbol to the size of the 'p' memory contents twice.

This seems to already be happening here:

https://github.com/apple-oss-distributions/cctools/blob/cbe977a1db16a2ca268124f6825535aeb670404c/misc/strip.c#L3820-L3823

and:

https://github.com/apple-oss-distributions/cctools/blob/cbe977a1db16a2ca268124f6825535aeb670404c/misc/strip.c#L3845-L3848

but one scenario (symbols files) was missing.

Ref: FB13327641 (contains test case).
Ref: dotnet/macios#19157
@rolfbjarne
Copy link
Member

I think I figured out the problem with strip, and created a pull request: apple-oss-distributions/cctools#2

@rolfbjarne
Copy link
Member

@dotMorten can you try adding this to your csproj to see if it fixes the problem?

<PropertyGroup>
    <_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
</PropertyGroup>

@dotMorten
Copy link
Contributor Author

@rolfbjarne That does appear to workaround it as well. What does this do?

@rolfbjarne
Copy link
Member

For every P/Invoke, we tell the native linker that it can't remove the symbol in question.

We used to do this by passing -usymbol for each symbol to the native linker, but in .NET 8 we switched to creating a file with all the symbols, and passing the file to the native linker with -exported_symbols_list [file].

Setting _ExportSymbolsExplicitly=false switches back to the old behavior, passing symbols with -usymbol.

@arnsteinjo
Copy link

Adding
<PropertyGroup> <_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly> </PropertyGroup>

fixes the issue on iOS, but now I am unable to load resources (Images, Fonts, ...) for Android so best to use a conditional:
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">

@rolfbjarne rolfbjarne modified the milestones: .NET 8, Future Nov 9, 2023
@dotMorten
Copy link
Contributor Author

Not sure why, but today with .NET 8 RTM + XCode 15.0.1 I'm not seeing this issue. Can anyone else confirm this?

@rolfbjarne
Copy link
Member

I can't reproduce either.

Note that this doesn't mean all is good: the bug is a memory corruption inside strip, which means we get random behavior, and today that random behavior might be "works as expected."

@rolfbjarne
Copy link
Member

rolfbjarne commented Sep 20, 2024

This seems to have cropped up again in Xcode 16.0 :/

If anyone runs into this, please file a feedback ticket with Apple.

Feel free to reference the pull request with the fix: apple-oss-distributions/cctools#2, and also the existing feedback ticket I raised (FB13327641).

@dotMorten
Copy link
Contributor Author

dotMorten commented Sep 26, 2024

Yup I'm seeing it too! Submitted FB15289922

@rolfbjarne
Copy link
Member

Apple might have fixed this for Xcode 16.2, my feedback ticket just got an update:

Please verify this issue with Xcode 16.2 Beta 2 and update your bug report with your results by logging into https://feedbackassistant.apple.com/ or by using the Feedback Assistant app.

Xcode 16.2 Beta 2 (16C5013f)
https://developer.apple.com/download/

If resolved, you can close your feedback by choosing the Close Feedback menu item in the Actions pop-up in Feedback Assistant.

Note: I haven't verified this myself yet, so I can't confirm if it's fixed or not.

The test case I used to file the feedback ticket works with Xcode 16.2 beta 2, so as far as I can tell Apple has fixed this, and hopefully it will be included in the final Xcode 16.2 release.

@brunck
Copy link

brunck commented Nov 21, 2024

Using Xcode 16.2 beta 2 by setting sudo xcode-select -s /Applications/Xcode_16.2_beta_2.app/Contents/Developer in a Bash script task on Azure DevOps on the macos-15 host worked, and built my iOS app for me without this error.

@InquisitorJax
Copy link

beta 2 is no longer available on the image - updating XCode to beta 3 worked for us:
/Applications/Xcode_16.2_beta_3.app

@baddinosaur-kyle
Copy link

Am I right in thinking that using Xcode 16.2-beta* doesn't solve the problem of submitting to the App Store as it gets rejected when it sees you using an unsupported version of Xcode? Unless I'm missing something. Is the alternate 'strip' build the only way to get it into the store? Or another hack that I'm not aware of?

@MichaelAzzer
Copy link

Am I right in thinking that using Xcode 16.2-beta* doesn't solve the problem of submitting to the App Store as it gets rejected when it sees you using an unsupported version of Xcode? Unless I'm missing something. Is the alternate 'strip' build the only way to get it into the store? Or another hack that I'm not aware of?

Yes the same scenario with me using xcode 16.2 Beta

@rolfbjarne
Copy link
Member

I haven't tested it, but in theory you should only need the strip tool from Xcode 16.2 beta 2+.

In the latest version of our .NET 9 workloads, it's possible to specify the path to the strip tool, which means that adding something like this to the csproj might work (remember to change the path according to where your Xcode 16.2 beta 2+ is installed):

<PropertyGroup>
    <StripPath>/Applications/Xcode_16.2.0-beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip</StripPath>
</PropertyGroup>

@MichelePannacciTerex
Copy link

I haven't tested it, but in theory you should only need the strip tool from Xcode 16.2 beta 2+.

In the latest version of our .NET 9 workloads, it's possible to specify the path to the strip tool, which means that adding something like this to the csproj might work (remember to change the path according to where your Xcode 16.2 beta 2+ is installed):

<PropertyGroup>
    <StripPath>/Applications/Xcode_16.2.0-beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip</StripPath>
</PropertyGroup>

That is great!

@UsherNet
Copy link

I haven't tested it, but in theory you should only need the strip tool from Xcode 16.2 beta 2+.

In the latest version of our .NET 9 workloads, it's possible to specify the path to the strip tool, which means that adding something like this to the csproj might work (remember to change the path according to where your Xcode 16.2 beta 2+ is installed):

<PropertyGroup>
    <StripPath>/Applications/Xcode_16.2.0-beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip</StripPath>
</PropertyGroup>

Messy, but PERFECT!!! thank you.

@Kebechet
Copy link

Just for info. In my github action pipeline I just specified:

steps:
  - name: Set Xcode Version
    run: sudo xcode-select -s /Applications/Xcode_16.2.app

Here you dont have to use and _beta_3 suffix that will soon stop working because Github have symlinks setup:
image

@smalgin
Copy link

smalgin commented Dec 1, 2024

For the record, xcode 16.2 beta3 is out & Transporter ate the maui ipa package built with it.

I don't have net9 workloads, but if I get stuck I will seriously consider the workaround above... or just put everything on hold till xcode 16.2 is out.

@jmbegley1968
Copy link

As a workaround, reverting to the 8.0.402 workload fixed the iOS build issue, even with Xcode 16 installed.

Which makes me wonder if this is even an issue with Xcode 16.

This worked for me. Thank you!

@Kebechet
Copy link

Kebechet commented Dec 13, 2024

MAUI 16.2 beta 3 is no longer supported for official release. I am getting an error: Unsupported SDK or Xcode version

Run xcrun altool --upload-app -t ios -f "~/artifacts/SatisFIT.Client.App.ipa"  -u "xxxx@xxxx.xxx" -p "xxxxxxxxxx"
Running altool at path '/Applications/Xcode_16.2_beta_3.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Frameworks/AppStoreService.framework/Support/altool'...
2024-12-12 23:41:34.346 *** Error: [ContentDelivery.Uploader.600000E301C0] Asset validation failed (90534) Unsupported SDK or Xcode version. Your app was built with an SDK or version of Xcode that isn’t supported. Although you can use beta versions of SDKs and Xcode to build and upload apps to App Store Connect, you need to use the latest Release Candidates (RC) for SDKs and Xcode to submit the app. For details on currently supported SDKs and versions of Xcode, visit: https://developer.apple.com/news/releases. (ID: 79002ce7-5858-4817-be9e-ca02beaf91ec)
2024-12-12 23:41:45.987 [ContentDelivery.Uploader.600000E[30](https://github.com/satisfit-org/SatisFIT/actions/runs/12306666582/job/34348847428#step:14:31)1C0] 
=============
UPLOAD FAILED with 1 error.
=============
2024-12-12 23:41:45.991 *** Error: Error uploading '/Users/runner/artifacts/SatisFIT.Client.App.ipa'.
2024-12-12 23:41:45.991 *** Error: Asset validation failed Unsupported SDK or Xcode version. Your app was built with an SDK or version of Xcode that isn’t supported. Although you can use beta versions of SDKs and Xcode to build and upload apps to App Store Connect, you need to use the latest Release Candidates (RC) for SDKs and Xcode to submit the app. For details on currently supported SDKs and versions of Xcode, visit: https://developer.apple.com/news/releases. (ID: 79002ce7-5858-4817-be9e-ca02beaf91ec) (905[34](https://github.com/satisfit-org/SatisFIT/actions/runs/12306666582/job/34348847428#step:14:35))
 {
    NSLocalizedDescription = "Asset validation failed";
    NSLocalizedFailureReason = "Unsupported SDK or Xcode version. Your app was built with an SDK or version of Xcode that isn\U2019t supported. Although you can use beta versions of SDKs and Xcode to build and upload apps to App Store Connect, you need to use the latest Release Candidates (RC) for SDKs and Xcode to submit the app. For details on currently supported SDKs and versions of Xcode, visit: https://developer.apple.com/news/releases. (ID: 79002ce7-5858-4817-be9e-ca02beaf91ec)";
    NSUnderlyingError = "Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Unsupported SDK or Xcode version. Your app was built with an SDK or version of Xcode that isn\U2019t supported. Although you can use beta versions of SDKs and Xcode to build and upload apps to App Store Connect, you need to use the latest Release Candidates (RC) for SDKs and Xcode to submit the app. For details on currently supported SDKs and versions of Xcode, visit: https://developer.apple.com/news/releases., id=79002ce7-5858-4817-be9e-ca02beaf91ec, code=STATE_ERROR.VALIDATION_ERROR.90534, title=Asset validation failed, NSLocalizedFailureReason=Unsupported SDK or Xcode version. Your app was built with an SDK or version of Xcode that isn\U2019t supported. Although you can use beta versions of SDKs and Xcode to build and upload apps to App Store Connect, you need to use the latest Release Candidates (RC) for SDKs and Xcode to submit the app. For details on currently supported SDKs and versions of Xcode, visit: https://developer.apple.com/news/releases., NSLocalizedDescription=Asset validation failed}";
    "iris-code" = "STATE_ERROR.VALIDATION_ERROR.90534";
 }

@smalgin
Copy link

smalgin commented Dec 13, 2024 via email

@UsherNet
Copy link

UsherNet commented Dec 13, 2024 via email

@Kebechet
Copy link

Kebechet commented Dec 13, 2024

Yes I know official 16.2 is released based on: https://xcodereleases.com/
But the current github runner contains just 16.2 beta 3 with symlink 16.2 doesnt it ?
Based on this document: https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode

@AdamDiament
Copy link

I have the same problem, the 16.2 RC is not available on dev ops maxosx build runners, so apple are rejecting the build because it's not built with the latest xcode

@AdamDiament
Copy link

Yes I know official 16.2 is released based on: https://xcodereleases.com/ But the current github runner contains just 16.2 beta 3 with symlink 16.2 doesnt it ? Based on this document: https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode

@Kebechet I think the document is out of date, I ran a test pipeline to list out the contents of Applications with

trigger: none

pool:
  vmImage: 'macos-15'

steps:
  - script: |
      echo "Listing all contents in /Applications that start with 'Xcode':"
      ls -la /Applications/Xcode*
    displayName: "Print contents of /Applications starting with 'Xcode'"

And the 16.2 release candidate is now available

image

@rolfbjarne rolfbjarne modified the milestones: Future, xcode16.2 Dec 13, 2024
@Kebechet
Copy link

@AdamDiament seems like not all runners had this version already. Because on screen you provided you have mapping of 16.2 to correct 16.2_ReleaseCandidate but in my case it was pointing to 16.2_beta_3

I have tried to run our pipeline today and it completed successfully. So the runner with Xcode ReleaseCandidate mapping should be now available.

@AdamDiament
Copy link

Maybe it takes time to update all the runners, and we got caught mid-cycle. Glad its running for you now.

@Kebechet
Copy link

From answer I received they started with deployments of newer runners on Monday. So yes, it is like you said, we got caught mid-cycle.

@rolfbjarne
Copy link
Member

We've released support for Xcode 16.2 now (https://github.com/xamarin/xamarin-macios/releases/tag/dotnet-9.0.1xx-xcode16.2-9170), and it looks like this is fixed in Xcode 16.2, so I'm closing this.

Note: if you're using Visual Studio, the Xcode 16.2 support update will come next year, our release schedules don't line up nicely so this is a moment when VS will lag a bit behind for a while.

@dotMorten
Copy link
Contributor Author

dotMorten commented Dec 20, 2024

@rolfbjarne do we know it was actually fixed and not just randomly hitting this any longer? Same thing was the case with 15.0 and then magically went away in 15.1 only to return in 16.0

@rolfbjarne
Copy link
Member

@rolfbjarne do we know it was actually fixed and not just randomly hitting this any longer? Same thing was the case with 15.0 and then magically went away in 15.1 only to return in 16.0

Apple said it was fixed in the feedback ticket I filed.

@EricNgo1972
Copy link

I had the same problem when I tried to release a MAUI app on Rider with XCode 16.1. It was strange because the app compiled fine in debug mode, and a HelloWorld app was released without any issues.

However, the problem was resolved after upgrading XCode to 16.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix
Projects
None yet
Development

No branches or pull requests