Bug 14071 - SIGSEGV unusable resulting app, has lots of runtime failures: Java.Lang.RuntimeException
Summary: SIGSEGV unusable resulting app, has lots of runtime failures: Java.Lang.Runti...
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.8.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Mark Probst
URL:
Depends on:
Blocks:
 
Reported: 2013-08-19 09:24 UTC by Tim Jowers
Modified: 2013-08-29 11:07 UTC (History)
3 users (show)

Tags:
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:
Status:
RESOLVED INVALID

Description Tim Jowers 2013-08-19 09:24:33 UTC
After last update about 1/5 weeks ago, it simply doesn't work acceptably. Randomly the app falls into a state of constant SIGSEGV. I cannot update. I did move to beta update and frequency was reduced. Was doing it even upon app start but now just randomly. Once starts, app can no longer be used. 

NEED A WAY TO DOWNGRADE TO WORKING VERSION OF XAMARIN STUDIO.


08-19 09:18:04.264 D/GestureDetector(29000): [Surface Touch Event] mSweepDown False, mLRSDCnt : -1 mTouchCnt : 2 mFalseSizeCnt:0
08-19 09:18:04.339 F/        (29000): * Assertion at /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/b76e8ec4/source/mono/mono/utils/lock-free-alloc.c:391, condition `next < SB_USABLE_SIZE / desc->slot_size' not met
08-19 09:18:04.339 E/mono-rt (29000): Stacktrace:
08-19 09:18:04.339 E/mono-rt (29000): 
08-19 09:18:04.339 E/mono-rt (29000):   at <unknown> <0xffffffff>
08-19 09:18:04.339 E/mono-rt (29000):   at (wrapper managed-to-native) object.__icall_wrapper_mono_array_new_specific (intptr,int) <0xffffffff>
08-19 09:18:04.339 E/mono-rt (29000):   at CFM.Activities.Work.HandleSelect (object,Android.Widget.ExpandableListView/ChildClickEventArgs) <0x0032b>
08-19 09:18:04.339 E/mono-rt (29000):   at Android.Widget.ExpandableListView/IOnChildClickListenerImplementor.OnChildClick (Android.Widget.ExpandableListView,Android.Views.View,int,int,long) <0x000af>
08-19 09:18:04.339 E/mono-rt (29000):   at Android.Widget.ExpandableListView/IOnChildClickListenerInvoker.n_OnChildClick_Landroid_widget_ExpandableListView_Landroid_view_View_IIJ (intptr,intptr,intptr,intptr,int,int,long) <0x000c3>
08-19 09:18:04.339 E/mono-rt (29000):   at (wrapper dynamic-method) object.f808cca9-10b8-4586-9be2-5df2bc6975c4 (intptr,intptr,intptr,intptr,int,int,long) <0x0008b>
08-19 09:18:04.339 E/mono-rt (29000):   at (wrapper native-to-managed) object.f808cca9-10b8-4586-9be2-5df2bc6975c4 (intptr,intptr,intptr,intptr,int,int,long) <0xffffffff>
08-19 09:18:04.339 E/mono-rt (29000): 
08-19 09:18:04.339 E/mono-rt (29000): =================================================================
08-19 09:18:04.339 E/mono-rt (29000): Got a SIGSEGV while executing native code. This usually indicates
08-19 09:18:04.339 E/mono-rt (29000): a fatal error in the mono runtime or one of the native libraries 
08-19 09:18:04.339 E/mono-rt (29000): used by your application.
Comment 1 Tim Jowers 2013-08-19 10:29:49 UTC
Another run of the app:

[AbsListView] Get MotionRecognitionManager
[] * Assertion at /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/b76e8ec4/source/mono/mono/utils/lock-free-alloc.c:383, condition `old_anchor.data.state == STATE_PARTIAL' not met
[mono-rt] Stacktrace:
[mono-rt] 
[mono-rt]   at <unknown> <0xffffffff>
[mono-rt]   at (wrapper managed-to-native) System.Runtime.InteropServices.GCHandle.GetTargetHandle (object,int,System.Runtime.InteropServices.GCHandleType) <0xffffffff>
[mono-rt]   at System.Runtime.InteropServices.GCHandle..ctor (object,System.Runtime.InteropServices.GCHandleType) <0x00037>
[mono-rt]   at System.Runtime.InteropServices.GCHandle.Alloc (object,System.Runtime.InteropServices.GCHandleType) <0x0002b>
[mono-rt]   at System.WeakReference.AllocateHandle (object) <0x0002b>
[mono-rt]   at System.WeakReference..ctor (object,bool) <0x00027>
[mono-rt]   at Java.Lang.Object.RegisterInstance (Android.Runtime.IJavaObject,intptr,Android.Runtime.JniHandleOwnership) <0x002a3>
[mono-rt]   at Java.Lang.Object.SetHandle (intptr,Android.Runtime.JniHandleOwnership) <0x00023>
[mono-rt]   at Java.Lang.Object..ctor (intptr,Android.Runtime.JniHandleOwnership) <0x0003f>
[mono-rt]   at Android.Views.View..ctor (intptr,Android.Runtime.JniHandleOwnership) <0x00023>
[mono-rt]   at Android.Widget.TextView..ctor (intptr,Android.Runtime.JniHandleOwnership) <0x00023>
[mono-rt]   at Android.Widget.Button..ctor (intptr,Android.Runtime.JniHandleOwnership) <0x00023>
[mono-rt]   at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___intptr_int (object,intptr,intptr,intptr) <0xffffffff>
[mono-rt]   at <unknown> <0xffffffff>
[mono-rt]   at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) <0xffffffff>
[mono-rt]   at System.Reflection.MonoCMethod.InternalInvoke (object,object[]) <0x0003b>
[mono-rt]   at System.Reflection.MonoCMethod.DoInvoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x00103>
[mono-rt]   at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x00047>
[mono-rt]   at System.Reflection.ConstructorInfo.Invoke (object[]) <0x0006b>
[mono-rt]   at Java.Interop.TypeManager.CreateProxy (System.Type,intptr,Android.Runtime.JniHandleOwnership) <0x0013b>
[mono-rt]   at Java.Interop.TypeManager.CreateInstance (intptr,Android.Runtime.JniHandleOwnership,System.Type) <0x003ab>
[mono-rt]   at Java.Lang.Object.GetObject (intptr,Android.Runtime.JniHandleOwnership,System.Type) <0x0028b>
[mono-rt]   at Java.Lang.Object._GetObject<T> (intptr,Android.Runtime.JniHandleOwnership) <0x0004f>
[mono-rt]   at Java.Lang.Object.GetObject<T> (intptr,Android.Runtime.JniHandleOwnership) <0x0002b>
[mono-rt]   at Android.App.Activity.FindViewById (int) <0x00203>
[mono-rt]   at CFM.Activities.Work.OnCreate (Android.OS.Bundle) <0x0036f>
[mono-rt]   at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x00057>
[mono-rt]   at (wrapper dynamic-method) object.f25a9cc2-f057-4297-8334-f5f579fb3d76 (intptr,intptr,intptr) <0x00043>
[mono-rt]   at (wrapper native-to-managed) object.f25a9cc2-f057-4297-8334-f5f579fb3d76 (intptr,intptr,intptr) <0xffffffff>
[mono-rt] 
[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] =================================================================
[mono-rt]
Comment 2 Tim Jowers 2013-08-20 20:31:47 UTC
Fixed one main source where app was using appContext saved in a static variable but this becomes either stale or null'ed. Did not determine which. Fix was to constantly look up appcontext when working with Preferences.
Comment 3 Tim Jowers 2013-08-20 20:32:37 UTC
Another one which does not seem clear. The database connection is re-created right before this call....
08-20 20:22:55.399 D/LightsService( 2471): setLightLocked is called
08-20 20:22:55.404 E/mono-rt (18249):   at <unknown> <0xffffffff>
08-20 20:22:55.404 E/mono-rt (18249):   at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) <0xffffffff>
08-20 20:22:55.404 E/mono-rt (18249):   at System.Reflection.MonoCMethod.InternalInvoke (object,object[]) <0x0003b>
08-20 20:22:55.404 E/mono-rt (18249):   at System.Reflection.MonoCMethod.DoInvoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x00103>
08-20 20:22:55.404 E/mono-rt (18249):   at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x00047>
08-20 20:22:55.404 E/mono-rt (18249):   at System.Reflection.ConstructorInfo.Invoke (object[]) <0x0006b>
08-20 20:22:55.404 E/mono-rt (18249):   at Java.Interop.TypeManager.CreateProxy (System.Type,intptr,Android.Runtime.JniHandleOwnership) <0x0013b>
08-20 20:22:55.404 E/mono-rt (18249):   at Java.Interop.TypeManager.CreateInstance (intptr,Android.Runtime.JniHandleOwnership,System.Type) <0x003ab>
08-20 20:22:55.404 E/mono-rt (18249):   at Java.Lang.Object.GetObject (intptr,Android.Runtime.JniHandleOwnership,System.Type) <0x0028b>
08-20 20:22:55.404 E/mono-rt (18249):   at Java.Lang.Object._GetObject<T> (intptr,Android.Runtime.JniHandleOwnership) <0x0004f>
08-20 20:22:55.404 E/mono-rt (18249):   at Java.Lang.Object.GetObject<T> (intptr,Android.Runtime.JniHandleOwnership) <0x0002b>
08-20 20:22:55.404 E/mono-rt (18249):   at Android.Database.Sqlite.SQLiteDatabase.Query (string,string[],string,string[],string,string,string) <0x003d7>
08-20 20:22:55.404 E/mono-rt (18249):   at CFM.SqliteClasses.Inventory.GetCallParts (string) <0x000bb>
08-20 20:22:55.404 E/mono-rt (18249):   at CFM.Activities.ServiceReport.SetParts () <0x00043>
08-20 20:22:55.404 E/mono-rt (18249):   at CFM.AsyncTasks.GetCallParts.OnPostExecute (Java.Lang.Object) <0x0016f>
08-20 20:22:55.404 E/mono-rt (18249):   at Android.OS.AsyncTask.n_OnPostExecute_Ljava_lang_Object_ (intptr,intptr,intptr) <0x00057>
08-20 20:22:55.404 E/mono-rt (18249):   at (wrapper dynamic-method) object.ef0cbed4-d667-4c45-afeb-956f6eb4a1f6 (intptr,intptr,intptr) <0x00043>
08-20 20:22:55.404 E/mono-rt (18249):   at (wrapper native-to-managed) object.ef0cbed4-d667-4c45-afeb-956f6eb4a1f6 (intptr,intptr,intptr) <0xffffffff>
08-20 20:22:55.404 E/mono-rt (18249): 
08-20 20:22:55.404 E/mono-rt (18249): =================================================================
08-20 20:22:55.404 E/mono-rt (18249): Got a SIGSEGV while executing native code. This usually indicates
08-20 20:22:55.404 E/mono-rt (18249): a fatal error in the mono runtime or one of the native libraries 
08-20 20:22:55.404 E/mono-rt (18249): used by your application.
08-20 20:22:55.404 E/mono-rt (18249): =================================================================
Comment 4 Tim Jowers 2013-08-20 21:10:54 UTC
This one looks like a Xamarin issue as far as I can tell...

[] * Assertion at /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/b76e8ec4/source/mono/mono/utils/lock-free-alloc.c:391, condition `next < SB_USABLE_SIZE / desc->slot_size' not met
[mono-rt] Stacktrace:
[mono-rt] 
[mono-rt]   at <unknown> <0xffffffff>
[mono-rt]   at (wrapper managed-to-native) string.InternalAllocateStr (int) <0xffffffff>
[mono-rt]   at string.ConcatInternal (string[],int) <0x00033>
[mono-rt]   at string.Concat (string[]) <0x00067>
[mono-rt]   at CFM.AdapterClasses.MarketCallListAdapter.orderCallsByCity () 


Oh yeah, running on Android 4.1.2 and Galaxy Note II.
Comment 5 Tim Jowers 2013-08-20 21:34:25 UTC
maybe app error but just restarted app....
[] * Assertion at /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/b76e8ec4/source/mono/mono/utils/lock-free-alloc.c:383, condition `old_anchor.data.state == STATE_PARTIAL' not met
[mono-rt] Stacktrace:
[mono-rt] 
[mono-rt]   at <unknown> <0xffffffff>
[mono-rt]   at (wrapper managed-to-native) System.Runtime.InteropServices.GCHandle.GetTargetHandle (object,int,System.Runtime.InteropServices.GCHandleType) <0xffffffff>
[mono-rt]   at System.Runtime.InteropServices.GCHandle..ctor (object,System.Runtime.InteropServices.GCHandleType) <0x00037>
[mono-rt]   at System.Runtime.InteropServices.GCHandle.Alloc (object,System.Runtime.InteropServices.GCHandleType) <0x0002b>
[mono-rt]   at System.WeakReference.AllocateHandle (object) <0x0002b>
[mono-rt]   at System.WeakReference..ctor (object,bool) <0x00027>
[mono-rt]   at Java.Lang.Object.RegisterInstance (Android.Runtime.IJavaObject,intptr,Android.Runtime.JniHandleOwnership) <0x002a3>
[mono-rt]   at Java.Lang.Object.SetHandle (intptr,Android.Runtime.JniHandleOwnership) <0x00023>
[mono-rt]   at Java.Lang.String..ctor (string) <0x00213>
[mono-rt]   at Java.Interop.JavaConvert.<LocalJniHandleConverters>m__B8 (object) <0x00047>
[mono-rt]   at Java.Interop.JavaConvert.WithLocalJniHandle<string, intptr> (string,System.Func`2<intptr, intptr>) <0x0015b>
[mono-rt]   at Android.Runtime.JNIEnv.NewObjectArray<T> (T[]) <0x002bf>
[mono-rt]   at Android.Widget.ArrayAdapter`1..ctor (Android.Content.Context,int,T[]) <0x00057>
[mono-rt]   at CFM.AsyncTasks.GetCommonParts.OnPostExecute (Java.Lang.Object) <0x0004f>
[mono-rt]   at Android.OS.AsyncTask.n_OnPostExecute_Ljava_lang_Object_ (intptr,intptr,intptr) <0x00057>
[mono-rt]   at (wrapper dynamic-method) object.08f2c186-4a2b-4c2b-b861-33437948d79c (intptr,intptr,intptr) <0x00043>
[mono-rt]   at (wrapper native-to-managed) object.08f2c186-4a2b-4c2b-b861-33437948d79c (intptr,intptr,intptr) <0xffffffff>
[mono-rt] 
[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] =================================================================
[mono-rt]
Comment 6 Rodrigo Kumpera 2013-08-28 17:48:00 UTC
Hi Tim,

Can you provide us with a way to reproduce those issues?
What device are you running your app on?
Comment 7 Jonathan Pryor 2013-08-28 17:48:56 UTC
@kumpera: That was provided in Comment #4:

> Oh yeah, running on Android 4.1.2 and Galaxy Note II.
Comment 8 Jonathan Pryor 2013-08-28 17:50:47 UTC
@Tim: By any chance are you using the armeabi runtime, i.e. not the armeabi-v7a runtime? The armeabi runtime is NOT SMP safe, and the Galaxy Note II is a quad-core device.
Comment 9 Rodrigo Kumpera 2013-08-28 17:51:24 UTC
Hi Tim,

Are you, by any chance running an arm-v5 build on a multicore arm device?

This configuration is known to have this kind of instability and we're working on fixing them.
In the meanwhile, could you try to enable v7 builds and try again?
Comment 10 Tim Jowers 2013-08-29 07:32:26 UTC
Thank you Rodrigo,

I haven't seen this problem any more in the last week or so. 

My settings are:
Target framework: Android 3.1 (Honeycomb)   - probably can change that to 4.0 or 4.1.

Configuration: Release   Platform: Any CPU   - only available choice
Platform target: Any CPU


Android Build
Supported ABIs
x  armeable

So, I'll try with armeabi-v7a.
Built Release and running with armeabi-v7a and it is also working fine. 
Sorry, do no longer have the older version where the problem occurred. Did clean up lifecycle and other aspects of this app.
Comment 11 Jonathan Pryor 2013-08-29 11:07:21 UTC
As mentioned in our CPU Architecture docs, if your app may run on an SMP device you _must_ embed the armeabi-v7a runtime. The armeabi runtime WILL fail in OBSCURE ways when executing on SMP devices, such as the Galaxy Note II.

http://docs.xamarin.com/guides/android/advanced_topics/cpu_architecture