android: Native Crash Reporting - Got a SIGSEGV while executing native code while debugging background threads

Steps to Reproduce

  1. When debugging code that is in a background thread I got a random exception. Debugging in the main thread is Ok (there was a similar problem in VS 2019 16.1 but it has been fixed). The exception:
06-14 11:36:24.504 E/mono-rt (27806): /proc/self/maps:
=================================================================
	Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================

06-14 11:36:24.504 E/mono-rt (27806): 12c00000-52c00000 rw-p 00000000 00:01 36406                              /dev/ashmem/dalvik-main space (region space) (deleted)	Basic Fault Adddress Reporting
=================================================================
Memory around native instruction pointer (0xc9700b20):0xc9700b10  d0 1f 1e 00 70 1f 1e 00 10 00 90 e5 1e ff 2f e1  ....p........./.
0xc9700b20  08 00 90 e5 1e ff 2f e1 04 00 90 e5 1e ff 2f e1  ....../......./.
0xc9700b30  b0 20 d0 e1 00 10 a0 e1 01 00 a0 e3 01 0b 12 e3  . ..............
0xc9700b40  1e ff 2f 11 b2 10 d1 e1 03 30 01 e3 03 00 11 e1  ../......0......

No native Android stacktrace (see debuggerd output).

=================================================================
	Managed Stacktrace:
=================================================================
=================================================================

06-14 11:36:24.505 E/mono-rt (27806): 6f266000-6f44c000 rw-p 00000000 fd:01 432572                             /data/dalvik-cache/arm/system@framework@boot.art
06-14 11:36:24.505 E/mono-rt (27806): 6f44c000-6f509000 rw-p 00000000 fd:01 432575                             /data/dalvik-cache/arm/system@framework@boot-core-libart.art
06-14 11:36:24.505 E/mono-rt (27806): 6f509000-6f547000 rw-p 00000000 fd:01 432577                             /data/dalvik-cache/arm/system@framework@boot-conscrypt.art
06-14 11:36:24.505 E/mono-rt (27806): 6f547000-6f570000 rw-p 00000000 fd:01 432579                             /data/dalvik-cache/arm/system@framework@boot-okhttp.art
06-14 11:36:24.505 E/mono-rt (27806): 6f570000-6f574000 rw-p 00000000 fd:01 432581                             /data/dalvik-cache/arm/system@framework@boot-legacy-test.art
06-14 11:36:24.505 E/mono-rt (27806): 6f574000-6f5a6000 rw-p 00000000 fd:01 432583                             /data/dalvik-cache/arm/system@framework@boot-bouncycastle.art
06-14 11:36:24.505 E/mono-rt (27806): 6f5a6000-6f5d4000 rw-p 00000000 fd:01 432585                             /data/dalvik-cache/arm/system@framework@boot-ext.art
06-14 11:36:24.506 E/mono-rt (27806): 6f5d4000-6fb86000 rw-p 00000000 fd:01 432587                             /data/dalvik-cache/arm/system@framework@boot-framework.art
06-14 11:36:24.506 E/mono-rt (27806): 6fb86000-6fc13000 rw-p 00000000 fd:01 432589                             /data/dalvik-cache/arm/system@framework@boot-telephony-common.art
06-14 11:36:24.506 E/mono-rt (27806): 6fc13000-6fc1b000 rw-p 00000000 fd:01 432591                             /data/dalvik-cache/arm/system@framework@boot-voip-common.art
06-14 11:36:24.506 E/mono-rt (27806): 6fc1b000-6fc23000 rw-p 00000000 fd:01 432594                             /data/dalvik-cache/arm/system@framework@boot-ims-common.art
06-14 11:36:24.506 E/mono-rt (27806): 6fc23000-6fc38000 rw-p 00000000 fd:01 432595                             /data/dalvik-cache/arm/system@framework@boot-apache-xml.art
06-14 11:36:24.506 E/mono-rt (27806): 6fc38000-6fc56000 rw-p 00000000 fd:01 432597                             /data/dalvik-cache/arm/system@framework@boot-org.apache.http.legacy.boot.art
06-14 11:36:24.506 E/mono-rt (27806): 6fc56000-6fc57000 rw-p 00000000 fd:01 432599                             /data/dalvik-cache/arm/system@framework@boot-android.hidl.base-V1.0-java.art
06-14 11:36:24.507 E/mono-rt (27806): 6fc57000-6fc5a000 rw-p 00000000 fd:01 432601                             /data/dalvik-cache/arm/system@framework@boot-android.hidl.manager-V1.0-java.art
06-14 11:36:24.507 E/mono-rt (27806): 6fc5a000-6fc69000 rw-p 00000000 fd:01 432603                             /data/dalvik-cache/arm/system@framework@boot-com.lge.mdm.art
06-14 11:36:24.507 E/mono-rt (27806): 6fc69000-6fc6a000 rw-p 00000000 fd:01 432605                             /data/dalvik-cache/arm/system@framework@boot-QPerformance.art
06-14 11:36:24.507 E/mono-rt (27806): 6fc6a000-6fc6b000 rw-p 00000000 fd:01 432607                             /data/dalvik-cache/arm/system@framework@boot-tcmiface.art
06-14 11:36:24.507 E/mono-rt (27806): 6fc6b000-6fc6d000 rw-p 00000000 fd:01 432609                             /data/dalvik-cache/arm/system@framework@boot-telephony-ext.art
06-14 11:36:24.507 E/mono-rt (27806): 6fc6d000-6fc72000 rw-p 00000000 fd:01 432611                             /data/dalvik-cache/arm/system@framework@boot-WfdCommon.art
06-14 11:36:24.507 E/mono-rt (27806): 6fc72000-6fc73000 rw-p 00000000 fd:01 432613                             /data/dalvik-cache/arm/system@framework@boot-oem-services.art
06-14 11:36:24.508 E/mono-rt (27806): 6fc73000-6fc7a000 rw-p 00000000 fd:01 432615                             /data/dalvik-cache/arm/system@framework@boot-com.lge.fmradio.nablabs.art
06-14 11:36:24.508 E/mono-rt (27806): 6fc7a000-6fe4b000 r--p 00000000 fd:00 4240                               /system/framework/arm/boot.oat
06-14 11:36:24.508 E/mono-rt (27806): 6fe4b000-70446000 r-xp 001d1000 fd:00 4240                               /system/framework/arm/boot.oat
06-14 11:36:24.521 F/libc    (27806): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x8 in tid 27832 (Debugger agent)
Step request failed: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.

Reproduce using the following configuration:

Microsoft Visual Studio Community 2019
Version 16.1.3
VisualStudio.16.Release/16.1.3+29009.5
Microsoft .NET Framework
Version 4.7.03062

Installed Version: Community

Visual C++ 2019   00435-60000-00000-AA808
Microsoft Visual C++ 2019

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

ASP.NET and Web Tools 2019   16.1.429.50124
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   16.1.429.50124
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.1.429.50124
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.3.9000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools   16.1.429.50124
Azure Functions and Web Jobs Tools

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

C# Tools   3.1.1-beta4-19281-06+58a4b1e79aea28115e66b06f850c83a3f1fcb6d3
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.1.77 (master@24013d5)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure HDInsight Azure Node   2.3.9000.0
HDInsight Node under Azure Node

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

Microsoft Azure Service Fabric Tools for Visual Studio   2.5
Microsoft Azure Service Fabric Tools for Visual Studio

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

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

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20419.2

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

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

Microsoft Library Manager   1.0
Install client-side libraries easily to any web project

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

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   16.1.1 (2473f22)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   5.1.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

