Fatal signal 11 (SIGSEGV), code 1, fault addr 0x18 in tid 5091 - c#

I want to build my application on Asus_Z008D but I have this problem:
[Mono] Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
[mono-rt] Stacktrace:
[mono-rt]
[mono-rt]
[mono-rt] Attempting native Android stacktrace:
[mono-rt]
[mono-rt] at ???+0 [0xe20ab667]
[mono-rt] at mono_class_get_field_from_name+31 [0xe20ab73f]
[mono-rt] at ???+31 [0xf2f7e9a2]
[mono-rt] at ???+31 [0xf2f7ebe3]
[mono-rt] at Java_mono_android_Runtime_init+2127 [0xf2f812b0]
[mono-rt] at ???+2127 [0xe29dcde2]
[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]
[libc] Fatal signal 11 (SIGSEGV), code 1, fault addr 0x18 in tid 5091 (ru.roadaccident)
Application crashed on LaunchScreen, breakpoints in main activity and LaunchScreen not worked. On other devices app work so well; I using Xamarin.Forms in Xamarin Studio; Please, help me;

Are you building your APK to support the x86 and x86_64 architectures? The Asus_Z008D uses Intel Atom CPU, not ARM. See:
http://specdevice.com/showspec.php?id=6a09-4fd1-ffff-ffff924a117c
So if you are only building for ARM architectures, or using any libraries that are only built for ARM, the app won't work on an x86/x86_64 device.

Related

Xamarin Forms: System.InvalidProgramException: Invalid IL code in Android.Runtime.AndroidTypeManager:RegisterNativeMembers

I'm getting the following exception while building my Xamarin Forms app in release mode:
[GraphicsEnvironment] Neither updatable production driver nor prerelease driver is supported.
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[MultiDex] VM with version 2.1.0 has multidex support
[MultiDex] Installing application
[MultiDex] VM has multidex support, MultiDex support library is disabled.
[monodroid-gc] GREF GC Threshold: 46080
[CompatibilityChangeReporter] Compat change id reported: 183155436; UID 10158; state: ENABLED
[FirebaseApp] Device unlocked: initializing all Firebase APIs for app [DEFAULT]
[FirebaseInitProvider] FirebaseApp initialization successful
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in Android.Runtime.AndroidTypeManager:RegisterNativeMembers (Java.Interop.JniType,System.Type,System.ReadOnlySpan`1<char>): IL_0240: stloc.s 19
[mono-rt]
[mono-rt]
[mono-rt] at Android.Runtime.JNIEnv.RegisterJniNatives (System.IntPtr typeName_ptr, System.Int32 typeName_len, System.IntPtr jniClass, System.IntPtr methods_ptr, System.Int32 methods_len) [0x00088] in <7685f94735ec4635bcf7c23732e3db0f>:0
Application while deploying in release mode stuck on splash screen.
XF version: 5.0.0.2545
Visual studio MAC 17.4.1
Referred this thread, but didn't help.

Native Xamarin.Android app keeps crashing in release mode

I have a native Xamarin.Android app I've built a few years back and I've been maintaining it since then. Lately, I tried to build a new release but the app keeps crashing. I did tens of releases in the past using the same project and compilation settings. Here's an exemple of a stack trace I get in release:
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies.
[mono-rt] at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction10-21 13:24:49.970 F/mono-rt (15785): File name: 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
[mono-rt] at Java.Interop.JniEnvironmentInfo..ctor () [0x00006] in :0
[mono-rt] at Java.Interop.JniEnvironment+c.b__35_0 () [0x00000] in :0
[mono-rt] at System.Threading.ThreadLocal`1[T].GetValueSlow () [0x00031] in :0
[mono-rt] at System.Threading.ThreadLocal`1[T].get_Value () [0x0003e] in :0
[mono-rt] at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in :0ds.CallStaticObjectMethod (Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0002d] in :0
[mono-rt] at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeObjectMethod (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x00018] in :0
[mono-rt] at Java.Interop.JniEnvironment+StaticMet10-21 13:24:49.970 F/mono-rt (15785): at Android.OS.Looper.get_MainLooper () [0x0000a] in :0
[mono-rt] at Android.Runtime.AndroidEnvironment.GetDefaultSyncContext () [0x00000] in :0
[mono-rt] at System.AndroidPlatform.GetDefaultSyncContext () [0x00000] in :0
[mono-rt] at System.Threading.SynchronizationContext.GetThreadLocalContext () [0x00005] in :0
[mono-rt] at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run (System.Threading.Tasks.Task ignored, System.Boolean canInlineContinuationTask) [0x00003] in :0
[mono-rt] at System.Threading.Tasks.Task.FinishStageThree () [0x0003c] in :0
[mono-rt] at System.Threading.Tasks.Task`1[TResult].TrySetResult (TResult result) [0x0004f] in :0
[mono-rt] at System.Threading.Tasks.TaskFactory`1+c__DisplayClass38_0`1[TResult,TArg1].b__0 (System.IAsyncResult iar) [0x00008] in :0
[mono-rt] at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in 10-21 13:24:49.970 F/mono-rt (15785): at (wrapper managed-to-native) System.Runtime.Remoting.Messaging.AsyncResult.Invoke(System.Runtime.Remoting.Messaging.AsyncResult)
[mono-rt] at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00000] in :0
[mono-rt] at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in :0
From the stack trace, I have a feeling it might be a problem with the linker, but I have tried all 3 settings (Don't link, link SDK assemblies only, link all). When changing some code here and there, I have sometimes slightly different stack traces, but nothing really helpful. Here's the compilation settings I'm using:
From time to time, the app will launch successfully without changing anytime special. It will only work once.
What I'm I missing?
I am pretty sure that you have some weird behavior in release. Since you use mono on android you may call an await function somewhere that return a Task<T> you must not use the await but .GetAwaiter().Result.
https://github.com/xamarin/xamarin-android/issues/6409
Make sure your .NET framework is patched. Microsoft released patches to .NET to allow Portable Class Libraries to properly find the appropriate runtime (KB2468871). If you are seeing the above exception (or something like it), it means you’re missing the latest .NET framework patches.
You can read more about Portable Class Libraries on MSDN.

Repetive calling of C DLL in C# (using DLLimport)

Using Mono (JIT compiler version 3.2.8) in Ubuntu 64bit, I am calling a C DLL within a C# source code using something like this:
[DllImport("/home/user/path/to/my.dll")]
private static extern void mydll(int argument1, int argument2, ref int arguemnt3,
[MarshalAs(UnmanagedType.LPArray)] double[] argument4,
[MarshalAs(UnmanagedType.LPArray)] int[] argument5,
string argument6)
This worked flawless on an older Ubuntu 32bit machine. Now, on my new 64bit machine I run into the following strange behavior.
The first time I call the DLL in the C# source code it (apparently) works fine. The DLL returns arguments as expected and no error is raised. However, any further attempt to call the same DLL in the further code fails with following errors:
Stacktrace:
at <unknown> <0xffffffff>
at (wrapper managed-to-native) object.__icall_wrapper_mono_array_to_lparray (object) <0xffffffff>
at (wrapper managed-to-native) mydll(int,int,int,int,int,int,int,double[],double[],double[],double[],double[],int&,int&,double[],double[],int,int[],int,double[],int,string,int,int,int,int) <0xffffffff>
at mydll (System.Collections.Generic.Dictionary`2<string, int>,double[],double[],double[],System.Collections.Generic.Dictionary`2<string, int>,System.Collections.Generic.Dictionary`2<string, double>,string) <0x0094b>
at Example.Main () <0x00457>
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
mono() [0x4b73d8]
mono() [0x50f13b]
mono() [0x423d22]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f2898a2c340]
mono() [0x550136]
[0x4139cd9d]
Debug info from gdb:
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No threads.
=================================================================
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.
=================================================================
I am very new to C# and quite clueless why that happens.
Maybe anyone could enlighten me?
Thanks a lot!

Xamarin Android: Calling Native Library Methods of SO file Crashing with SIGSEGV

I am working on Android with Xamarin Studio
I have added the SO file into libs and followed the steps described in the Xamarin docs.
My application is able to build and running device But during calling a native method from SO file shared library I am getting the fallowing exception
Stacktrace:
[mono-rt]
[mono-rt] at <unknown> <0xffffffff>
[mono-rt] at (wrapper managed-to-native)_init (string,int) <IL 0x00038, 0xffffffff>
[mono-rt] at (wrapper dynamic-method) object.cbf4c5d8-8ed7-41b7-954a-1802bf0daaf0 (intptr,intptr,int,intptr) <IL 0x0001d, 0x00053>[mono-rt] at (wrapper native-to-managed) object.cbf4c5d8-8ed7-41b7-954a-1802bf0daaf0 (intptr,intptr,int,intptr) <IL 0x00026, 0xffffffff>
[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.
[libc] Fatal signal 11 (SIGSEGV) at 0x766566d3 (code=1)
I would like to know why the above crash coming how to resolve it?

SIGSEGV In System.MonoEnumInfo.get_enum_info

I'm trying to run a C# app in Mono on Linux. I'm using EF6, it has some types that are mapped to enums. The first time my app queries the DB (VistaDB) I get the following stack trace (its actually much larger...)
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.MonoEnumInfo.get_enum_info (System.Type,System.MonoEnumInfo&) <IL 0x0000e, 0xffffffff>
at System.MonoEnumInfo.GetInfo (System.Type,System.MonoEnumInfo&) [0x00076] in /build/buildd/mono-3.2.8+dfsg/mcs/class/corlib/System/Enum.cs:176
at System.Enum.GetNames (System.Type) [0x0002d] in /build/buildd/mono-3.2.8+dfsg/mcs/class/corlib/System/Enum.cs:334
at System.Data.Entity.Core.Metadata.Edm.EnumType..ctor (System.Type) <IL 0x00056, 0x001eb>
at System.Data.Entity.Core.Metadata.Edm.ClrEnumType..ctor (System.Type,string,string) <IL 0x00002, 0x00027>
at System.Data.Entity.Core.Metadata.Edm.OSpaceTypeFactory.TryCreateEnumType (System.Type,System.Data.Entity.Core.Metadata.Edm.EnumType,System.Data.Entity.Core.Metadata.Edm.EdmType&) <IL 0x00027, 0x0009f>
at System.Data.Entity.Core.Metadata.Edm.OSpaceTypeFactory.TryCreateType (System.Type,System.Data.Entity.Core.Metadata.Edm.EdmType) <IL 0x0003b, 0x000eb>
at System.Data.Entity.Core.Metadata.Edm.ObjectItemConventionAssemblyLoader.LoadTypesFromAssembly () <IL 0x0006c, 0x0010c>
at System.Data.Entity.Core.Metadata.Edm.ObjectItemAssemblyLoader.Load () <IL 0x00007, 0x0001f>
at System.Data.Entity.Core.Metadata.Edm.ObjectItemAssemblyLoader.LoadAssemblies (System.Collections.Generic.IEnumerable`1<System.Reflection.Assembly>,System.Data.Entity.Core.Metadata.Edm.ObjectItemLoadingSessionData) <IL 0x00019, 0x00072>
at System.Data.Entity.Core.Metadata.Edm.ObjectItemAssemblyLoader.LoadClosureAssemblies () <IL 0x00011, 0x00023>
at System.Data.Entity.Core.Metadata.Edm.ObjectItemAssemblyLoader.Load () <IL 0x00013, 0x00031>
...
Native stacktrace:
mono() [0x4b73d8]
mono() [0x50f13b]
mono() [0x423d22]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fd7577c0340]
mono(mono_class_from_mono_type+0x6) [0x525736]
mono() [0x5428a4]
[0x41d0d6f3]
...
=================================================================
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.
=================================================================
Based on this I suspect there is a problem with Mono. I'm running Ubuntu 14 with Mono 3.2.8 (installed using apt-get). Has anyone else run into this? If I remove the enum mappings from EF will that fix the problem?
Update
I tried running the same on my macbook running Mono 3.4, and I got the same error. So I suspect it's a bug with Mono.
I upgraded to mono 3.6.1 and EF seems to be working well! Looks like mono 3.2.8 does not work with EF 6 and vista db

Categories

Resources