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

Native Crash with Fatal signal 6 (SIGABRT), code -6 #3892

Closed
daniels7 opened this issue Nov 9, 2019 · 33 comments
Closed

Native Crash with Fatal signal 6 (SIGABRT), code -6 #3892

daniels7 opened this issue Nov 9, 2019 · 33 comments
Labels
Area: App Runtime Issues in `libmonodroid.so`. Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc. need-info Issues that need more information from the author.

Comments

@daniels7
Copy link

daniels7 commented Nov 9, 2019

I guess it has something to do with Packaging as .aab File and a new Version of VS/Xamarin/Mono.

It worked for our last release.

The Problem is happening with the newest Version of Visual Studio 2019 Preview as well.

Steps to Reproduce

  1. Running the application
  2. Switching Fragment via Navigation Drawer

Expected Behavior

No crash

Actual Behavior

Native crash with Fatal signal 6 (SIGABRT), code -6

Version Information

Microsoft Visual Studio Enterprise 2019
Version 16.3.8
VisualStudio.16.Release/16.3.8+29503.13
Microsoft .NET Framework
Version 4.8.03752

Installierte Version: Enterprise

Architekturdiagramme und Analysetools   00433-90000-65167-AA965
Microsoft-Architekturdiagramme und Analysetools

Visual C++ 2019   00433-90000-65167-AA965
Microsoft Visual C++ 2019

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

Allgemeine Azure-Tools   1.10
Bietet allgemeine Dienste für die Verwendung durch Azure Mobile Services und Microsoft Azure-Tools.

Application Insights-Tools für Visual Studio-Paket   9.1.00913.1
Application Insights-Tools für Visual Studio

ASP.NET and Web Tools 2019   16.3.286.43615
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   16.3.286.43615
Weitere Informationen finden Sie unter https://www.asp.net/.

Azure App Service-Tools v3.0.0   16.3.286.43615
Azure App Service-Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.4.2000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools   16.3.286.43615
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio   2.4.2000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C#-Tools   3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
C#-Komponenten, die in der IDE verwendet werden. Abhängig von Ihrem Projekttyp und den zugehörigen Einstellungen kann eine andere Version des Compilers verwendet werden.

Cookiecutter   16.3.19252.1
Stellt Tools zum Suchen, Instanziieren und Anpassen von Vorlagen im Cookiecutter-Format bereit.

Erweiterung zum Debuggen von Momentaufnahmen   1.0
Detaillierte Informationen zur Visual Studio-Erweiterung zum Debuggen von Momentaufnahmen

Extensibility Message Bus   1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents   1.0
Fabric-Diagnoseereignisse

GitHub.VisualStudio   2.10.8.8132
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IntelliCode-Erweiterung   1.0
Detaillierte Informationen zur IntelliCode Visual Studio-Erweiterung

JetBrains ReSharper Ultimate 2019.2.3   Build 192.0.20191016.60459
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2019 JetBrains, Inc.

Microsoft Azure-Tools   2.9
Microsoft Azure-Tools für Microsoft Visual Studio 0x10 – v2.9.20816.1

Microsoft Azure HDInsight Azure Node   2.4.2000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.4.2000.0
Language service for Hive query

Microsoft Azure Service Fabric-Tools für Visual Studio   16.0
Microsoft Azure Service Fabric-Tools für Visual Studio

Microsoft Azure Stream Analytics Language Service   2.4.2000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Continuous Delivery Tools für Visual Studio   0.4
Die Konfiguration von Azure DevOps-Pipelines von der Visual Studio-IDE aus wird vereinfacht.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++-Assistenten   1.0
Microsoft Visual C++-Assistenten

Microsoft Visual Studio-Tools für Container   1.1
Jetzt können Sie Ihre ASP.NET Core-Anwendung in der Zielumgebung entwickeln, ausführen und überprüfen. Drücken Sie F5, um die Anwendung direkt in einem Container mit Debugfunktionen auszuführen, oder STRG+F5 zum Bearbeiten und Aktualisieren Ihrer Anwendung, ohne den Container erneut erstellen zu müssen.

Mono Debugging for Visual Studio   16.3.7 (9d260c5)
Support for debugging Mono processes with Visual Studio.

NuGet-Paket-Manager   5.3.1
NuGet-Paket-Manager in Visual Studio. Weitere Informationen zu NuGet finden Sie unter https://docs.nuget.org/.

Office Developer Tools für Visual Studio   16.0.29217.00
Microsoft Office Developer Tools für Visual Studio

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Python   16.3.19252.1
Stellt IntelliSense, Projekte, Vorlagen, Debuggen, interaktive Fenster und weitere Unterstützung für Python-Entwickler bereit.

Python – Conda-Unterstützung   16.3.19252.1
Conda-Unterstützung für Python-Projekte.

Python – Django-Unterstützung   16.3.19252.1
Stellt Vorlagen und Integration für das Django-Webframework bereit.

Python – IronPython-Unterstützung   16.3.19252.1
Stellt Vorlagen und Integration für IronPython-basierte Projekte bereit.

Python – Unterstützung für die Profilerstellung   16.3.19252.1
Profilerstellungsunterstützung für Python-Projekte.

SQL Server Data Tools   16.0.61908.27190
Microsoft SQL Server Data Tools

Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Testadapter für Google Test   1.0
Ermöglicht die Verwendung von Visual Studio-Testtools mit Komponententests, die für Google Test geschrieben wurden. Die Nutzungsbedingungen und Drittanbieterhinweise stehen im Installationsverzeichnis der Erweiterung zur Verfügung.

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript-Tools   16.0.10821.2002
TypeScript-Tools für Microsoft Visual Studio

VC-Paket für Microsoft Visual Studio   1.0
VC-Paket für Microsoft Visual Studio

Visual Basic-Tools   3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
Visual Basic-Komponenten, die in der IDE verwendet werden. Abhängig von Ihrem Projekttyp und den zugehörigen Einstellungen kann eine andere Version des Compilers verwendet werden.

Visual F# Tools 10.4 für F# 4.6   16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823
Microsoft Visual F# Tools 10.4 für f# 4.6

Visual Studio-Tools für Container   1.0
Visual Studio-Tools für Container

Visual Studio-Tools für Kubernetes   1.0
Visual Studio-Tools für Kubernetes

Visual Studio Code-Debugadapter-Hostpaket   1.0
Interopebene zum Hosten der Visual Studio Code-Adapter in Visual Studio

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Workflow Manager Tools 1.0   1.0
Dieses Paket enthält die erforderlichen Visual Studio-Integrationskomponenten für Workflow Manager.

Xamarin   16.3.0.278 (d16-3@40034cd)
Visual Studio-Erweiterung, um Entwicklung für Xamarin.iOS und Xamarin.Android zu ermöglichen.

Xamarin Designer   16.3.0.256 (remotes/origin/d16-3@8a223bfd7)
Visual Studio-Erweiterung zum Aktivieren der Xamarin Designer-Tools in Visual Studio.

Xamarin Templates   16.3.565 (27e9746)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   10.0.6.2 (d16-3/c407838)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: mono/mono/2019-06@476d72b9e32
    Java.Interop: xamarin/java.interop/d16-3@5836f58
    LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
    LibZip: nih-at/libzip/rel-1-5-1@b95cf3fd
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.27.1@8212a2d
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333


Xamarin.iOS and Xamarin.Mac SDK   13.6.0.12 (e3c2b40)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Log File

11-08 12:48:00.449: I/Robo(15695): Espresso: performing single click on EspressoElement {# androidx.test.tools.crawler.proto.Rectangle@3acd01f
11-08 12:48:00.449: I/Robo(15695): bottom: 496
11-08 12:48:00.449: I/Robo(15695): right: 560
11-08 12:48:00.449: I/Robo(15695): top: 400, # androidx.test.tools.crawler.proto.ElementDescription@52b4ed8e
11-08 12:48:00.449: I/Robo(15695): class_name: "android.support.design.internal.NavigationMenuItemView"
11-08 12:48:00.449: I/Robo(15695): component_type: <androidx.test.tools.crawler.proto.ElementDescription$ComponentType@c7c0244 number=1 name=CONTAINER>
11-08 12:48:00.449: I/Robo(15695): identifiers {
11-08 12:48:00.449: I/Robo(15695):   child_position: 3
11-08 12:48:00.449: I/Robo(15695):   mode_agnostic_sequence: "0.2.0.0.0.0.0.1.0.0.3"
11-08 12:48:00.449: I/Robo(15695):   mode_specific_sequence: "0.0.1.0.1.0.0.1.2.0.3"
11-08 12:48:00.449: I/Robo(15695): }
11-08 12:48:00.449: I/Robo(15695): input_type: <androidx.test.tools.crawler.proto.ElementDescription$InputType@e251c5e number=1 name=NONE>, # androidx.test.tools.crawler.proto.ElementState@1bc5f7f3
11-08 12:48:00.449: I/Robo(15695): capability: <androidx.test.tools.crawler.proto.ElementState$Capability@325e83f number=1 name=CLICK>
11-08 12:48:00.449: I/Robo(15695): is_focusable: true
11-08 12:48:00.449: I/Robo(15695): is_shown: true
11-08 12:48:00.449: I/Robo(15695): v
isible_bounds {
11-08 12:48:00.449: I/Robo(15695):   bottom: 496
11-08 12:48:00.449: I/Robo(15695):   right: 560
11-08 12:48:00.449: I/Robo(15695):   top: 400
11-08 12:48:00.449: I/Robo(15695): }} with ActionParameters{}.
11-08 12:48:00.567: D/WifiStateMachine(1740): starting scan for "wl-ftl-mt72-1-24"WPA_PSK with 2412
11-08 12:48:00.567: D/WifiStateMachine(1740): [ 11-08 12:48:00.581 15695:15695 F/         ]
11-08 12:48:00.567: D/WifiStateMachine(1740): * Assertion: should not be reached at /Users/builder/jenkins/workspace/archive-mono/2019-06/android/release/mono/sgen/sgen-scan-object.h:91
11-08 12:48:00.567: D/WifiStateMachine(1740): --------- beginning of crash
11-08 12:48:00.581: A/libc(15695): Fatal signal 6 (SIGABRT), code -6 in tid 15695 (xx.xxx.xxx)
11-08 12:48:00.588: A/DEBUG(316): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-08 12:48:00.588: A/DEBUG(316): Build fingerprint: 'motorola/harpia/harpia:6.0.1/MPIS24.241-2.50-16/16:user/release-keys'
11-08 12:48:00.588: A/DEBUG(316): Revision: 'p1b0'
11-08 12:48:00.588: A/DEBUG(316): ABI: 'arm'
11-08 12:48:00.588: A/DEBUG(316): pid: 15695, tid: 15695, name: xx.xxx.xxx  >>> xx.xxx.xxx <<<
11-08 12:48:00.588: A/DEBUG(316): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
11-08 12:48:00.622: A/DEBUG(316): Abort message: '* Assertion: should not be reached at /Users/builder/jenkins/workspace/archive-mono/2019-06/android/release/mono/sgen/sgen-scan-object.h:91
11-08 12:48:00.622: A/DEBUG(316): '
11-08 12:48:00.623: A/DEBUG(316):     r0 00000000  r1 00003d4f  r2 00000006  r3 b6fb4b7c
11-08 12:48:00.623: A/DEBUG(316):     r4 b6fb4b84  r5 b6fb4b34  r6 00000002  r7 0000010c
11-08 12:48:00.623: A/DEBUG(316):     r8 00000000  r9 9dbcb7b4  sl 9ecc40f0  fp bec8a268
11-08 12:48:00.623: A/DEBUG(316):     ip 00000006  sp bec8a218  lr b6d391dd  pc b6d3b5d8  cpsr 400e0010
11-08 12:48:00.636: A/DEBUG(316): backtrace:
11-08 12:48:00.637: A/DEBUG(316):     #00 pc 000445d8  /system/lib/libc.so (tgkill+12)
11-08 12:48:00.639: A/DEBUG(316):     #01 pc 000421d9  /system/lib/libc.so (pthread_kill+32)
11-08 12:48:00.640: A/DEBUG(316):     #02 pc 0001bb1f  /system/lib/libc.so (raise+10)
11-08 12:48:00.640: A/DEBUG(316):     #03 pc 00018cc1  /system/lib/libc.so (__libc_android_abort+34)
11-08 12:48:00.640: A/DEBUG(316):     #04 pc 00016880  /system/lib/libc.so (abort+4)
11-08 12:48:00.640: A/DEBUG(316):     #05 pc 002e5bf8  /data/app/xx.xxx.xxx-1/lib/arm/libmonosgen-2.0.so (monoeg_assert_abort+28)
11-08 12:48:01.354: A/DEBUG(316): Tombstone written to: /data/tombstones/tombstone_00
11-08 12:48:01.354: E/DEBUG(316): AM write failed: Broken pipe
11-08 12:48:01.355: I/BootReceiver(1740): Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
11-08 12:48:01.360: W/ActivityManager(1740): Error in app xx.xxx.xxx running instrumentation ComponentInfo{androidx.test.tools.crawler/androidx.test.runner.AndroidJUnitRunner}:
11-08 12:48:01.360: W/ActivityManager(1740):   Native crash
11-08 12:48:01.360: W/ActivityManager(1740):   Native crash: Aborted
11-08 12:48:01.361: I/ActivityManager(1740): Force stopping xx.xxx.xxx appid=10130 user=0: finished inst
11-08 12:48:01.361: I/ActivityManager(1740): Killing 15695:xx.xxx.xxx/u0a130 (adj 0): stop xx.xxx.xxx
11-08 12:48:01.362: D/AndroidRuntime(15578): Shutting down VM
11-08 12:48:01.368: I/art(15578): Starting a blocking GC HeapTrim
11-08 12:48:01.426: W/WindowManager(1740): Attempted to remove non-existing token: android.os.Binder@b55b918
11-08 12:48:01.426: I/WindowState(1740): WIN DEATH: Window{882daa8 u0 xx.xxx.xxx/xx.xxx.xxx.BaseActivity}
11-08 12:48:01.427: D/GraphicsStats(1740): Buffer count: 5
11-08 12:48:01.428: I/Zygote(349): Process 15695 exited due to signal (6)
11-08 12:48:01.432: D/ActivityManager(1740): cleanUpApplicationRecord -- 15695
11-08 12:48:01.433: W/ActivityManager(1740): Force removing ActivityRecord{3546a8c u0 xx.xxx.xxx/.BaseActivity t26}: app died, no saved state
11-08 12:48:01.434: I/Robo(15557): onUnbind.
11-08 12:48:01.439: I/Robo(15557): Interrupted while waiting for the response from the platform.
11-08 12:48:01.440: I/Robo(15557): newScreenState.hasOpaqueElements() = false
11-08 12:48:01.440: W/Robo(15557): Current package [#terminated#] is out of whitelisted packages
11-08 12:48:01.440: I/Robo(15557): New Screen: Optional.of(ScreenNode {Id=19, PackageName=#terminated#, ActivityName=Optional.of(TerminatedActivity)})
11-08 12:48:01.440: D/ProcSpeedReader(3752): Failed to read freq stats from null
11-08 12:48:01.440: I/Robo(15557): Sleeping for 200 milliseconds.
11-08 12:48:01.448: W/ActivityManager(1740): Spurious death for ProcessRecord{2754f71 0:xx.xxx.xxx/u0a130}, curProc for 15695: null
11-08 12:48:01.451: I/BackdropActivity(14159): onResume()
11-08 12:48:01.513: W/InputMethodManagerService(1740): Got RemoteException sending setActive(fa
lse) notification to pid 15695 uid 10130
11-08 12:48:01.644: W/Robo(15557): App has crashed. Stopping crawl.
11-08 12:48:01.644: I/Robo(15557): ### Robo Test Complete ###
11-08 12:48:01.645: I/Robo(15557): Crawl is over.
@daniels7 daniels7 added the Area: App Runtime Issues in `libmonodroid.so`. label Nov 9, 2019
@jonathanpeppers
Copy link
Member

@daniels7 can you produce the problem in a new project? or does it seem like it is specific to your app?

I am wondering how this would be related to app bundles, as it seems to be a problem with Mono in general:

11-08 12:48:00.622: A/DEBUG(316): Abort message: '* Assertion: should not be reached at /Users/builder/jenkins/workspace/archive-mono/2019-06/android/release/mono/sgen/sgen-scan-object.h:91
11-08 12:48:00.622: A/DEBUG(316): '
11-08 12:48:00.623: A/DEBUG(316):     r0 00000000  r1 00003d4f  r2 00000006  r3 b6fb4b7c
11-08 12:48:00.623: A/DEBUG(316):     r4 b6fb4b84  r5 b6fb4b34  r6 00000002  r7 0000010c
11-08 12:48:00.623: A/DEBUG(316):     r8 00000000  r9 9dbcb7b4  sl 9ecc40f0  fp bec8a268
11-08 12:48:00.623: A/DEBUG(316):     ip 00000006  sp bec8a218  lr b6d391dd  pc b6d3b5d8  cpsr 400e0010
11-08 12:48:00.636: A/DEBUG(316): backtrace:
11-08 12:48:00.637: A/DEBUG(316):     #00 pc 000445d8  /system/lib/libc.so (tgkill+12)
11-08 12:48:00.639: A/DEBUG(316):     #01 pc 000421d9  /system/lib/libc.so (pthread_kill+32)
11-08 12:48:00.640: A/DEBUG(316):     #02 pc 0001bb1f  /system/lib/libc.so (raise+10)
11-08 12:48:00.640: A/DEBUG(316):     #03 pc 00018cc1  /system/lib/libc.so (__libc_android_abort+34)
11-08 12:48:00.640: A/DEBUG(316):     #04 pc 00016880  /system/lib/libc.so (abort+4)
11-08 12:48:00.640: A/DEBUG(316):     #05 pc 002e5bf8  /data/app/xx.xxx.xxx-1/lib/arm/libmonosgen-2.0.so (monoeg_assert_abort+28)

Does the problem happen with APKs as well?

@jonathanpeppers jonathanpeppers added the Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc. label Nov 11, 2019
@jonathanpeppers jonathanpeppers added this to the Under Consideration milestone Nov 11, 2019
@jonathanpeppers jonathanpeppers added the need-info Issues that need more information from the author. label Nov 11, 2019
@daniels7
Copy link
Author

@jonathanpeppers
You're right, it has nothing to do with AAB-Packages, as it crashes with a APK-File as well.

The strange thing is that a Release Build from Visual Studio to Device doesn't crash. I don't see any difference between a release build and a packaged and signed Build for Upload, do you?

@daniels7
Copy link
Author

I'll try to create a repro project later, but it can take some time. I'd be happy if you could still try to investigate the issue until then

@daniels7
Copy link
Author

I checked out some different approaches now and the problem is not related to an update of Xamarin.Android or Visual Studio, as the App starts working again if I rollback every code changes since the last release. The main difference since then is a large number of package Updates and the migration from packages.config to the .csproj PackageReferences. Sadly the native crash isn't helpful at all in finding out what's wrong.

@daniels7
Copy link
Author

I can't find any differences between the aab that is generated and split up when distributing the release version from VS onto my phone and the signed aab that is generated and uploaded to the playstore. The first one works well and the other one crashes.

@jonathanpeppers
Copy link
Member

Can you record a diagnostic MSBuild log of the one that works vs the one that doesn't?

@daniels7
Copy link
Author

With your informations I can enable the verbose output for the MSBuild-Taks inside VS, so for the build that works. Will it work with using MSBuild from Commandline as well? I have to use MSBuild from Commandline to create the signed AAB for upload.

@jonathanpeppers
Copy link
Member

You might just try doing them both command-line, such as:

git clean -dxf
msbuild YourApp.Android.csproj /t:Install /restore /p:Configuration=Release /bl:works.binlog
msbuild YourApp.Android.csproj /t:Install /restore /p:Configuration=Release /p:AndroidPackageFormat=aab /bl:broken.binlog

git clean -dxf (or equivalent) just to make sure the log has a full build. You might launch the app on each step to be sure it works/doesn't work.

Zip up the two binlog files, thanks!

@daniels7
Copy link
Author

I'll try to do so, thank you very much :)

@daniels7
Copy link
Author

Sadly I can't reproduce the problem locally. It's ridiculous: If I build the app locally and directly install it (no matter if aab or apk or whatever) it works great. If I upload the very same aab (just signed) to Google's Internal Test and download the App from Play Store I'll get those native crashes. I don't see any way to debug that since the problem seems to be something else, not MSBuild. @jonathanpeppers Do you have any other clues? :(

@daniels7
Copy link
Author

Will google serve exactly the same architecture and so on to my device like the local install by MSBuild does?

@jonathanpeppers
Copy link
Member

When you send to Google Play, are you building the same configuration? /p:Configuration=Release? I was going to check the build logs to be sure that was the case, and the problem wasn't something like AOT being on in one build and not the other.

Can you attach the full adb logcat of the crash?

  1. adb logcat -c - clear the log
  2. Launch the app and get it to crash
  3. adb logcat -d > log.txt

@daniels7
Copy link
Author

On my last try I used exactly the same output aab (Just Signed vs Unsigned, but that shouldn't be a difference). Sadly the binlog contains a lot of sensitive Data, so I'd prefer not to share it, especially not in public. It shouldn't be related to masbuild though due to the same AAB working on local install and not working on Google Install (same goes for APK). I'd guess it has something to do with architectures, but I'm not sure, as the problem is very puzzling.
I'll try to create a full crashlog in a few minutes

@daniels7
Copy link
Author

log.txt

There is the log, generated as you requested

@jonathanpeppers
Copy link
Member

Are you using AOT in some form?

11-13 17:59:37.798 31496 31496 W monodroid: Unknown Mono AOT mode: 1

Does it work if you turn that off? It might be a combination of using an App Bundle with AOT/Profiled AOT.

@daniels7
Copy link
Author

YAAAY, You are so great! :D
After I turned off the options for AOT-Compiling and LLVM-Compiling the App works again :)
Besides that the size of the app has been halved and the app feels snappier than ever.

@jonathanpeppers
Copy link
Member

Do you think that the times you had AOT+LLVM on it was failing? And the other times it was working?

Or is it the combination of AOT+LLVM+App Bundle?

@daniels7
Copy link
Author

daniels7 commented Nov 14, 2019

I don't think that the App Bundle is related since the APK I uploaded to google in between crashed as well. Since the problem appeared with the numerous Nuget Package Upgrades we did the Problem seems to be AOT+LLVM+PackageUpdates

@daniels7
Copy link
Author

@jonathanpeppers Sadly turning off AOT and LLVM broke the VS feature of Bundling assemblies in native Code (though the checkbox is still checked) and I could easily decompile our App now :(
That's sadly a deal breaker for us as well.

@jonathanpeppers
Copy link
Member

You probably don't need all 3 options:

  1. AOT
  2. LLVM
  3. Bundle assemblies into native code (mkbundle)

What if you tried AOT by itself?

@daniels7
Copy link
Author

Will it prevent decompiling? With just mkbundle I had a .so file which just is a gzipped dll with everything inside and fully decompilable code (including comments and everything)

@daniels7
Copy link
Author

Next tests:
AOT + mkbundle -> Crash
Just AOT -> Crash

@daniels7
Copy link
Author

The problem is definitely the AOT

@jonathanpeppers
Copy link
Member

jonathanpeppers commented Nov 14, 2019

AOT is what converts your IL into assembly code. It makes it harder for someone to figure out the original C# source of your app but does not prevent it--even with some kind of obfuscation. I don't know what your app is, but it might not be worth worrying about.

I think AOT is likely the culprit here, though. 😞

@daniels7
Copy link
Author

Yes, I think so too, though it seems to be related to the package updates as well, since the App starts working again on a rollback. Do you have any ideas on how to find out the exact problem?

@daniels7
Copy link
Author

@jonathanpeppers Do you have an idea on how to fix the AOT-Crashes?

@jonathanpeppers
Copy link
Member

Sorry @daniels7 we will need someone on the Mono team to investigate, I'll get someone to take a look.

@jonathanpeppers
Copy link
Member

@daniels7 can you reproduce the issue in a small project and upload it here? The Mono team will need that to investigate.

@daniels7
Copy link
Author

daniels7 commented Nov 21, 2019

@jonathanpeppers That'll be a bit difficult since the Crash is just reproducible if you upload the App to Google Play and download it through the store so I'd have to create a new App just for this including store entry etc.

@jiro-san
Copy link

jiro-san commented Jan 6, 2020

Hello, we have a huge application built locally and we had a similar crash when performing endurance test (no user interaction, just letting our app run for 2 hours):
1-01 15:17:20.719 F/ ( 1237): monoeg_g_usleep: clock_nanosleep () returned -1
01-01 15:17:20.719 F/libc ( 1237): Fatal signal 6 (SIGABRT) at 0x000004d5 (code=-6), thread 1810 (Thread Pool Wor)
01-01 15:17:20.819 D/dalvikvm( 1237): GC_EXPLICIT freed 117K, 8% free 41864K/45040K, paused 6ms+9ms, total 98ms
01-01 15:17:20.819 I/DEBUG ( 111): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-01 15:17:20.819 I/DEBUG ( 111): Build fingerprint: 'Freescale/imx6_ccimx6_sbc/imx6_ccimx6_sbc:4.4.3/dak-4.4.1/:user/dev-keys'
01-01 15:17:20.819 I/DEBUG ( 111): Revision: '0'
01-01 15:17:20.819 I/DEBUG ( 111): pid: 1237, tid: 1810, name: Thread Pool Wor >>> MyApp <<<
01-01 15:17:20.819 I/DEBUG ( 111): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
01-01 15:17:21.089 I/DEBUG ( 111): r0 00000000 r1 00000712 r2 00000006 r3 00000000
01-01 15:17:21.089 I/DEBUG ( 111): r4 00000006 r5 00000004 r6 00000712 r7 0000010c
01-01 15:17:21.089 I/DEBUG ( 111): r8 00000002 r9 ffffffff sl 6a29d13c fp 96e9a788
01-01 15:17:21.089 I/DEBUG ( 111): ip 40091384 sp 96e9a728 lr 400560bd pc 4006508c cpsr 00070010
01-01 15:17:21.089 I/DEBUG ( 111): d0 0000000000000000 d1 0000000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d2 0000000000000000 d3 0000000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d4 3ff0000000000000 d5 0000000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d6 0000000000000000 d7 0000000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d8 0000000000000000 d9 0000000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d10 4040000000000000 d11 3ff0000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d12 0000000000000000 d13 3ff0000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d14 0000000000000000 d15 3ff0000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d16 3d7f20863c83ee71 d17 3eb6510fd5dcb15f
01-01 15:17:21.089 I/DEBUG ( 111): d18 bda8fae9be8838d4 d19 3cd1000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d20 3fe6db6d00000000 d21 3fd6db6d00000000
01-01 15:17:21.089 I/DEBUG ( 111): d22 3e21ee9ebdb4b1c4 d23 3fe02995b6ed2ab7
01-01 15:17:21.089 I/DEBUG ( 111): d24 3ff0000000000000 d25 0000000000000000
01-01 15:17:21.089 I/DEBUG ( 111): d26 b92377ce858a5d48 d27 b92377ce858a5d48
01-01 15:17:21.089 I/DEBUG ( 111): d28 3ff0000000000000 d29 3ee1c1767403bdf2
01-01 15:17:21.089 I/DEBUG ( 111): d30 4059000000000000 d31 bfc921fb5422c458
01-01 15:17:21.089 I/DEBUG ( 111): scr 20000010
01-01 15:17:21.089 I/DEBUG ( 111):
01-01 15:17:21.089 I/DEBUG ( 111): backtrace:
01-01 15:17:21.099 I/DEBUG ( 111): #00 pc 0002208c /system/lib/libc.so (tgkill+12)
01-01 15:17:21.099 I/DEBUG ( 111): #1 pc 000130b9 /system/lib/libc.so (pthread_kill+48)
01-01 15:17:21.099 I/DEBUG ( 111): #2 pc 000132cd /system/lib/libc.so (raise+10)
01-01 15:17:21.099 I/DEBUG ( 111): #3 pc 00012003 /system/lib/libc.so
01-01 15:17:21.099 I/DEBUG ( 111): #4 pc 00021940 /system/lib/libc.so (abort+4)
01-01 15:17:21.099 I/DEBUG ( 111): #5 pc 002e8458 /system/app-lib/MyApp/libmonosgen-2.0.so (monoeg_assert_abort+28)
01-01 15:17:21.099 I/DEBUG ( 111):
01-01 15:17:21.099 I/DEBUG ( 111): stack:
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a6e8 8e40fd48 [anon:libc_malloc]
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a6ec 4005491f /system/lib/libc.so (dlrealloc+122)
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a6f0 400548a5 /system/lib/libc.so (dlrealloc)
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a6f4 0000002f
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a6f8 00000000
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a6fc 96e9a794 [stack:1810]
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a700 6a1f1692 /system/app-lib/MyApp/libmonosgen-2.0.so
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a704 40050d0d /system/lib/libc.so (realloc+12)
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a708 00000030
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a70c 40069b51 /system/lib/libc.so (vasprintf+88)
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a710 4003f0b1 /system/lib/liblog.so
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a714 400405f9 /system/lib/liblog.so
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a718 8e40fd48 [anon:libc_malloc]
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a71c 00000000
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a720 e3a070ad
01-01 15:17:21.099 I/DEBUG ( 111): 96e9a724 ef9000ad
01-01 15:17:21.099 I/DEBUG ( 111): #00 96e9a728 00000006

We have this crash if we change our build environment from VS2017 + Xamarin 9.1.7.0 to VS2019 + Xamarin 10.1.1.0.

Is there a fix coming up?

Note: we had the crash once, but didn't reproduce it on the next run with the same application. It feels like random so this gives us a pretty bad feeling about upgrading our dev environment.

@bruzkovsky
Copy link

We had similar issues, all coming from libmonosgen-2.0.so. Finally, we could get rid of them by disabling the concurrent garbage collector. You can find the setting in the .csproj properties under AndroidOptions:
image

We also disabled Startup Tracing because it did not improve the startup time for our Xamarin.Forms app, but made us feel less comfortable with the crashes.

You could also try to use the new GC bridge instead of tarjan (Default), which is said to be more reliable. See https://docs.microsoft.com/en-us/xamarin/android/internals/garbage-collection#gc-bridge-options for an explanation on how to do that.

The setting is enabled by default in VS 2019, that is why it took so long to find it. @jiro-san maybe that is why the crashes occur for you after changing the build environment.

@jiro-san
Copy link

jiro-san commented Jan 9, 2020

Concurrent garbage collector was already disabled for our test but I'll check the other things you suggest, it may be a good idea to change the GC bridge.

@radekdoulik
Copy link
Member

We are unable to investigate this issue further without more information.

Hopefully you found a resolution meanwhile! If not, please try the latest version of the product and if the problem still occurs, reply with the requested information and reopen this issue.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App Runtime Issues in `libmonodroid.so`. Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc. need-info Issues that need more information from the author.
Projects
None yet
Development

No branches or pull requests

5 participants