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 Reporting - Got a SIGSEGV while executing native code while debugging background threads #3222

Open
georgivzh opened this issue Jun 14, 2019 · 32 comments
Labels
Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc.

Comments

@georgivzh
Copy link

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.
@georgivzh georgivzh changed the title Native Crash Reporting - Got a SIGSEGV while executing native code Native Crash Reporting - Got a SIGSEGV while executing native code - debugging background threads Jun 14, 2019
@georgivzh georgivzh changed the title Native Crash Reporting - Got a SIGSEGV while executing native code - debugging background threads Native Crash Reporting - Got a SIGSEGV while executing native code while debugging background threads Jun 14, 2019
@brendanzagaeski
Copy link
Contributor

Thanks for the report! This looks interesting. The fact that the (Debugger agent) thread is crashing looks roughly similar to mono/mono#12843, but the fix for that issue is already included in Xamarin.Android SDK version 9.3 in Visual Studio 2019 version 16.1, so the behavior you are seeing is likely something different.

I tried a simple initial test of stepping through a few lines of code in a background thread in a small test app on an armeabi-v7a device, but unfortunately I haven't yet been able to reproduce the crash, so we'll need a bit more information to help investigate this issue. When you get chance, if you might be able to provide some of the following information, that would be perfect:

  • If possible, if you might be able to zip up and share a project that reproduces the issue for you, that would be excellent. If attaching the project to this GitHub issue publicly won't work, then a couple other options are:

    • Send a one to one message to me on Gitter, for example using a /query @brendanzagaeski command from within the Xamarin.Android Gitter channel, and we can coordinate on another way to send the file non-publicly.
    • Or use Help > Send Feedback > Report a Problem from within Visual Studio to create an item on Visual Studio Developer Community. Those allow private attachments.
  • In either case (whether you can share a project right away or not), if you can collect and attach back the adb logcat log from the crash, that would be useful:

    1. Open Tools > Android > Android Adb Command Prompt.

    2. Run the following command to clear the log on the device:

      adb logcat -c
    3. Repeat the app crash once more.

    4. Run the following command to collect the log from the device:

      adb logcat -d > "%USERPROFILE%\Desktop\adblogcat.txt"
      
    5. Attach back the adblogcat.txt file from your desktop, or if you prefer, copy and paste just the section of it that starts with the "E/mono-rt" lines you included in the error.txt from the original description description and ends after the section that starts with a "Build fingerprint:" line and includes a "backtrace:" section (the native backtrace).

    The additional "backtrace:" information will often contain the name of the native function where the app exited unexpectedly, which can be helpful to distinguish among different native crashes.

Thanks in advance!

@brendanzagaeski
Copy link
Contributor

One other way to share a project privately that might be even easier:

  • Put the example in a private GitHub repository, and add me (brendanzagaeski) as a collaborator.

@georgivzh
Copy link
Author

adblogcat.txt

@brendanzagaeski
Copy link
Contributor

Thanks for the log file! Curiously, it looks like that log file didn't capture any instances of the same crash from the original description. For example, there aren't any "E/mono-rt" lines in this log file. It looks like the app might have been stopped from the IDE via the "stop debugging" action. But if the IDE was stopping the app unexpectedly in some of these cases, that would be definitely be an issue.

If you're still sometimes seeing crashes where the debug output shows "E/mono-rt", then if you get a chance to try collecting the adb logcat once more, that would be perfect. Hopefully it was just a fluke that it didn't capture the crash last time, and it'll capture the crash information this time. Thanks for your patience with this retrying!

@georgivzh
Copy link
Author

georgivzh commented Jun 18, 2019

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

@acaliaro

This comment has been minimized.

@tobiasschulz
Copy link

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

@NickeManarin
Copy link

Indeed! This is a very serious blocking bug.

@brendanzagaeski
Copy link
Contributor

brendanzagaeski commented Jun 25, 2019

@acaliaro, @tobiasschulz , @NickeManarin , based on the statistics of user reports of the issue and the information @acaliaro shared, it is likely that you are all seeing #3112 rather than this bug #3222. Issue #3112 only affects 64-bit arm64-v8a applications, like the one shown in @acaliaro 's crash log. In contrast, issue #3222 has so far been seen by @georgi8706 in a 32-bit armeabi-v7a application.

I would recommend to follow #3222 for updates on the fixes for the issue that affects arm64-v8a applications. Thanks!

@brendanzagaeski
Copy link
Contributor

brendanzagaeski commented Jun 25, 2019

@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 mono/mono#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.

@brendanzagaeski
Copy link
Contributor

I took a look at mono/mono#14772. Interestingly, I noticed that the scenario described there affects versions going back at least as far as Xamarin.Android 8.3.

So a couple follow-up questions for you @georgi8706 :

Did you only start to notice this problem after a recent update? (If so, there's a chance a change in a recent version might have added a new way to hit the old problem.)

If you've noticed, have you usually seen this issue when single stepping in the background threads (using Step Over, Step Into, or Step Out)? Or have you sometimes seen it in other scenarios, like maybe sometimes just when landing on a breakpoint or inspecting a variable? The behavior in mono/mono#14772 seems to be tied to single stepping, so my hunch is that that's when you might be seeing the issue too.

@georgivzh
Copy link
Author

georgivzh commented Jun 26, 2019

Hi, please see inline:

I took a look at mono/mono#14772. Interestingly, I noticed that the scenario described there affects versions going back at least as far as Xamarin.Android 8.3.

So a couple follow-up questions for you @georgi8706 :

Did you only start to notice this problem after a recent update? (If so, there's a chance a change in a recent version might have added a new way to hit the old problem.) [georgi8706]: I remember I got it in 16.1.2 too, but I haven't debugged background threads in 16.1.1, so I cannot say.

If you've noticed, have you usually seen this issue when single stepping in the background threads (using Step Over, Step Into, or Step Out)? Or have you sometimes seen it in other scenarios, like maybe sometimes just when landing on a breakpoint or inspecting a variable? The behavior in mono/mono#14772 seems to be tied to single stepping, so my hunch is that that's when you might be seeing the issue too.
[georgi8706]: My reproduce scenario is to put a breakpoint in a code that is executed in a background thread and and then to wait to be hit when this code is executed. I have an activity which in OnCreate loads some data in background using AsyncTask. I remeber that if the breakpoint is hit I can step in and step over.

  protected override void OnCreate(Bundle savedInstanceState)
   {
        var loader = new CAsyncTask();
        loader.BackgroundTask = () =>
        {
*              // Here is my breakpoint and here in most cases it does not enter, but sometimes it does.
        }
    }

    public class CAsyncTask : AsyncTask<object, int, int>
    {
        public Action BackgroundTask { get; set; }

        // Overrides:
        protected override int RunInBackground(params object[] args)
        {
            BackgroundTask();

            return 0;
        }

          ... More code ...
     }

@NickeManarin
Copy link

based on the statistics of user reports of the issue and the information acaliaro shared, it is likely that you are all seeing #3112 rather than this bug

@brendanzagaeski You are right. :) I updated VS and it's working normally.

@georgivzh
Copy link
Author

I updated to 16.1.4 and still got the exception.

The new log adblogcat.txt
and VS output:

`=================================================================06-27 00:21:35.046 E/mono-rt (30788): /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.

=================================================================
Basic Fault Adddress Reporting

Memory around native instruction pointer (0xc82b4b30):0xc82b4b20 c0 1f 1e 00 60 1f 1e 00 10 00 90 e5 1e ff 2f e1 ....`........./.
0xc82b4b30 08 00 90 e5 1e ff 2f e1 04 00 90 e5 1e ff 2f e1 ....../......./.
0xc82b4b40 b0 20 d0 e1 00 10 a0 e1 01 00 a0 e3 01 0b 12 e3 . ..............
0xc82b4b50 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-27 00:21:35.047 E/mono-rt (30788): 12c00000-52c00000 rw-p 00000000 00:01 38068 /dev/ashmem/dalvik-main space (region space) (deleted)

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

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

@georgivzh georgivzh reopened this Jun 26, 2019
@brendanzagaeski
Copy link
Contributor

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 mono/mono#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!

@georgivzh
Copy link
Author

georgivzh commented Jul 3, 2019

I have created a very simple project where I can reproduce it every time. I have uploaded it in a new repository called App1-SIGSEGV-crash. There is the project archived and called App1.rar.
Reproduce steps:

  1. Put a breakpoint inside SecondActivity.cs in line 51 (inside BackgroundTask event handler).
  2. Run the application. When main activity is opened, press the fab button that will open the second activity.
    Result:
    Voila! There it is -> SIGSEGV exception!

@brendanzagaeski
Copy link
Contributor

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 mono/mono#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 mono/mono#14772 for the fix. I will monitor that issue and update this issue when a candidate fix is available.

@georgivzh
Copy link
Author

I just wanted to ask if there is any progress on the issue, because I am still experiencing the problem in 16.2.5 and almost impossible to debug anything running in a background thread...

@brendanzagaeski
Copy link
Contributor

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 mono/mono#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 mono/mono#14772. And you can try that version with your scenario to see how it behaves.

@georgivzh
Copy link
Author

Hi, that's fine. I will wait for the stable release :). Thanks.

@awaescher
Copy link

I came across this regularly while trying to debug CloudKit pushes for change notifications.

In this case, VS stops at a given breakpoint but you cannot see a highlighted line and you cannot inspect variables at all. The only thing showing that it is actually pausing is the Run/Pause button. Pressing F5 causes the app to run and everything works fine. Pressing F10 or F11 immediately crashes the app with a SIGSEGV as mentioned above. But note that I am talking about Xamarin.iOS, not Android.

Well, you won't like my pragmatic approach, but it works like a charm if you need to get things done:

    public void MethodCalledInBackgroundThread()
    {

#if DEBUG
        Device.InvokeOnMainThreadAsync(() =>
        {
#endif

        // ... logic ...
        // ... to ...
        // ... debug ...

#if DEBUG
        });
#endif

    }

@emimvi
Copy link

emimvi commented Nov 7, 2019

@brendanzagaeski I have just tried the App1-SIGSEGV-crash project in VS2019 Preview 4.0, and the issue seems to only partly have been fixed.
Using the steps you provided, I'm still able to get to the "No compatible code running" part. The app no longer crashes when stepping over, but it doesn't step either - it seems to simply proceed as if clicking "continue".
I have an app where the "No compatible code running" happens so often that it's unfortunately impossible to debug.
Since the crash part seems to have been fixed, I don't know whether this should be a new issue or if it's still related to the mono issue?
Regards

@brendanzagaeski
Copy link
Contributor

@emimvi, thanks for the testing that scenario, and apologies for the slow reply. I had a chance to try the App1-SIGSEGV-crash project again myself today with the latest versions. I simplified the test case a little more to focus on the No compatible code running symptom and filed a new issue for further investigation: mono/mono#18106.

I'm not sure if it will be useful info, but in the little experiments I tried with the test case, I only saw the issue when using the AsyncTask Java type. So far I haven't seen it when using C# threads or tasks.

@emimvi
Copy link

emimvi commented Dec 10, 2019

@brendanzagaeski
Thanks for investigating further!
For me the "No compatible code running" actually happens in an OpenGlView OnDisplay method, which seems to be called by a native android thread in GLSurfaceView's render logic.
I've tried to reproduce it with a small example, without luck however.
But do you think it could be a similar scenario in which the bug happens in a non-C# thread?
Regards.

@brendanzagaeski
Copy link
Contributor

@emimvi, yes, I experimented a bit more today with the behavior for AsyncTask, and I think it is fairly likely that the behavior you're seeing has the same underlying cause.

In particular, today I noticed that there were several other reports from users who saw No compatible code running appear after they updated from Visual Studio 2017 to Visual Studio 2019, and I confirmed that the test case for AsyncTask shows that same version dependency. So I think all of the reports about No compatible code running appearing unexpectedly have the same underlying cause.

@dj-dev
Copy link

dj-dev commented Aug 12, 2020

This problem has started happening for us in a Xamarin.Android project after updating to Visual Studio 16.7.

VS Output:

=================================================================
	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.
=================================================================

No native Android stacktrace (see debuggerd output).

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x5f656b6f766e69):0x5f656b6f766e59  

Environment details:

Microsoft Visual Studio Community 2019
Version 16.7.1
VisualStudio.16.Release/16.7.1+30406.217
Microsoft .NET Framework
Version 4.8.03752

Xamarin   16.7.000.440 (d16-7@358f3c6)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.7.0.495 (remotes/origin/d16-7@79c0c522c)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.7.85 (1bcbbdf)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   11.0.0.3 (d16-7/aca845b)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: 83105ba
    Java.Interop: xamarin/java.interop/d16-7@1f3388a
    ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
    SQLite: xamarin/sqlite/3.32.1@1a3276b
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f

I've spent a while looking into it without finding a solution. As a workaround, I've disabled "Use Shared Runtime" in debug builds which allows the build to run but without debug capabilities (i.e. breakpoints will not be hit).

Is anyone else getting this problem after updating to Visual Studio 16.7? Any suggested solutions would be appreciated.

Thanks

@grendello
Copy link
Contributor

@dj-dev Shared runtime isn't needed for debugging (it's not its purpose), you might want to delete your bin/obj after disabling it, remove the app from device and then deploy it. Regarding the segfault, there's not enough information to be certain but it's very possible you hit #4983 (fixed in #4993, workaround in #4983 (comment))

@dj-dev
Copy link

dj-dev commented Aug 12, 2020

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.

@Waaheeda
Copy link

Facing same issue while presenting a Camera view controller on Xamarin.ios please find below details

=== Visual Studio Professional 2019 for Mac ===

Version 8.6.5 (build 23)
Installation UUID: c6387254-bb2b-4717-a804-bf9ea8dbb102
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 610000104

=== Mono Framework MDK ===

Runtime:
Mono 6.10.0.104 (2019-12/5d03a6fe116) (64-bit)
Package version: 610000104

=== Roslyn (Language Service) ===

3.6.0-3.20210.9+4eafdcb1bcbd8d3573f2ba6065e56d9b9ce4f8a3

=== NuGet ===

Version: 5.6.0.6591

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.301/Sdks
SDK Versions:
3.1.301
3.1.200
3.0.100
2.1.701
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.5
3.1.2
3.0.0
2.1.19
2.1.16
2.1.13
2.1.12

=== Xamarin.Profiler ===

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

=== Updater ===

Version: 11

=== Xamarin.Android ===

Version: 10.3.1.4 (Visual Studio Professional)
Commit: xamarin-android/d16-6/3a10de9
Android SDK: /Users/vahidahavaldar/Library/Android/sdk
Supported Android versions:
6.0 (API level 23)
8.0 (API level 26)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.0
SDK Build Tools Version: 29.0.3

Build Information:
Mono: 165f4b0
Java.Interop: xamarin/java.interop/d16-6@2cab35c
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@49232bc
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-6@bfb66f3

=== 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.6.0.50
Hash: 5901879
Branch: remotes/origin/d16-6
Build date: 2020-06-10 22:42:50 UTC

=== Android Device Manager ===

Version: 16.6.0.96
Hash: 6e8b80b
Branch: remotes/origin/d16-6
Build date: 2020-06-10 22:43:28 UTC

=== Apple Developer Tools ===

Xcode 11.5 (16139)
Build 11E608c

=== Xamarin.Mac ===

Version: 6.18.2.1 (Visual Studio Professional)
Hash: 29c4ea731
Branch: d16-6
Build date: 2020-05-26 17:03:04-0400

=== Xamarin.iOS ===

Version: 13.18.2.1 (Visual Studio Professional)
Hash: 29c4ea731
Branch: d16-6
Build date: 2020-05-26 17:03:05-0400

=== Xamarin Designer ===

Version: 16.6.0.329
Hash: d4f8bcd13
Branch: remotes/origin/d16-6
Build date: 2020-04-24 02:16:02 UTC

=== Build Information ===

Release ID: 806050023
Git revision: 5289d413b99fddfc20b4ecf3e445ccb822213427
Build date: 2020-06-18 12:08:30-04
Build branch: release-8.6
Xamarin extensions: 5289d413b99fddfc20b4ecf3e445ccb822213427

=== 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

@brendanzagaeski
Copy link
Contributor

@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!

@Waaheeda
Copy link

Waaheeda commented Feb 2, 2021

@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@ebe9000
SQLite: xamarin/sqlite@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

**

@jpobst jpobst added Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc. and removed Area: Mono runtime or AOT Compiler labels Sep 6, 2022
@suchithm
Copy link

suchithm commented Aug 16, 2023

Still observing the same issue after migrating MAUI. Project type .Net Native iOS, version .Net 7.0, Use case mostly when there is huge data in sqlite DB and downloading image from server and saving as image byte and navigating to next page.

=================================================================
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.

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

0x10b8b47c4 - /Users/*****/Library/Developer/CoreSimulator/Devices/E1B91FF5-66F3-49A3-810B-65E6051A83FB/data/Containers/Bundle/Application/F0B61C60-438E-4B7F-83BF-294C4E699591/*****.iOS.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info
0x10b858ade - /Users/*****/Library/Developer/CoreSimulator/Devices/E1B91FF5-66F3-49A3-810B-65E6051A83FB/data/Containers/Bundle/Application/F0B61C60-438E-4B7F-83BF-294C4E699591/*****.iOS.app/libmonosgen-2.0.dylib : mono_handle_native_crash
0x10b7af6cf - /Users/*****/Library/Developer/CoreSimulator/Devices/E1B91FF5-66F3-49A3-810B-65E6051A83FB/data/Containers/Bundle/Application/F0B61C60-438E-4B7F-83BF-294C4E699591/*****.iOS.app/libmonosgen-2.0.dylib : mono_sigsegv_signal_handler_debug
0x112cf0c1d - /usr/lib/system/libsystem_platform.dylib : _sigtramp
0x10f6aad8f - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib : _dispatch_kq_drain
0xffffffffffffffff - /Users/*****/Library/Developer/CoreSimulator/Devices/E1B91FF5-66F3-49A3-810B-65E6051A83FB/data/Containers/Bundle/Application/F0B61C60-438E-4B7F-83BF-294C4E699591/*****.iOS.app/*****.iOS : msACCrashesLogBuffer

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

instruction pointer is NULL, skip dumping

Managed Stacktrace:

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

=================================================================
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.

An error has occurred in the native fault reporting. Some diagnostic information will be unavailable.

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

0x10b8b47c4 - /Users/*****/Library/Developer/CoreSimulator/Devices/E1B91FF5-66F3-49A3-810B-65E6051A83FB/data/Containers/Bundle/Application/F0B61C60-438E-4B7F-83BF-294C4E699591/*****.iOS.app/libmonosgen-2.0.dylib : mono_dump_native_crash_info
0x10b858ade - /Users/*****/Library/Developer/CoreSimulator/Devices/E1B91FF5-66F3-49A3-810B-65E6051A83FB/data/Containers/Bundle/Application/F0B61C60-438E-4B7F-83BF-294C4E699591/*****.iOS.app/libmonosgen-2.0.dylib : mono_handle_native_crash
0x10b7af6cf - /Users/*****/Library/Developer/CoreSimulator/Devices/E1B91FF5-66F3-49A3-810B-65E6051A83FB/data/Containers/Bundle/Application/F0B61C60-438E-4B7F-83BF-294C4E699591/*****.iOS.app/libmonosgen-2.0.dylib : mono_sigsegv_signal_handler_debug
0x112cf0c1d - /usr/lib/system/libsystem_platform.dylib : _sigtramp
0x10f6aad8f - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/libdispatch.dylib : _dispatch_kq_drain

Exiting early due to double fault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Mono Runtime Mono-related issues: BCL bugs, AOT issues, etc.
Projects
None yet
Development

No branches or pull requests