-
Notifications
You must be signed in to change notification settings - Fork 519
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: [libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
during app startup
#8906
Comments
UPDATE: Please ignore this comment, it is moved to #8967.Weird side effect of this bug: after running into this issue, I cannot deploy to my x86-64 emulator anymore because of this error:
Please see the relevant tail of the logs below. The part before this (building the app) is common to all target devices and is working fine. Skipping target "_LinkAssembliesNoShrink" because all output files are up-to-date with respect to the input files.
Skipping target "_GenerateJavaStubs" because all output files are up-to-date with respect to the input files.
Skipping target "_ManifestMerger" because all output files are up-to-date with respect to the input files.
Skipping target "_ConvertCustomView" because all output files are up-to-date with respect to the input files.
Skipping target "_AddStaticResources" because all output files are up-to-date with respect to the input files.
Skipping target "_GenerateEmptyAndroidRemapNativeCode" because all output files are up-to-date with respect to the input files.
Touching "obj\Debug
et8.0-android\stamp\_GeneratePackageManagerJava.stamp".
Skipping target "_GenerateAndroidAssetsDir" because all output files are up-to-date with respect to the input files.
Skipping target "_PrepareCreateBaseApk" because all output files are up-to-date with respect to the input files.
Skipping target "_CreateBaseApk" because all output files are up-to-date with respect to the input files.
Skipping target "_CompileJava" because all output files are up-to-date with respect to the input files.
[llc.EXE stderr] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\binutils\bin\llc.exe: error: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\binutils\bin\llc.exe: typemaps.x86_64.ll: error: Could not open input file: no such file or directory
XA3006: Could not compile native assembly file: typemaps.x86_64.ll
stderr | C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\binutils\bin\llc.exe: error: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.95\tools\binutils\bin\llc.exe: typemaps.x86_64.ll: error: Could not open input file: no such file or directory
Done building project "Anonymized.App.csproj" -- FAILED.
Build FAILED.
2>Deployment failed to Small_Phone_API_34.
2>Deploy failed
========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========
========== Build completed at 13:32 and took 11,768 seconds ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
========== Deploy completed at 13:32 and took 11,768 seconds ========== |
Other weird thing: on the phones where it was crashing in debug mode, in Release mode I also see the SIGSEGV message, but the app does not crash at that point somehow: [debug-app-helper] Mono runtime found at: /data/app/~~2fU_SgCHWNETlFGlD8GKcg==/com.anonymizeddomain.mobiledevelopment.showcase-7r1Z7yrEsiaVLLzVL9Pg-w==/lib/arm/libmonosgen-2.0.so
[opment.showcas] Attempt to remove non-JNI local reference, dumping thread
[DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c
[DOTNET] GetOptionalClassGRef: optional class com/android/org/conscrypt/OpenSSLEngineImpl was not found
[monodroid] Creating public update directory: `/data/user/0/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__`
[opment.showcas] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8898,server=y,embedding=1,timeout=1714132391
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/System.Private.CoreLib.dll [External]
[libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x87b070ff in tid 16722 (opment.showcase), pid 16722 (opment.showcase)
Start debugging Android application ...
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.anonymizeddomain.mobiledevelopment.showcase/crc64dc021777432a8733.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.anonymizeddomain.mobiledevelopment.showcase/crc64dc021777432a8733.MainActivity }
Android application is running (debug is disabled in android project properties). |
Update: I'm now also seeing the crash in Debug mode in the x86-64 emulator on startup: Start debugging Android application ...
> am start -D -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.anonymizeddomain.mobiledevelopment.showcase/crc64dc021777432a8733.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.anonymizeddomain.mobiledevelopment.showcase/crc64dc021777432a8733.MainActivity }
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/System.Private.CoreLib.dll [External]
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/Anonymized.App.dll
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/Mono.Android.dll [External]
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/System.Runtime.dll [External]
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/Java.Interop.dll [External]
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/System.Runtime.InteropServices.dll [External]
Resolved pending breakpoint for 'Android.Runtime.JNIEnvInit.RegisterJniNatives(System.IntPtr, System.Int32, System.IntPtr, System.IntPtr, System.Int32)' to /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNIEnvInit.cs:57 [0x00000].
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/System.Collections.dll [External]
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/Mono.Android.Runtime.dll [External]
Loaded assembly: /data/data/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/System.Threading.dll [External]
[opment.showcase] Late-enabling -Xcheck:jni
[opment.showcase] Using CollectorTypeCMC GC.
[opment.showcase] Unexpected CPU variant for x86: x86_64.
[opment.showcase] Known variants: atom, sandybridge, silvermont, goldmont, goldmont-plus, tremont, kabylake, default
[CompatibilityChangeReporter] Compat change id reported: 171979766; UID 10209; state: ENABLED
[CompatibilityChangeReporter] Compat change id reported: 242716250; UID 10209; state: ENABLED
[ApplicationLoaders] Returning zygote-cached class loader: /system_ext/framework/androidx.window.extensions.jar
[ApplicationLoaders] Returning zygote-cached class loader: /system_ext/framework/androidx.window.sidecar.jar
[ziparchive] Unable to open '/data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/base.dm': No such file or directory
[ziparchive] Unable to open '/data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/base.dm': No such file or directory
[nativeloader] Configuring clns-6 for other apk /data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/lib/x86_64:/data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.anonymizeddomain.mobiledevelopment.showcase
[GraphicsEnvironment] Currently set values for:
[GraphicsEnvironment] angle_gl_driver_selection_pkgs=[]
[GraphicsEnvironment] angle_gl_driver_selection_values=[]
[GraphicsEnvironment] ANGLE GameManagerService for com.anonymizeddomain.mobiledevelopment.showcase: false
[GraphicsEnvironment] com.anonymizeddomain.mobiledevelopment.showcase is not listed in per-application setting
[GraphicsEnvironment] Neither updatable production driver nor prerelease driver is supported.
[debug-app-helper] Checking if libmonodroid was unpacked to /data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/lib/x86_64/libmonodroid.so
[debug-app-helper] Native libs extracted to /data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/lib/x86_64, assuming application/android:extractNativeLibs == true
[debug-app-helper] Setting up for DSO lookup in app data directories
[debug-app-helper] Added filesystem DSO lookup location: /data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/lib/x86_64
[debug-app-helper] Using runtime path: /data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/lib/x86_64
[debug-app-helper] checking directory: `/data/user/0/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/lib`
[debug-app-helper] directory does not exist: `/data/user/0/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/lib`
[debug-app-helper] Checking whether Mono runtime exists at: /data/user/0/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__/libmonosgen-2.0.so
[debug-app-helper] Checking whether Mono runtime exists at: /data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/lib/x86_64/libmonosgen-2.0.so
[debug-app-helper] Mono runtime found at: /data/app/~~HA0b0bmrYL0G1MYf5lwZIQ==/com.anonymizeddomain.mobiledevelopment.showcase-EG8PdIe_sbwpHxnhCCkzyw==/lib/x86_64/libmonosgen-2.0.so
[opment.showcase] Attempt to remove non-JNI local reference
[DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c
[DOTNET] GetOptionalClassGRef: optional class com/android/org/conscrypt/OpenSSLEngineImpl was not found
[monodroid] Creating public update directory: `/data/user/0/com.anonymizeddomain.mobiledevelopment.showcase/files/.__override__`
[opment.showcase] Attempt to remove non-JNI local reference
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:64975,embedding=1,timeout=1714135577
[monodroid-assembly] open_from_bundles: failed to load assembly Anonymized.App.dll
[monodroid-gc] GREF GC Threshold: 46080
[monodroid-assembly] open_from_bundles: failed to load assembly Mono.Android.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Java.Interop.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.InteropServices.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Mono.Android.Runtime.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.dll
[libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6df36340 in tid 9243 (opment.showcase), pid 9243 (opment.showcase) |
@grendello @jonathanpeppers are there any pointers you could give me to work around this problem or investigate it further? Is the information I provided enough for you to look into this? |
Hi @hansmbakker, thank you for all the logs, they show 3 separate issues, so we'll need to untangle things a bit :) First we have the on-device segfaults (SIGSEGV) which are the most worrying, second we have the aborts (SIGABORT) which might be the most actionable and, potentially, causing the segfaults. Finally, we have the build issue For the on-device issues, do you still have the separate logs for all those occurrences? The logs contain crashes from several instances of the application, but they unfortunately lack context - things which are logged before the first line of the crash. If you could, please, attach the separate logs in their entirety that would be most helpful. If you don't have the original logs, please record new ones with the commands you provided, but before recording issue the additional two commands: > adb logcat -G 64M
> adb logcat -c For the SIGSEGV errors, could you please attach the With regards to the build error, please enable creation of MSBuild binlog and attach it here. I've seen this issue reported elsewhere, but I cannot reproduce it so a binlog of it actually happening would be most useful. Thanks! |
I reproduced both the SEGFAULT issue and the build issue. I split off the build issue to #8967 so in this issue we can focus on the crashes. Note: This is still an issue with Visual Studio 17.10 Preview 7; dotnet SDK 8.0.300, MAUI 8.0.40 @grendello Where can I best share the resulting files with you confidentially? |
@hansmbakker if you can get the |
What mail address can I send it to? I see the abort messages were in the log.zip but I couldn't reproduce those today. Will look into that later, I can share the segfault-related files and the build issue-related files today. |
Use the ones from our GH profiles please.
There are a few of those in your logcat: $ grep SIGABRT log.txt
04-16 13:16:14.379 17583 17583 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 17583 (opment.showcase), pid 17583 (opment.showcase)
04-16 13:16:14.550 17609 17609 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
04-16 13:16:21.164 17626 17626 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 17626 (opment.showcase), pid 17626 (opment.showcase)
04-16 13:16:21.338 17695 17695 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
04-16 13:16:27.463 17723 17723 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 17723 (opment.showcase), pid 17723 (opment.showcase)
04-16 13:16:27.601 17748 17748 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
04-16 13:16:34.062 17758 17758 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 17758 (opment.showcase), pid 17758 (opment.showcase)
04-16 13:16:34.201 17784 17784 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- |
@grendello I only see your private mail address in your GH profile; do you have an @microsoft.com address? |
I do, but I don't want to specify it where spambots can scan it :) - please email me at my GH profile address and I'll reply giving you my Microsoft one :) |
The logs and binaries are shared with @grendello's Microsoft account via OneDrive 👍🏼 |
@grendello did the files I shared provide the details you need? Two updates:
I added these points to the opening post. |
[libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
[libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
during app startup
@grendello regarding the
I found I can trigger this error by clearing the user data & cache. I'm not sure whether that is the only cause. Let's discuss the |
The segfault appears to be in the MonoVM interpreter, which is the default operation mode for Debug builds. @hansmbakker could you try building and debugging your app with the Additionally, would you be able to check if the issue also happens on an arm64 device? The logs you provided had this stack trace for the segfault:
and frames 00 through 35 are symbolicated as follows:
The exact runtime version is |
Android application type
.NET Android (net7.0-android, net8.0-android, etc.)
Affected platform version
Initally reported with VS 2022 17.10.0 Preview 5.0; .NET SDK 8.0.204; .NET MAUI 8.0.20
Still an issue with VS 17.11 Preview 1; .NET SDK 8.0.300; MAUI 8.0.40
Description
When deploying a debug version of the app
to one of our test devices, our code crashes at startup with the messageThis does not happen always and I cannot reproduce it on my emulator.Update: I also encountered the issue in a freshly created x86_64 Pixel 7 emulator
Steps to Reproduce
Not sure how to reproduce~, I did not have the issue in the emulator~.
This error appears on two cheap imported Android phones that are used to test the app for usage in other countries.Did you find any workaround?
No response
Relevant log output
I collected logs using
adb -d shell setprop debug.mono.log default,timing,assembly,mono_log_level=debug,mono_log_mask=all adb -d logcat > log.txt
Please find them at log.zip
I collected additional logs and shared the binaries plus those logs with @grendello as it contains client details.
Possibly related items
https://developercommunity.visualstudio.com/t/vs-167-xamarin-android-crash-on-start-up-in-debug/1139203 seems similar but might have a different cause.
The text was updated successfully, but these errors were encountered: