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

iOS Release build crashing. #101988

Closed
danlfarnell opened this issue May 2, 2024 · 11 comments
Closed

iOS Release build crashing. #101988

danlfarnell opened this issue May 2, 2024 · 11 comments

Comments

@danlfarnell
Copy link

danlfarnell commented May 2, 2024

Description

Hi,

I have an app that works perfectly fine on an iOS device while debugging but if I create and use a release ad hoc build or test flight build the app crashes while completing a 2nd payment transaction. This crash was not encountered during the Dev/Qa cycle. The only thing that has really changed is that the device is currently running on the latest iOS version (17.4.1).

I can get the release build to work by removing UseInterpreter from the project file. However the app needs this turned on for certain clients because we have code that uses reflection.

Unfortunately I can't provide a repo and this wouldn't reproducible without a payment terminal connected via bluetooth.

The application itself does not log any exceptions but if I use the console app on a mac when this occurs I can see the following.

MONO interpreter: NIY encountered in method CreateReceipt
error: * Assertion: should not be reached at /Users/runner/work/1/s/src/mono/mono/mini/interp/interp.c:3850

Below is a sample of my project file and a list of workloads i have installed. Also please note that I have Xcode 15.2 installed. Any thoughts? Please let me know if there is anything else I can provide to assist. Thanks for your help in advance.

<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
	  <CodesignProvision>MyApp(Ad-Hoc)</CodesignProvision>
	  <CodesignKey>Apple Distribution: My Company Inc. (8T6334H3XB)</CodesignKey>
	  <ArchiveOnBuild>true</ArchiveOnBuild>
	  <UseInterpreter>true</UseInterpreter>
	  <MtouchLink>None</MtouchLink>
</PropertyGroup>
Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------
maui-ios                        8.0.7/8.0.100              SDK 8.0.200        
maui-android                8.0.7/8.0.100              SDK 8.0.200        
maui-mobile                 8.0.7/8.0.100               SDK 8.0.200        
maui                              8.0.7/8.0.100               SDK 8.0.200    

Steps to Reproduce

  1. Build from terminal on mac with "dotnet publish -f net8.0-ios"
  2. Install through testflight or Xcode if using an ad hoc build.
  3. Run a payment transaction on external payment terminal. First transaction will complete without issues.
  4. Run a 2nd payment transaction on external payment terminal. App crashes.

Link to public reproduction project repository

No response

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

ios 17.4.1

Did you find any workaround?

Removing UseInterpreter from the project file allows payments to process without crash however we need this turned on because other clients code uses reflection.

Relevant log output

Note: Error was captured from the console app on a mac.

MONO interpreter: NIY encountered in method CreateReceipt
error: * Assertion: should not be reached at /Users/runner/work/1/s/src/mono/mono/mini/interp/interp.c:3850
@vitek-karas
Copy link
Member

@BrzVlad could you please take a look - assert in the interpreter on 8.0.

@BrzVlad
Copy link
Member

BrzVlad commented May 3, 2024

It is unclear what exactly happens here without a repro. #100832 fixes an issue that can lead to crashes identical to this one so I think the best plan of action is to backport it to .net8 and hope it fixes this.

@vitek-karas
Copy link
Member

@BrzVlad did we ship #100832 in a 9.0 Preview already, if so which one?

@danlfarnell would it be possible for you try to run the app with a 9.0 Preview and repro the problem?

@danlfarnell
Copy link
Author

Hi @vitek-karas,

Thanks for your quick response. Yes, no problem I can give that a try. Should I use SDK 9.0.100-preview.3?

@vitek-karas
Copy link
Member

You can try Preview 3, but I don't think the fix is going to be in there. It's been merged 3 weeks ago...
Can you try a nightly from either main or Preview 4 from https://github.com/dotnet/installer? But it might be a bit bumpy to get it to work end to end.

@danlfarnell
Copy link
Author

I tried .Net 9 preview 3 and was no longer able to recreate the issue with the UseInterpreter flag turned on. It appears to be fixed in this version.

@drasticactions
Copy link

@vitek-karas @BrzVlad Should this issue be moved to runtime? This isn't a MAUI UI issue, but I don't have access to move it on my own and I'm not sure if you want to backport this to .NET 8 or not so I don't want to close it outright.

@vitek-karas vitek-karas transferred this issue from dotnet/maui May 7, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 7, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label May 7, 2024
@vitek-karas vitek-karas added area-Codegen-Interpreter-mono os-ios Apple iOS and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels May 7, 2024
Copy link
Contributor

Tagging subscribers to this area: @BrzVlad, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

@vitek-karas
Copy link
Member

We think this is a dupe of #100832.

We're discussing backporting that fix to 8.0.

@danlfarnell
Copy link
Author

Thanks much appreciated.

@vitek-karas
Copy link
Member

#100832 was backported to 8 in #102159. Closing as fixed.

@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Jul 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants