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

[Mac] [iOS] [Test Flight] Crash on Published IPA #17446

Closed
jbtdevgit opened this issue Sep 18, 2023 · 17 comments
Closed

[Mac] [iOS] [Test Flight] Crash on Published IPA #17446

jbtdevgit opened this issue Sep 18, 2023 · 17 comments
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) partner/macios Issues for the Mac / iOS SDK platform/iOS 🍎 s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working

Comments

@jbtdevgit
Copy link

jbtdevgit commented Sep 18, 2023

Description

Unable to launch test flight application below is the crash log from the test flight and the release condition for ios,
experimented with interpreter llvm and aotassemblies none of them worked pretty fine. The app does not crash on release mode when deploying through usb.

<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
	<CodesignKey>yourcodesignkey</CodesignKey>
	<CodesignProvision>yourprofile</CodesignProvision>
	<!-- uncomment if there is a entitlements is needed -->
	<!--<CodesignEntitlement>Platforms\iOS\Entitlements.plist</CodesignEntitlement>-->
	<ArchiveOnBuild>true</ArchiveOnBuild>
	<RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>
	<!--<UseInterpreter>True</UseInterpreter>
	<MtouchUseLlvm>False</MtouchUseLlvm>
	<AotAssemblies>True</AotAssemblies>-->
</PropertyGroup>
Kernel Triage:
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage


Thread 0 name:
Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00000001f082d578 __pthread_kill + 8 (:-1)
1   libsystem_pthread.dylib       	0x000000021152d118 pthread_kill + 268 (pthread.c:1670)
2   libsystem_c.dylib             	0x00000001b9698178 abort + 180 (abort.c:118)
3   CompanyName                   	0x000000010476e154 0x104364000 + 4235604
4   CompanyName                   	0x000000010463aca0 0x104364000 + 2976928
5   libsystem_platform.dylib      	0x0000000211491214 _sigtramp + 56 (sigtramp.c:116)
6   libsystem_pthread.dylib       	0x000000021152d118 pthread_kill + 268 (pthread.c:1670)
7   libsystem_c.dylib             	0x00000001b9698178 abort + 180 (abort.c:118)
8   CompanyName                   	0x0000000104397228 0x104364000 + 209448
9   CompanyName                   	0x0000000104674b54 0x104364000 + 3214164
10  CompanyName                   	0x0000000104674bd8 0x104364000 + 3214296
11 CompanyName                   	0x0000000104674c08 0x104364000 + 3214344
12  CompanyName                   	0x00000001045b8adc 0x104364000 + 2443996
13  CompanyName                   	0x00000001045663dc 0x104364000 + 2106332
14  CompanyName                  	0x000000010439ee14 0x104364000 + 241172
15  CompanyName                   	0x0000000104397320 0x104364000 + 209696
16  CompanyName                   	0x000000010439fb74 0x104364000 + 244596
17  CompanyName                   	0x00000001046777a4 0x104364000 + 3225508
18  dyld                          	0x00000001d170cdec start + 2220 (dyldMain.cpp:1165)

Thread 1:
0   libsystem_pthread.dylib       	0x0000000211526b74 start_wqthread + 0 (:-1)

Thread 2 name:
Thread 2:
0   libsystem_kernel.dylib        	0x00000001f0827578 __psynch_cvwait + 8 (:-1)
1   libsystem_pthread.dylib       	0x000000021152e078 _pthread_cond_wait + 1232 (pthread_cond.c:862)
2   CompanyName                   	0x00000001045ff9c4 0x104364000 + 2734532
3   libsystem_pthread.dylib       	0x00000002115276b8 _pthread_start + 148 (pthread.c:893)
4   libsystem_pthread.dylib       	0x0000000211526b88 thread_start + 8 (:-1)


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000000
    x4: 0xffffffff98de9ff4   x5: 0x0000000000000018   x6: 0x000000016ba9a830   x7: 0x000000016ba99f20
    x8: 0xb15571be4bac7b2f   x9: 0xb15571bc430eff6f  x10: 0x0000000000000200  x11: 0x000000016ba99f90
   x12: 0x0000000000000000  x13: 0x0000000104373100  x14: 0x00000000137cc000  x15: 0x000000008a22a807
   x16: 0x0000000000000148  x17: 0x0000000208a28440  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x0000000000000103  x21: 0x0000000208a28520  x22: 0x0000000000000000  x23: 0x0000000105844f50
   x24: 0x00000001048897c4  x25: 0x00000001049d0000  x26: 0x0000000000000000  x27: 0x000000016ba9bc7b
   x28: 0x00000002839ac540   fp: 0x000000016ba9a840   lr: 0x000000021152d118
    sp: 0x000000016ba9a820   pc: 0x00000001f082d578 cpsr: 0x40000000
   esr: 0x56000080  Address size fault


Binary Images:
        0x104364000 -         0x1048ebfff MauiApp1 arm64  <232274cb96a030e2b9fd50ae45c743cd> /private/var/containers/Bundle/Application/BA54613B-0938-4E60-81FB-FC8F771013F4/companyname.app/companyname
        0x104eb8000 -         0x104f83fff Sentry arm64  <95543f4b105936cdaa5b1bc833499f19> /private/var/containers/Bundle/Application/BA54613B-0938-4E60-81FB-FC8F771013F4/companyname.app/Frameworks/Sentry.framework/Sentry
        0x1b967b000 -         0x1b96f8ff3 libsystem_c.dylib arm64e  <073251d1d4c937748cee75210751a5d8> /usr/lib/system/libsystem_c.dylib
        0x1d16f7000 -         0x1d177ca53 dyld arm64e  <c3fc2ee4367f3086beb8420ad442bf88> /usr/lib/dyld
        0x1f0826000 -         0x1f085dfe7 libsystem_kernel.dylib arm64e  <681b06a07f6b3fa3a2ce063dc1da7b1b> /usr/lib/system/libsystem_kernel.dylib
        0x21148f000 -         0x211495ff7 libsystem_platform.dylib arm64e  <feae235314a4387184f04f62a365316b> /usr/lib/system/libsystem_platform.dylib
        0x211526000 -         0x211531ff3 libsystem_pthread.dylib arm64e  <aa302f5affe5327aa0033b288b935de1> /usr/lib/system/libsystem_pthread.dylib

EOF

Steps to Reproduce

VS Mac Preview 6 or VS Code

  • Create a blank maui app
  • Update plist and csproj files according to provisioning profiles and code signing
  • Set config to Release Generic Device
  • Delete bin obj folders
  • Clean Rebuild
  • Publish using dotnet publish -f net7.0-ios -c Release or right click maui project and do archive
  • Submit in transporter and test using test flight

Link to public reproduction project repository

I am using #9067 (comment) since I was having issues with icon and updated necessary plist and csproj for my profiles/codesigning

Version with bug

7.0.92

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16.6.1

Did you find any workaround?

N/A

Relevant log output

No response

@jbtdevgit jbtdevgit added the t/bug Something isn't working label Sep 18, 2023
@jbtdevgit jbtdevgit changed the title [iOS] Crash on Release Mode [iOS] [Test Flight] Crash on Release Mode Sep 18, 2023
@jbtdevgit jbtdevgit changed the title [iOS] [Test Flight] Crash on Release Mode [Mac] [iOS] [Test Flight] Crash on Release Mode Sep 18, 2023
@jbtdevgit jbtdevgit changed the title [Mac] [iOS] [Test Flight] Crash on Release Mode [Mac] [iOS] [Test Flight] Crash on Published IPA Sep 18, 2023
@drasticactions
Copy link
Contributor

@rolfbjarne Do you have any ideas what could be going on here, or tips to help debug this issue?

@rolfbjarne
Copy link
Member

First try keeping the native symbols, that should make the crash report contain actual names for the frames of managed code:

<PropertyGroup>
    <NoSymbolStrip>true</NoSymbolStrip>
</PropertyGroup>

Also if the same crash reproduces without the interpreter, that would be much better (because you get the real stack frames, and not some general stack frames about the interpreter doing stuff).

Then you'll hopefully get something more useful than this:

8   CompanyName                   	0x0000000104397228 0x104364000 + 209448
9   CompanyName                   	0x0000000104674b54 0x104364000 + 3214164
10  CompanyName                   	0x0000000104674bd8 0x104364000 + 3214296
11  CompanyName                   	0x0000000104674c08 0x104364000 + 3214344
12  CompanyName                   	0x00000001045b8adc 0x104364000 + 2443996
13  CompanyName                   	0x00000001045663dc 0x104364000 + 2106332
14  CompanyName                  	0x000000010439ee14 0x104364000 + 241172
15  CompanyName                   	0x0000000104397320 0x104364000 + 209696
16  CompanyName                   	0x000000010439fb74 0x104364000 + 244596
17  CompanyName                   	0x00000001046777a4 0x104364000 + 3225508

@jbtdevgit
Copy link
Author

First try keeping the native symbols, that should make the crash report contain actual names for the frames of managed code:

<PropertyGroup>
    <NoSymbolStrip>true</NoSymbolStrip>
</PropertyGroup>

Also if the same crash reproduces without the interpreter, that would be much better (because you get the real stack frames, and not some general stack frames about the interpreter doing stuff).

Then you'll hopefully get something more useful than this:

8   CompanyName                   	0x0000000104397228 0x104364000 + 209448
9   CompanyName                   	0x0000000104674b54 0x104364000 + 3214164
10  CompanyName                   	0x0000000104674bd8 0x104364000 + 3214296
11  CompanyName                   	0x0000000104674c08 0x104364000 + 3214344
12  CompanyName                   	0x00000001045b8adc 0x104364000 + 2443996
13  CompanyName                   	0x00000001045663dc 0x104364000 + 2106332
14  CompanyName                  	0x000000010439ee14 0x104364000 + 241172
15  CompanyName                   	0x0000000104397320 0x104364000 + 209696
16  CompanyName                   	0x000000010439fb74 0x104364000 + 244596
17  CompanyName                   	0x00000001046777a4 0x104364000 + 3225508

Hmm, this does not make sense, I tried replicating the same issue with a new maui application and I get the same crash, with just the logging nuget package. Is it not possible to replicate this on your end? I cannot submit anything right now as I have other troubles with icons in transporter

@rolfbjarne
Copy link
Member

I tried replicating the same issue with a new maui application and I get the same crash, with just the logging nuget package.

Can you attach this project here?

@jbtdevgit
Copy link
Author

I tried replicating the same issue with a new maui application and I get the same crash, with just the logging nuget package.

Can you attach this project here?

#9067 (comment) I use this one currently..

@jbtdevgit
Copy link
Author

jbtdevgit commented Sep 19, 2023

I tried replicating the same issue with a new maui application and I get the same crash, with just the logging nuget package.

Can you attach this project here?

Here's another one MauiApp2.zip

@LyVanBong
Copy link

I also encountered the same problem on iOS. and don't know what the exact cause is? Because when I run the app in debug mode, nothing happens, but when I run the testfig, the app crashes?
Hope to get help soon to solve the above problem

@jbtdevgit
Copy link
Author

jbtdevgit commented Sep 20, 2023

Can this be due to VS Mac? I've tried release new projects with our profiles and few builds worked, and some don't, after succeeding few attempts. I cannot do a test to create an ipa on VS Windows cause I am having issues with xamarin/xamarin-macios#19063

I tried replicating the same issue with a new maui application and I get the same crash, with just the logging nuget package.

Can you attach this project here?

@jbtdevgit
Copy link
Author

jbtdevgit commented Sep 20, 2023

So just an update seems like it worked with the symbol strip on

<PropertyGroup>
    <NoSymbolStrip>true</NoSymbolStrip>
</PropertyGroup>

Any reasons why it crashes without this? @rolfbjarne

@rolfbjarne
Copy link
Member

I tried replicating the same issue with a new maui application and I get the same crash, with just the logging nuget package.

Can you attach this project here?

#9067 (comment) I use this one currently..

I published that successfully to TestFlight, and the app launches just fine on my phone, so there's something else going on.

Maybe you can invite me to test your app on TestFlight?

@rolfbjarne
Copy link
Member

So just an update seems like it worked with the symbol strip on

<PropertyGroup>
    <NoSymbolStrip>true</NoSymbolStrip>
</PropertyGroup>

Any reasons why it crashes without this? @rolfbjarne

No, there should be no reason why that makes a difference :/

@jbtdevgit
Copy link
Author

jbtdevgit commented Sep 21, 2023

So just an update seems like it worked with the symbol strip on

<PropertyGroup>
    <NoSymbolStrip>true</NoSymbolStrip>
</PropertyGroup>

Any reasons why it crashes without this? @rolfbjarne

No, there should be no reason why that makes a difference :/

Well, here's what I did

<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
	<CodesignKey>Your code sign key</CodesignKey>
	<!-- uncomment for appstore release -->
	<CodesignProvision>your signing profile</CodesignProvision>
	<!-- uncomment if there is a entitlements is needed -->
	<!--<CodesignEntitlement>Platforms\iOS\Entitlements.plist</CodesignEntitlement>-->
	<!--<ArchiveOnBuild>true</ArchiveOnBuild>-->
	<RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>
	<NoSymbolStrip>true</NoSymbolStrip>
	<!--<UseInterpreter>True</UseInterpreter>-->
	<!--<MtouchUseLlvm>False</MtouchUseLlvm>-->
	<!--<AotAssemblies>True</AotAssemblies>-->
