App doesn't run on Samsung S7 (sometimes)

AnatoliyTanaschukAnatoliyTanaschuk Anatoliy TanaschukNOMember
edited April 2016 in Xamarin.Forms

Hi. I.m supporting an Xamarin.Forms application and it was working just fine until we tried it on the newest Samsung S7. Sometimes it works but sometimes it doesn't (30% works: 70% doesn't work) and I have no clue what is up to. Because sometimes it's just crashing, sometimes it throws an unhandled exception on start (I don't know where to catch it), but in most cases it throws an exception called System.ExecutionEngineException: SIGILL. And CallStack looks a bit weird on it. Almost always the topmost Stack Frame has an Hex value on the beginning 0xFFFFFFFFFFFFFFFF when the second topmost just before him has much lower value (one byte) size, f.ex. 0xE6. I don't know what does it mean but it looks suspicious.

Here is some examples of Call Stack
======= 1st exmpl ==========================================

0xFFFFFFFFFFFFFFFF in Mono.Security.Protocol.Tls.SslStreamBase.InternalAsyncResult.get_Count at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs C#

0x26 in Mono.Security.Protocol.Tls.SslStreamBase.InternalBeginWrite at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:778,6 C#
0x4A in Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:112,7 C#
[External Code]

======= 2nd exmpl =========================================

0xFFFFFFFFFFFFFFFF in System.Net.IPAddress.get_AddressFamily at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net/IPAddress.cs C#

0x35 in System.Net.Dns.hostent_to_IPHostEntry at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net/Dns.cs:307,6 C#
0x2E in System.Net.Dns.GetHostByName at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net/Dns.cs:421,4 C#
0xAA in System.Net.ServicePoint.get_HostEntry at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net/ServicePoint.cs:369,7 C#
0x8A in System.Net.WebConnection.Connect at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net/WebConnection.cs:170,5 C#
0x46 in System.Net.WebConnection.InitConnection at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net/WebConnection.cs:772,4 C#
0x2 in System.Net.WebConnection.AnonymousMethod__0 at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net/WebConnection.cs:124,6 C#
[External Code]

======= 3rd exmpl ===========================================

0xFFFFFFFFFFFFFFFF in System.Net.Sockets.SocketAsyncResult.set_Total at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs C#

0xE6 in System.Net.Sockets.SocketAsyncWorker.Send at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net.Sockets/SocketAsyncWorker.cs:357,5 C#
0x60 in System.Net.Sockets.SocketAsyncWorker.DispatcherCB at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net.Sockets/SocketAsyncWorker.cs:71,5 C#
[External Code]
0x6 in System.Net.Sockets.SocketAsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem at /Users/builder/data/lanes/3053/a94a03b5/source/mono/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs:307,4 C#

I googled a lot about this issue, and the solution with turning off arm64-v8a architecture (https://forums.xamarin.com/discussion/62635/samsung-galaxy-s7-sm-g935f-crashes) does not help me at all.

I've tried many things but none of them could fix this issue. But we need a working application for **all **users, even/especially for users with the newest devices.

I'm using latest Xamarin 4.0.3.; Visual Studio 2015
Properties > Application:
Compile using Android version: Use Latest platform (Android 6.0 (Marshmallow))
Minimum Android to target: API Level 15 (Android 4.0.3)
Target Android version: API Level 19 (Android 4.4)

Answers

  • xushilin.2948xushilin.2948 xu shilin USMember

    I also have this problems.

  • RenaudLaloireRenaudLaloire Renaud Laloire BEUniversity ✭✭

    Me too ...

  • Jesse_JiangJesse_Jiang Jesse Jiang USMember ✭✭✭

    Me too, My Boss just bought this phone for testing and it happens. I told my boss I don't know how to fix this. I hope my boss should not buy this phone.....

  • MnetKrishnaMnetKrishna Krishna Gandhi USMember

    Our application is also affected. The boss of my client has this phone and it's not looking good for us right now :neutral:

  • JohnHardmanJohnHardman John Hardman GBUniversity ✭✭✭✭✭

    I don't have a Samsung S7, but would like to check whether my app hits this problem. Has anybody tried using an emulator/simulator for the S7? If so, does that also show this problem?

  • AnatoliyTanaschukAnatoliyTanaschuk Anatoliy Tanaschuk NOMember
    edited July 2016

    @JohnHardman If you don't have S7 you can easily check it if you use Xamarin Insights or HockeyApp. I couldn't find any S7 emulator, and it's not that easy to emulate this problem either, because what I think the problem here is hidden in high resolution of S7 display, bitmap rendering and garbage collecting.

  • Angry_MonkAngry_Monk Marc Noon USMember

    Anyone found a solution to this problem? Is this only on Xamarin Forms?

  • ArthurKaterArthurKater Arthur Kater TWMember ✭✭

    Similar problem here:
    App (Android, MvvmCross) runs fine on emulator and several non-Samsung S7 phones. However, on Samsung S7 it crashes at seemingly random places. All crashes have "android.runtime.JavaProxyThrowable: System.ExecutionEngineException: SIGILL" in common.

  • ThibaultDThibaultD Thibault Durand SEMember ✭✭✭

    I do also get a non-negligible number of crash reports from Samsung devices (mainly S7) that are related to System.Security.*

    Such as

    sm-g930f

    System.ArgumentOutOfRangeExceptionNon-negative number required. Parameter name: inputOffset
    Raw
      at System.Security.Cryptography.HashAlgorithm.TransformBlock (System.Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, System.Byte[] outputBuffer, Int32 outputOffset) <0xd191eca0 + 0x00130> in <filename unknown>:0 
      at Mono.Security.Cryptography.HMAC.HashCore (System.Byte[] array, Int32 ibStart, Int32 cbSize) <0xd17aeee8 + 0x0009b> in <filename unknown>:0 
    

    sm-g935f

    System.NullReferenceExceptionObject reference not set to an instance of an object
    Raw
      at Mono.Security.Cryptography.MD5SHA1.HashFinal () <0xd05b1ee0 + 0x00020> in <filename unknown>:0 
    

    It's pretty worrying. My guess is that Mono uses some underlying built-in security functions that are unstable on Samsung phones.
    That would be interesting to hear what Xamarin engineers know about the System.Security stack on Android.
    Poke @BrendanZagaeski @JonathanDick @JonathanPryor

  • Sassou_BSassou_B safa bellalah USMember

    Anyone found a solution to this problem?

  • MabroukMabrouk Mabrouk MAHDHI USMember ✭✭✭
    edited September 2016

    Hi friends,
    @AnatoliyTanaschuk, @safabellalah
    Try to check this in your android options : Select Android project > Properties >Android Options> Advanced.

    Hope it helps you ;)

  • ShantimohanElchuriShantimohanElchuri Shantimohan Elchuri USMember ✭✭✭✭

    I am just detailing my experience.

    First I had Note 4 and my app was running fine on it.

    Then I got it upgraded to Note 7 and on first go my app worked on it. Then came the sad and bad news about Note 7. I got it exchanged with S7 Edge.

    First my app didn't work on S7 Edge. It was just crashing on deploying itself. No errors displayed. Thus I got to this thread. As per @Mabrouk post, checked the Advanced settings. Actually all boxes checked for it. Seeing the 'arm...' in these options thought I should try with ARM in the VS's Processor dropdown...and that worked.

    Hope it may help few more at least.

  • Sassou_BSassou_B safa bellalah USMember

    @Mabrouk MAHDHI ,
    Thanks for your reply ... but this solution works only in mode Debug, it doesn't work for release mode.

  • MabroukMabrouk Mabrouk MAHDHI USMember ✭✭✭

    @safabellalah

    Change to release mode, and do the same thing ;)

    Mabrouk.

  • RasmusBjergRasmusBjerg Rasmus Bjerg DKMember ✭✭

    The way i fixed this issue, which is still a problem in Cycle 8 release 1, is to target armeabi, armeabi-v7a, arm64-v8a and select Generate one package (.apk) per selected ABI, and let the Samsung use arm64-v8a.
    I got alot of complains and saw 5-10 crashes per day, from around 350 Samsung galaxy S7/Edge devices, and i know that the crashes i saw, was just the top of the rock. But after i released the 3 different APK to Google Play, instead of only armeabi-v7a, i haven´t seen any crashes, or got any complains.

    Hope it helps..

Sign In or Register to comment.