-
Notifications
You must be signed in to change notification settings - Fork 514
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
Comments
I can reproduce the problem, and it seems to be a buffer overrun in the |
Thanks for spotting this @dotMorten - we are in the middle of updating an app with Runtime 200 and this was driving me nuts |
Seeing the same issue. |
Yup that's the same as setting A better workaround is probably to move back to xcode 14 for now. |
Just posting the comments from Discord triage here (thanks @rolfbjarne): Crash report using locally built strip (click to expand)
It's a buffer overrun:
looks like the code that computes the size of all the strings doesn't quite match the code that copies strings around |
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. |
@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. |
This is not fixed in Xcode 15.1 beta 2 :/ |
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). |
Thanks a lot @rolfbjarne! |
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: xamarin/xamarin-macios#19157
I think I figured out the problem with |
@dotMorten can you try adding this to your csproj to see if it fixes the problem? <PropertyGroup>
<_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
</PropertyGroup> |
@rolfbjarne That does appear to workaround it as well. What does this do? |
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 Setting |
Adding fixes the issue on iOS, but now I am unable to load resources (Images, Fonts, ...) for Android so best to use a conditional: |
Not sure why, but today with .NET 8 RTM + XCode 15.0.1 I'm not seeing this issue. Can anyone else confirm this? |
I can't reproduce either. Note that this doesn't mean all is good: the bug is a memory corruption inside |
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). |
Yup I'm seeing it too! Submitted |
I have created a duplicate Apple feedback ticket (every little helps). But I have to say: surely a behemoth like Microsoft has great high-level contacts at Apple? I bet that an email from one senior manager to another would accomplish more than we lowly developers can. |
Well, with Xcode 16.1 I no longer have the problem. strip works as expected. |
Hmm, I've updated my build pipeline to:
But when running dotnet publish I'm still getting
What am I missing? |
I'm on .net 9 RC2 and never had this problem building against .net 8. |
Yes it works for me also with .net 9rc2 but it need to restart mac after installing xcode16.1 and set it as default |
I'm still seeing it with 16.1 |
So what's the short term official solution here? A lot of people haven't been able to build production apps on iOS for a month but there's not a single mention of this issue on the MAUI documentation pages. |
Likewise - our app was building fine on .NET 8, but after updating to .NET 9 RC2, with either Xcode 16 or 16.1, we start to see this error. |
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: xamarin/xamarin-macios#19157
Here's a repository that can hopefully be used to compile your own strip tool: https://github.com/rolfbjarne/RolfKvinge.StripReplacement. I might release this on NuGet, but that won't be for a little while at least (until we've released support for Xcode 16.1, which will bring a necessary fix). |
@rolfbjarne could you share an instruction to build and use the tool? @ALL: does anyone tried to use XCode 16.2 Beta 2? |
There are instructions in the README: https://github.com/rolfbjarne/RolfKvinge.StripReplacement#to-build |
Giving this issue a bump. Upgraded to XCode 16 and running into this issue. |
Hi, the solution is right above your post. Unfortunately the issue comes from Apple but it is Microsoft here... |
If you have sentry in your project , then removing it will probably fix the issue . |
That's not a solution. |
Correct, blaming it on Apple and throwing your hands up in the air is not a solution. It may be an issue in a tool provided by Apple but it doesn't affect Apple so they don't care, nor should they. So it's up to Microsoft to provide a workaround |
Microsoft is busy in 2024 conference and showing us what's new in Maui with .net 9 but unfortunately only hello world project that works in maui .net 9 😆
…________________________________
From: Philippe Leybaert ***@***.***>
Sent: Thursday, November 14, 2024 4:23:54 PM
To: xamarin/xamarin-macios ***@***.***>
Cc: Michael Azer ***@***.***>; Manual ***@***.***>
Subject: Re: [xamarin/xamarin-macios] Regression: error : strip exited with code 139 (Issue #19157)
Hi, the solution is right above your post. Unfortunately the issue comes from Apple but it is Microsoft here...
That's not a solution.
Correct, blaming it on Apple and throwing your hands up in the air is not a solution. It may be an issue in a tool provided by Apple but it doesn't affect Apple so they don't care, nor should they. So it's up to Microsoft to provide a workaround
—
Reply to this email directly, view it on GitHub<#19157 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADRJJRTLXM6BJOESQB4GSXL2ASW7VAVCNFSM6AAAAABORVD7LSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZWGQ4DGOBXHA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
If anyone is building their MAUI iOS app with GitHub Actions, using Microsoft hosted runners, and running into this problem, I have a workaround.
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.0'
- name: Install strip hack (remove if not needed)
run: |
cp "$(xcrun -f strip)" "$(xcrun -f strip)"-old
cp ./macOS-StripHack/strip "$(xcrun -f strip)"
chmod +x "$(xcrun -f strip)"
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.403
- name: Install MAUI
run: dotnet workload install maui --version 8.0.403
- name: Remove strip hack (remove if not needed)
if: ${{ always() }}
run: |
mv -f "$(xcrun -f strip)"-old "$(xcrun -f strip)" Then run the workflow, and that should be problem solved. ObservationsA major contributor to this failure happening seems to be including Sentry.io in the project, but removing that from production is not viable. That's not to say Sentry itself as it fault, I just don't understand the details enough. I have not tried using Xcode 16.1, but it seems .NET 8 is not ready for Xcode 16.1 at the time of writing. This assumes you are building I previously made this post with an error in a script, which is noticed after posting and deleted it. This version does work! 😄 |
Run into this today. This might be the case for Azure Devops agents too. I'm giving it a try right now. |
Apple might have fixed this for Xcode 16.2, my feedback ticket just got an update:
Note: I haven't verified this myself yet, so I can't confirm if it's fixed or not. |
I ran a pipeline in Azure DevOps that implements @rolfbjarne solution. Everything went good. Here is a sample of the task: - task: CmdLine@2
inputs:
script: |
git clone --recurse-submodules https://github.com/rolfbjarne/RolfKvinge.StripReplacement
cd RolfKvinge.StripReplacement
make
echo "Will overwrite this file: $(xcrun -f strip)"
cp external/cctools/build/Release/strip "$(xcrun -f strip)" Everything went good.
I can test this but I think .NET 8 and 9 are not ready for that Xcode version. We are stuck until then. EDIT: Is not available yet in macOS agents. I might download it later though. |
I just built my .NET 9 project with XCode 16.2 Beta 2 and VS 17.12.0. I didn't get the strip error! I was getting it with XCode 16.1. |
Azure devops - script: |
sudo xcode-select -s /Applications/Xcode_16.2_beta_2.app/Contents/Developer
displayName: 'Select Xcode 16.2 Beta 2 Release Candidate' |
Xcode 16.2 Beta 2 produces this for me. I assume it's related |
error code 139 is a SIGSEV (call for termination) but strip has nothing to in this case. |
What is this error then? It's the same code compiling against version 9 SDK. AOT seems like it would theoretically use strip. |
But it's not strip that failing here. Had same exact problem once yesterday. I've deleted the bin and the obj folders then it worked. |
I can confirm this has nothing to do with strip, it's an unrelated problem that just looks similar. If you can still reproduce with a clean build as another commenter suggested, please file a new issue and we'll have a look. |
Please file a feedback ticket with Apple if you run into this issue
See this comment for more information: #19157 (comment)
Steps to Reproduce
<PackageReference Include="Esri.ArcGISRuntime" Version="200.2.0" />
Note that if you skip step 2, there is no issue. Something about this library causes the stripper to crash.
Workaround
Add
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
The text was updated successfully, but these errors were encountered: