Bug 16042 - Got fatal error randomly.
Summary: Got fatal error randomly.
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.8.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2013-11-08 11:40 UTC by Ravi Kumar Kamboj
Modified: 2017-08-07 20:39 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Ravi Kumar Kamboj 2013-11-08 11:40:36 UTC

I am developing an android application with C# and my code is build successfully. And in my application, there are lots of action on which I am opening a layout in dialog. But I got an error randomly, there is no way to track the error or you can say I am able to findout the issue why this is happening. The error is mentioned below :

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. 

When I tried to perform any operation in the layout which is in my dialog, then this errors comes. But as I said this error comes randomly, this is not come in particular scenario. That's why I am not able to replicate this error.

Please give me any idea why it's happening.

Thanks in advance.
Comment 1 Jonathan Pryor 2013-11-08 12:29:39 UTC
Please provide your `adb logcat` output.

A SIGSEGV is frequently caused by invoking an instance method on a disposed object, e.g. the following fragment would generate a SIGSEGV:

    var i = new Java.Lang.Integer(42);
    var s = i.ToString ();

If you're running on Android v4.1+ Jelly Bean, there is usually a "mono-rt" message with a stack trace describing where the SIGSEGV came from. If JNIEnv.Call*Method() is near the top of the stack trace, the above scenario is usually in play.
Comment 2 Ravi Kumar Kamboj 2013-11-09 00:28:31 UTC
This is what i am getting in logtrace:

[mono-rt] Stacktrace:
[mono-rt]   at <unknown> <0xffffffff>
[mono-rt]   at (wrapper managed-to-native) object.wrapper_native_0x40733409 (intptr,intptr) <IL 0x00026, 0xffffffff>
[mono-rt]   at Android.Runtime.JNIEnv.NewGlobalRef (intptr) [0x00000] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.2-branch/a25a31d0/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:389
[mono-rt]   at Java.Lang.Object.RegisterInstance (Android.Runtime.IJavaObject,intptr,Android.Runtime.JniHandleOwnership) [0x0003f] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.2-branch/a25a31d0/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:139
[mono-rt]   at Java.Lang.Object.SetHandle (intptr,Android.Runtime.JniHandleOwnership) [0x00000] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.2-branch/a25a31d0/source/monodroid/src/Mono.Android/src/Java.Lang/Object.cs:123
[mono-rt]   at Java.Lang.String..ctor (string) [0x000a6] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.2-branch/a25a31d0/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Java.Lang.String.cs:386
[mono-rt]   at Android.Widget.TextView.set_Text (string) [0x00000] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.2-branch/a25a31d0/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Widget.TextView.cs:1801
[mono-rt]   at PointOS.AdapterExpandableList.GetGroupView (int,bool,Android.Views.View,Android.Views.ViewGroup) [0x00261] in e:\Xamarin_Dev\POS\svn\net\POS\NewKPT.POS\PointOS\Adapters\AdapterExpandableList.cs:236
[mono-rt]   at Android.Widget.BaseExpandableListAdapter.n_GetGroupView_IZLandroid_view_View_Landroid_view_ViewGroup_ (intptr,intptr,int,bool,intptr,intptr) [0x0001b] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.2-branch/a25a31d0/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Widget.BaseExpandableListAdapter.cs:608
[mono-rt]   at (wrapper dynamic-method) object.1e3f0b46-0257-442f-9b2a-cb73f7e43279 (intptr,intptr,int,bool,intptr,intptr) <IL 0x00029, 0x0007f>
[mono-rt]   at (wrapper native-to-managed) object.1e3f0b46-0257-442f-9b2a-cb73f7e43279 (intptr,intptr,int,int,intptr,intptr) <IL 0x00034, 0xffffffff>
[mono-rt] =================================================================
[mono-rt] Got a SIGSEGV while executing native code. This usually indicates
[mono-rt] a fatal error in the mono runtime or one of the native libraries 
[mono-rt] used by your application.
[mono-rt] =================================================================
Comment 3 Jonathan Pryor 2013-11-11 12:07:30 UTC
@Ravi: That looks like Dalvik aborting the process because an exception is thrown while an exception is pending (or any number of other reasons Dalvik will abort the process.)

Can you please provide _all_ (more more) of the logcat output?
Comment 4 Jon Douglas [MSFT] 2017-08-07 20:39:34 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!