</PropertyGroup>

I removed ArchiveOnBuild and did not used any of the three Interpreter LLvm Aot and added the NoSymbolStrip.
Removed Bin Obj folders do a clean / rebuild --> then publish, first try it did not have any icons but it wasn't crashing at all.
2nd try I removed bin obj folders do a clean --> then publish, it did had icons and it wasn't crashing as well.
Did a dotnet publish -f net7.0-ios -c Release on VS Mac

I published that successfully to TestFlight, and the app launches just fine on my phone, so there's something else going on.

Maybe you can invite me to test your app on TestFlight?

I do not think it is possible that I can invite you on our TestFlight. What I can do is to give you an adhoc IPA, if it is possible that you can send me your UDID then will work it out, if the above release condition did not make any sense.

An update, after including the NoSymbolStrip the app was able to launch without crashing, but crashes on other parts of the app so I included UseInterpreter and set it to True and did another submission, and the app worked fine. Not sure if this helps, but it is pretty weird to have NoSymbolStrip to be included cause I tried submitting the app with the Interpreter alone and it was crashing as well.

@Eilon Eilon added the area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) label Sep 21, 2023
@ozersenol
Copy link

So just an update seems like it worked with the symbol strip on

<PropertyGroup>
    <NoSymbolStrip>true</NoSymbolStrip>
</PropertyGroup>

Any reasons why it crashes without this? @rolfbjarne

No, there should be no reason why that makes a difference :/

Well, here's what I did

<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
	<CodesignKey>Your code sign key</CodesignKey>
	<!-- uncomment for appstore release -->
	<CodesignProvision>your signing profile</CodesignProvision>
	<!-- uncomment if there is a entitlements is needed -->
	<!--<CodesignEntitlement>Platforms\iOS\Entitlements.plist</CodesignEntitlement>-->
	<!--<ArchiveOnBuild>true</ArchiveOnBuild>-->
	<RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>
	<NoSymbolStrip>true</NoSymbolStrip>
	<!--<UseInterpreter>True</UseInterpreter>-->
	<!--<MtouchUseLlvm>False</MtouchUseLlvm>-->
	<!--<AotAssemblies>True</AotAssemblies>-->
</PropertyGroup>

I removed ArchiveOnBuild and did not used any of the three Interpreter LLvm Aot and added the NoSymbolStrip. Removed Bin Obj folders do a clean / rebuild --> then publish, first try it did not have any icons but it wasn't crashing at all. 2nd try I removed bin obj folders do a clean --> then publish, it did had icons and it wasn't crashing as well. Did a dotnet publish -f net7.0-ios -c Release on VS Mac

I published that successfully to TestFlight, and the app launches just fine on my phone, so there's something else going on.
Maybe you can invite me to test your app on TestFlight?

I do not think it is possible that I can invite you on our TestFlight. What I can do is to give you an adhoc IPA, if it is possible that you can send me your UDID then will work it out, if the above release condition did not make any sense.

An update, after including the NoSymbolStrip the app was able to launch without crashing, but crashes on other parts of the app so I included UseInterpreter and set it to True and did another submission, and the app worked fine. Not sure if this helps, but it is pretty weird to have NoSymbolStrip to be included cause I tried submitting the app with the Interpreter alone and it was crashing as well.

I can confirm that method works and valid for may project as well. Thank you and you saved my project.

@borrmann
Copy link
Contributor

Have you tried building with a physical device instead 'Generic Device'?

@jbtdevgit
Copy link
Author

jbtdevgit commented Dec 9, 2023

Have you tried building with a physical device instead 'Generic Device'?

Yes, I did. It did not work as well. Up to this date, what I put as a solution is still working, even if you are using Visual Studio Code.

I am not sure why this is not being prioritised as it causes issue with builds/publish, and such there was another person having the same problem as me. It has been 3 months, and no updates till. :)

@samhouts samhouts added partner/macios Issues for the Mac / iOS SDK platform/iOS 🍎 labels Feb 1, 2024
@kevinxufei kevinxufei added the s/triaged Issue has been reviewed label Feb 28, 2024
@kevinxufei
Copy link

Verified this issue not repro on 17.6.9(415) with the sample project(#9067 (comment))

@kevinxufei kevinxufei added the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Mar 4, 2024
@ghost
Copy link

ghost commented Mar 4, 2024

Hi @jbtdevgit. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) partner/macios Issues for the Mac / iOS SDK platform/iOS 🍎 s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants