Random unhandled exception Galaxy S6

Hi,
I get the following unhandled exception with my test device S6 with MonoGame 3.5.1, latest Xamarin.Android 7.0.1.3 and previous ones. I have tried everything I can think of but still I can’t find a solution. If anyone has any ideas, please help. Thank you.

Stacktrace:
10-16 20:09:16.651 I/MonoDroid(27321): UNHANDLED EXCEPTION:
10-16 20:09:16.681 I/MonoDroid(27321): System.ExecutionEngineException: SIGILL
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformDrawUserIndexedPrimitives[T] (Microsoft.Xna.Framework.Graphics.PrimitiveType primitiveType, T[] vertexData, System.Int32 vertexOffset, System.Int32 numVertices, System.Int16[] indexData, System.Int32 indexOffset, System.Int32 primitiveCount, Microsoft.Xna.Framework.Graphics.VertexDeclaration vertexDeclaration) [0x000af] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawUserIndexedPrimitives[T] (Microsoft.Xna.Framework.Graphics.PrimitiveType primitiveType, T[] vertexData, System.Int32 vertexOffset, System.Int32 numVertices, System.Int16[] indexData, System.Int32 indexOffset, System.Int32 primitiveCount, Microsoft.Xna.Framework.Graphics.VertexDeclaration vertexDeclaration) [0x000c1] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Graphics.SpriteBatcher.FlushVertexArray (System.Int32 start, System.Int32 end, Microsoft.Xna.Framework.Graphics.Effect effect, Microsoft.Xna.Framework.Graphics.Texture texture) [0x00080] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Graphics.SpriteBatcher.DrawBatch (Microsoft.Xna.Framework.Graphics.SpriteSortMode sortMode, Microsoft.Xna.Framework.Graphics.Effect effect) [0x00155] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Graphics.SpriteBatch.FlushIfNeeded () [0x00009] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Graphics.SpriteBatch.DrawInternal (Microsoft.Xna.Framework.Graphics.Texture2D texture, Microsoft.Xna.Framework.Vector4 destinationRectangle, System.Nullable1[T] sourceRectangle, Microsoft.Xna.Framework.Color color, System.Single rotation, Microsoft.Xna.Framework.Vector2 origin, Microsoft.Xna.Framework.Graphics.SpriteEffects effect, System.Single depth, System.Boolean autoFlush) [0x00245] in <b7e9ca9b854342788f9c3f1fe6a85940>:0 10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw (Microsoft.Xna.Framework.Graphics.Texture2D texture, Microsoft.Xna.Framework.Rectangle destinationRectangle, System.Nullable1[T] sourceRectangle, Microsoft.Xna.Framework.Color color, System.Single rotation, Microsoft.Xna.Framework.Vector2 origin, Microsoft.Xna.Framework.Graphics.SpriteEffects effects, System.Single layerDepth) [0x000b2] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Fireball.LevelTypes.PObjectTemplate.Draw (Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch) [0x00008] in C:\Source\Fireball Adventures\Fireball\LevelTypes\PObjectTemplate.cs:91
10-16 20:09:16.681 I/MonoDroid(27321): at Fireball.LevelTypes.Layer.Draw (Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch) [0x00016] in C:\Source\Fireball Adventures\Fireball\LevelTypes\Layer.cs:78
10-16 20:09:16.681 I/MonoDroid(27321): at Fireball.LevelTypes.Level.Draw (Microsoft.Xna.Framework.Graphics.SpriteBatch sb) [0x00016] in C:\Source\Fireball Adventures\Fireball\LevelTypes\Level.cs:253
10-16 20:09:16.681 I/MonoDroid(27321): at Fireball.Screens.GamePlay.DrawScene (Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch) [0x00020] in C:\Source\Fireball Adventures\Fireball\Screens\GamePlay.cs:390
10-16 20:09:16.681 I/MonoDroid(27321): at Fireball.Screens.GamePlay.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x00050] in C:\Source\Fireball Adventures\Fireball\Screens\GamePlay.cs:361
10-16 20:09:16.681 I/MonoDroid(27321): at GameStateManagement.ScreenManager.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x0002f] in C:\Source\Fireball Adventures\GameStateManagement\ScreenManager.cs:276
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Game.<.cctor>b__18 (Microsoft.Xna.Framework.IDrawable drawable, Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Game+SortingFilteringCollection1[T].ForEachFilteredItem[TUserData] (System.Action2[T1,T2] action, TUserData userData) [0x0007d] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Game.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Fireball.GameManagement.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x00015] in C:\Source\Fireball Adventures\Fireball\GameManagement.cs:105
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Game.DoDraw (Microsoft.Xna.Framework.GameTime gameTime) [0x0001c] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.Game.Tick () [0x001ee] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at Microsoft.Xna.Framework.AndroidGameWindow.OnUpdateFrame (System.Object sender, OpenTK.FrameEventArgs frameEventArgs) [0x00053] in :0
10-16 20:09:16.681 I/MonoDroid(27321): at OpenTK.GameViewBase.OnUpdateFrame (OpenTK.FrameEventArgs e) [0x00014] in /Users/builder/data/lanes/3819/96c7ba6c/source/opentk/Source/OpenTK/Platform/Android/GameViewBase.cs:312
10-16 20:09:16.681 I/MonoDroid(27321): at OpenTK.Platform.Android.AndroidGameView.UpdateFrameInternal (OpenTK.FrameEventArgs e) [0x00013] in /Users/builder/data/lanes/3819/96c7ba6c/source/opentk/Source/OpenTK/Platform/Android/AndroidGameView.cs:348
10-16 20:09:16.681 I/MonoDroid(27321): at OpenTK.Platform.Android.AndroidGameView.RunIteration (System.Threading.CancellationToken token) [0x00096] in /Users/builder/data/lanes/3819/96c7ba6c/source/opentk/Source/OpenTK/Platform/Android/AndroidGameView.cs:568
10-16 20:09:16.681 I/MonoDroid(27321): at OpenTK.Platform.Android.AndroidGameView+c__AnonStorey0.<>m__0 (System.Object _) [0x0000d] in /Users/builder/data/lanes/3819/96c7ba6c/source/opentk/Source/OpenTK/Platform/Android/AndroidGameView.cs:458
10-16 20:09:16.681 I/MonoDroid(27321): at Android.App.SyncContext+c__AnonStorey1.<>m__0 () [0x00000] in /Users/builder/data/lanes/3819/96c7ba6c/source/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:32
10-16 20:09:16.681 I/MonoDroid(27321): at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/3819/96c7ba6c/source/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36
10-16 20:09:16.681 I/MonoDroid(27321): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/3819/96c7ba6c/source/monodroid/src/Mono.Android/platforms/android-17/src/generated/Java.Lang.IRunnable.cs:81
10-16 20:09:16.681 I/MonoDroid(27321): at (wrapper dynamic-method) System.Object:4d15fc22-9d58-4bc8-a3a4-7f1f36944f26 (intptr,intptr)
10-16 20:09:16.711 W/art (27321): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
10-16 20:09:16.721 D/Mono (27321): DllImport searching in: ‘__Internal’ (’(null)’).
10-16 20:09:16.721 D/Mono (27321): Searching for ‘java_interop_jnienv_throw’.
10-16 20:09:16.721 D/Mono (27321): Probing ‘java_interop_jnienv_throw’.
10-16 20:09:16.721 D/Mono (27321): Found as ‘java_interop_jnienv_throw’.

I’m not into phones so I could be wrong, but I think it looks like the problem is with MonoDroid rather than monogame…? Maybe you should try the monodroid forums?

Hi, thank you for responding the thread. I am not sure that is MonoDroid stuff because the stacktrace ends in:

Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformDrawUserIndexedPrimitives[T]

this looks like part of the MonoGame src. Correct me if I am wrong.

Generally they had similar issue (the same exception) with the Xamarin.Forms and S7 that they fixed with 7.0.x. but I can’t find anything else.

Update: Here is more info about similar issue:

If anyone is having any clues. Please help. :slight_smile:

Thank you.

I thought for sure this was monodroid complaining. -And so I looked up monodroid and found out it was (apparently) a third-party thing with its own community…

But I’m just tossing up ideas, I don’t have anything more substantial. Good luck!

After some additional research according to Mono community this is kernel issue. Still I will appreciate a workaround If anyone is understanding what is happening here.

Thanks.