SettingsCommands Extension   1.0
SettingsCommands Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.61904.23160
Microsoft SQL Server Data Tools

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.

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

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   16.0.10506.2004
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.1.1-beta4-19281-06+58a4b1e79aea28115e66b06f850c83a3f1fcb6d3
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6   16.1.0-beta.19253.3+42526fe359672a05fd562dc16a91a43d0fe047a7
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Spell Check Everywhere   VSSpellCheckEverywhere
An extension that enables spell checking within any Visual Studio file editor or tool window that uses WPF text boxes.
https://GitHub.com/EWSoftware/VSSpellChecker

Visual Studio Spell Checker   VSSpellChecker
An editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with tool windows.
https://GitHub.com/EWSoftware/VSSpellChecker

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes   1.0
Visual Studio Tools for Kubernetes

Visual Studio Tools for Unity   4.1.1.0
Visual Studio Tools for Unity

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   16.1.0.543 (d16-1@34a619991)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.1.0.418 (remotes/origin/d16-1@5b958bb10)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.2.112 (4db4af4)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   9.3.0.22 (HEAD/8e7764fdf)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: mono/mono/2018-08@3cb36842fc4
    Java.Interop: xamarin/java.interop/d16-1@5ddc3e3
    LibZipSharp: grendello/LibZipSharp/d16-1@44de300
    LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.27.1@8212a2d
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-1@acabd26


Xamarin.iOS and Xamarin.Mac SDK   12.10.0.153 (750a879)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Comments: 32 (13 by maintainers)

Most upvoted comments

Thanks @grendello , I had a look at #4983 and added the android:extractNativeLibs=“true” setting to the manifest. After deleting bin/obj and rebuilding, breakpoints were still not being hit. I then tried enabling “Use Shared Runtime” and rebuilding, the app no longer crashed in debug builds and breakpoints started being hit again. As a sanity test, I tried again with Use Shared Runtime disabled and breakpoints were not hit (also deleted bin/obj before the test). It was also my understanding that Shared Runtime was not required for debugging, but since I normally have it enabled this is not an issue.

So in my case at least, the solution was adding the android:extractNativeLibs=“true” setting to the manifest and making sure “Use Shared Runtime” was enabled. For reference, I’m debugging directly on an Android 9 device.

Thanks for the test case! Sort of interestingly, I have so far only been able to hit a SIGSEGV in this Android.OS.AsyncTask test case when I’ve followed a few extra steps:

  1. Put a breakpoint inside SecondActivity.cs in line 51 (inside BackgroundTask event handler).
  2. Run the application.
  3. When main activity is opened, press the fab button that will open the second activity.
  4. After the debugger pauses, continue with Debug > Continue.
  5. Tap the back button in the top left of the app.
  6. Repeat steps 3–5 a couple times in fairly rapid succession. On one of the repetitions, a Break Mode tab will open at step 3 that says “No compatible code running”. When this appears, proceed to step 7.
  7. Run Debug > Step Over to attempt to single-step the debugger.

Result: This produces an unmanaged SIGSEGV fault, and the unmanaged backtrace at that point is the same as in https://github.com/mono/mono/issues/14772.

If I repeat steps 3–5 right after the first “No compatible code” message, I see the same “No compatible code” message again, but if I wait a couple dozen seconds before I repeat the steps, then the debugger seems to be able to read the break location correctly again. My guess is that this dependence on the particular timing could explain why you see the SIGSEGV already on step 3 in your environment.

Given those results, I think the best way forward for this issue will be to track https://github.com/mono/mono/issues/14772 for the fix. I will monitor that issue and update this issue when a candidate fix is available.

When is this gonna get released? The stable version of VS2019 has been completely broken for a month now!

@brendanzagaeski I tried updating visual studio 2019 to latest version 8.8.6 and Xcode to 12.4 , still facing same issue

================================================================= Native Crash Reporting

Got a segv while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

================================================================= Native stacktrace:

0x10b06d068 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN6tflite19AcquireFlexDelegateEv
0x10b0632d4 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN6tflite19AcquireFlexDelegateEv
0x10b071490 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : mono_pmip
0x1dade2d90 - /usr/lib/system/libsystem_platform.dylib : <redacted>
0x10b22e988 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _Z9__isctypeim
0x10b23bd18 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN16XamarinCallState3selEv
0x10b2349ac - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _Z9__isctypeim
0x10b23bbf4 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : xamarin_log
0x10b23c798 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN16XamarinCallState3selEv
0x1ab85940c - /System/Library/PrivateFrameworks/AVFCapture.framework/AVFCapture : <redacted>
0x1ab85916c - /System/Library/PrivateFrameworks/AVFCapture.framework/AVFCapture : <redacted>
0x1ab91a474 - /System/Library/PrivateFrameworks/CMCapture.framework/CMCapture : <redacted>
0x1abb7c314 - /System/Library/PrivateFrameworks/CMCapture.framework/CMCapture : <redacted>
0x1922f7280 - /usr/lib/system/libdispatch.dylib : <redacted>
0x19229c390 - /usr/lib/system/libdispatch.dylib : <redacted>
0x1922ad0ac - /usr/lib/system/libdispatch.dylib : <redacted>
0x1922a5f3c - /usr/lib/system/libdispatch.dylib : <redacted>
0x19263e5e0 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
0x192638a88 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : <redacted>
0x192637ba0 - /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation : CFRunLoopRunSpecific
0x1a9375598 - /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices : GSEventRunModal
0x194f273d8 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : <redacted>
0x194f2c958 - /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore : UIApplicationMain
0x105976188 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN6tflite19AcquireFlexDelegateEv
0x10588b300 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN6tflite19AcquireFlexDelegateEv
0x10588b284 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN6tflite19AcquireFlexDelegateEv
0x104574220 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN6tflite19AcquireFlexDelegateEv
0x10498f530 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN6tflite19AcquireFlexDelegateEv
0x10b074900 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : mono_pmip
0x10b130024 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : mono_pmip
0x10b13627c - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : mono_pmip
0x10b052e94 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN6tflite19AcquireFlexDelegateEv
0x10b23b4ac - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : xamarin_log
0x1045730d0 - /private/var/containers/Bundle/Application/0D6BED0C-A70E-4A21-890B-E24A883830B9/DMI.Xip.iOS.app/DMI.Xip.iOS : _ZN6tflite19AcquireFlexDelegateEv
0x192316568 - /usr/lib/system/libdyld.dylib : <redacted>

================================================================= Basic Fault Address Reporting

Memory around native instruction pointer (0x10b22e868):0x10b22e858 a8 83 5e f8 09 00 80 52 09 01 00 39 a8 03 5f f8 …^…R…9…. 0x10b22e868 09 01 40 39 69 0f 00 34 a8 03 5f f8 09 01 c0 39 …@9i…4……9 0x10b22e878 29 8d 00 71 e8 03 09 aa 08 7d 40 d3 1f 69 01 f1 )…q…}@…i… 0x10b22e888 e8 13 00 f9 68 0b 00 54 08 00 00 90 08 f1 2a 91 …h…T…*.

================================================================= Managed Stacktrace:

  at <unknown> <0xffffffff>
  at UIKit.UIApplication:UIApplicationMain <0x00007>
  at UIKit.UIApplication:Main <0x0002f>
  at UIKit.UIApplication:Main <0x00043>
  at DMI.Xip.iOS.Application:Main <0x0007f>
  at System.Object:runtime_invoke_dynamic <0x0010f>

=================================================================

**

Visual Studio Details === Visual Studio Community 2019 for Mac ===

Version 8.8.6 (build 15) Installation UUID: cdd0ccaf-1d25-4c4e-b69f-5921c1a819d1 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000113

=== Mono Framework MDK ===

Runtime: Mono 6.12.0.113 (2020-02/4fdfb5b1fd5) (64-bit) Package version: 612000113

=== Roslyn (Language Service) ===

3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.102/Sdks SDK Versions: 5.0.102 5.0.101 5.0.100 3.1.405 3.1.404 3.1.301 3.1.200 3.0.100 2.1.701 MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 5.0.2 5.0.1 5.0.0 3.1.11 3.1.10 3.1.5 3.1.2 3.0.0 2.1.19 2.1.16 2.1.13 2.1.12

=== .NET Core 3.1 SDK ===

SDK: 3.1.405

=== Xamarin.Profiler ===

Version: 1.6.15.68 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.4 (17801) Build 12D4e

=== Xamarin.Mac ===

Version: 7.2.0.3 (Visual Studio Community) Hash: c51fabee8 Branch: xcode12.3 Build date: 2020-12-10 21:05:04-0500

=== Xamarin.iOS ===

Version: 14.8.0.3 (Visual Studio Community) Hash: c51fabee8 Branch: xcode12.3 Build date: 2020-12-10 21:05:05-0500

=== Xamarin Designer ===

Version: 16.8.0.510 Hash: 44e3f3ce9 Branch: remotes/origin/d16-8 Build date: 2020-12-10 00:06:14 UTC

=== Xamarin.Android ===

Version: 11.1.0.26 (Visual Studio Community) Commit: xamarin-android/d16-8/a36ce73 Android SDK: /Users/vahidahavaldar/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 6.0 (API level 23) 8.1 (API level 27)

SDK Tools Version: 26.1.1 SDK Platform Tools Version: 30.0.5 SDK Build Tools Version: 29.0.2

Build Information: Mono: 5e9cb6d Java.Interop: xamarin/java.interop/d16-8@79d9533 ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000 SQLite: xamarin/sqlite/3.32.1@1a3276b Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/vahidahavaldar/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25 1.8.0-25 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.8.0.32 Hash: 01a7774 Branch: remotes/origin/d16-8 Build date: 2021-01-14 00:34:58 UTC

=== Android Device Manager ===

Version: 16.8.0.46 Hash: 0a81419 Branch: remotes/origin/d16-8 Build date: 2021-01-14 00:35:22 UTC

=== Build Information ===

Release ID: 808060015 Git revision: d34d29b4643a130479d762e4d2b5750e6462fde7 Build date: 2021-01-15 08:35:04-05 Build branch: release-8.8 Xamarin extensions: d34d29b4643a130479d762e4d2b5750e6462fde7

=== Operating System ===

Mac OS X 10.15.5 Darwin 19.5.0 Darwin Kernel Version 19.5.0 Tue May 26 20:41:44 PDT 2020 root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64

**

@Waaheeda, if you haven’t yet resolved the issue you’re seeing, I’d recommend updating to the latest Visual Studio 2019 for Mac version 8.7 release, and then if the issue still happens, submitting a new issue on the https://github.com/xamarin/xamarin-macios/ repository with the details of what you’re seeing so the Xamarin.iOS team can take a look. If possible, including a minimal test case that demonstrates the problem would be excellent too. Thanks in advance!

Hi, yes! Apologies that it has been this long since the last status update on this issue. Just as of Monday this week, a new Preview version is available that includes the fix for https://github.com/mono/mono/issues/14772.

I haven’t yet had a chance to try that version with the App1-SIGSEGV-crash test case. I will plan to do that soon.

But if you already have or don’t mind installing the side-by-side Visual Studio Preview version, you can check for the latest updates in that preview to install Visual Studio 2019 version 16.4 Preview 1, which includes Xamarin.Android 10.0.99.100, which includes the fix for https://github.com/mono/mono/issues/14772. And you can try that version with your scenario to see how it behaves.

Thanks for the new results from Visual Studio 2019 version 16.1.4, and apologies again for this slow reply.

One thing I was working on that delayed my reply is a set of steps for how to attach an unmanaged native debugger (LLDB or GDB) to Xamarin.Android. If by chance you might already have either Android Studio or the Android NDK installed (or if you wouldn’t mind installing one of them), then one way to make sure the issue you are seeing matches https://github.com/mono/mono/issues/14772 is to have you attach to your app with an unmanaged debugger and collect the stack backtrace when the SIGSEGV happens:

  1. Assuming your app project has Android Options > Use Shared Runtime enabled, follow the steps for “Adding debug symbols for libmonosgen-2.0.so” and “Add the library with symbols as an @(AndroidNativeLibrary)” from the new document I was working on.

  2. Build, deploy, and start up your app as normal with the C# debugger attached.

  3. Now follow the steps for “Attaching LLDB using Android Studio” if you have Android Studio installed or “Attaching GDB using Visual Studio” if you have the Android NDK installed. For the Visual Studio steps, use one instance of Visual Studio to run the app with the C# debugger attached and a second instance of Visual Studio to attach GDB. Also, be sure to run the process handle or -exec handle commands mentioned in the document to allow LLDB and GDB to continue through the normal unmanaged signals that Mono uses internally.

  4. Reproduce the issue using the C# debugger. This time when the SIGSEGV happens, the unmanaged debugger should break on the signal.

  5. For LLDB, run the bt command in the LLDB command prompt to get the stack backtrace. For GDB in Visual Studio, run -exec bt in the Immediate window to get the backtrace. The mono_method_get_class() function should appear near the top of the backtrace, with other Mono runtime functions below it.

  6. Copy and paste the backtrace into this issue.

Alternatively, if by chance you have a self-contained test case that reproduces the issue, feel free to attach that back directly on this issue or use one of the other options to send it privately, and I can run the test with the unmanaged debugger. Thanks much!

@georgi8706 , thanks much for the additional log file, and apologies for the slow follow-up!

The new adblogcat.txt contains the backtrace I was hoping for:

06-18 12:01:30.669  1557  1557 F DEBUG   : ABI: 'arm'
06-18 12:01:30.669  1557  1557 F DEBUG   : pid: 1471, tid: 1497, name: Debugger agent  >>> com.xamarin.android.Messaging <<<
06-18 12:01:30.669  1557  1557 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8
6-18 12:01:30.669  1557  1557 F DEBUG   : Cause: null pointer dereference
06-18 12:01:30.670  1557  1557 F DEBUG   :     r0 00000000  r1 00000000  r2 00000000  r3 000005d9
06-18 12:01:30.670  1557  1557 F DEBUG   :     r4 e78dbe00  r5 e76cecc8  r6 00000000  r7 e78e0320
06-18 12:01:30.670  1557  1557 F DEBUG   :     r8 f1bed088  r9 00000000  sl cd60161c  fp cd601520
06-18 12:01:30.670  1557  1557 F DEBUG   :     ip d13c97f4  sp cd601500  lr d11c85a0  pc d11e9b20  cpsr a00f0010
06-18 12:01:30.671  1557  1557 F DEBUG   : 
06-18 12:01:30.671  1557  1557 F DEBUG   : backtrace:
06-18 12:01:30.671  1557  1557 F DEBUG   :     #00 pc 001a5b20  /data/app/Mono.Android.DebugRuntime-nPSYPIKI-HH1Z9L0NGPEyw==/lib/arm64/libmonosgen-32bit-2.0.so (mono_method_get_class)

Based on the mono_method_get_class() location shown in the backtrace, it is likely that this matches the behavior from https://github.com/mono/mono/issues/14772. I will plan to experiment with the steps from that issue today to check if there’s a follow-up test I can have you try to confirm that the issue you are seeing has the same root cause, and I’ll check with the runtime and debugger engineers on the status of that issue.

I have reproduced it again. I see now E/mono-rt in the adblogcat. Maybe I haven’t “catched” the correct timeframe in the previous log file. adblogcat.txt VisualStudioOutput.txt