-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Crash caused by DateTime.TryParse MacCatalyst signed Release only #85414
Comments
@rolfbjarne - does this look like a dotnet/runtime issue or a mac/ios issue? |
This is a dotnet/runtime issue:
|
Tagging subscribers to 'os-maccatalyst': @steveisok, @akoeplinger Issue DetailsDescriptionWhen building my app (Maui Blazor) for release on maccatalyst outside the app store, it crashes. I reproduced it in the repo below, but have no idea if this is a Mac entitlements problem, a Blazor problem, a Maui problem, or a .NET problem. The problem is a code snippet that can be added to an existing app. It crashes when it hits DateTime.TryParse:
I may have something misconfigured, so I included my config (genericized) in the repo. Steps to ReproduceBuild for release, on Mac, for outside the App Store, with signing. Packaging not necessary. Link to public reproduction project repositoryhttps://github.com/mike3sullivan/BlazorApp Version with bug7.0 (current) Last version that worked well7.0 (current) Affected platformsmacOS Affected platform versionsM1 Mac Ventura Did you find any workaround?no Relevant log output
|
/cc @SamMonoRT |
Try to turn off llvm optimisation |
Is this something I can do as a .Net Maui developer, or it is a runtime build thing? |
I've never seen MAUI project, I only use net7.0-ios and there is setting for llvm optimization |
There is no option for LLVM in MacOS build in Maui. Including |
@jandupej - please take a look. |
@mike3sullivan I can reproduce the error in your test application on .NET 7, arm64, Release, but not on .NET 8. Can you please confirm if that is the case for you also (with a preview)? |
Sorry - I installed .net 8 Preview 4 for Mac with the installer and Visual Studio won't work with it Trying from CLI, I get "error NETSDK1139: The target platform identifier maccatalyst was not recognized. " Not sure what I need to do to get it working with .Net 8. |
Thank you for checking. It looks like you need to do a |
The crash occurs because @vargaz Are you aware of recent work which may have fixed this? A quick search through PRs did not reveal anything. |
No matter what I do, it seems the Mac wants to use .Net 7. I have installed Preview 8.2, 8.3 and 8.4, rebooted several times, but when I do workload restore, it responds with 'Welcome to .NET 7.0!' dotnet --list-sdks shows the .NET 8 previews are installed The csproj has been updated to reference net8.0-maccatalyst as the TargetFramework. Is there a switch somewhere to enable preview features on Mac? |
Still crashes on .net8 preview (8.0.100-preview.3.23178.7) if I configured things right, but it is a different crash. Seems to crash on String Split, which does not exist in the little app. X64 works fine. mike
|
@mike3sullivan Thank you for the reports. |
@rolfbjarne The crash occurs because the runtime detects a struct that is not byref-like with byref-like fields ( |
Turns out ILStrip is also coming from this repo, so if that's the case, it's still in the right repo. |
This prevents custom attribute table corruption by sorting it as the last step when stripping an assembly. Addresses #85414. The PR will have to be backported to net7.0.
Since this is an issue with ILStrip, it's possible to work around it by disabling the IL stripper, by adding the following property to the project file: <EnableAssemblyILStripping>false</EnableAssemblyILStripping> |
Description
When building my app (Maui Blazor) for release on maccatalyst outside the app store, it crashes. I reproduced it in the repo below, but have no idea if this is a Mac entitlements problem, a Blazor problem, a Maui problem, or a .NET problem. The problem is a code snippet that can be added to an existing app. It crashes when it hits DateTime.TryParse:
I may have something misconfigured, so I included my config (genericized) in the repo.
Steps to Reproduce
Build for release, on Mac, for outside the App Store, with signing. Packaging not necessary.
Link to public reproduction project repository
https://github.com/mike3sullivan/BlazorApp
Version with bug
7.0 (current)
Last version that worked well
7.0 (current)
Affected platforms
macOS
Affected platform versions
M1 Mac Ventura
Did you find any workaround?
no
Relevant log output
The text was updated successfully, but these errors were encountered: