SIGABRT while debugging async methods

RicardoSRicardoS ✭✭✭ESMember ✭✭✭

These methods used to work fine, but iOS rejected our latest App version because an unspecified error.

While debugging, they work fine, unless you go step by step after a breakpoint. After said methods finish, we get this exception:

´=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================´

We cannot progress and send the app to the store unless this gets corrected.

A brief example of one of our async methods:

async Task chargeLists () {
//Hide main screen
scroll.IsVisible = false;
//Show hidden screen with an ActivityIndicator and a "Loading" text
overlay.IsVisible = true;
await Task.Run (() => {
//Do something while thinking
});
//Hide creen with an ActivityIndicator
overlay.IsVisible = false;
//Show main screen
scroll.IsVisible = true;
}

This method is used in the first screen and is called by:

protected override async void OnAppearing () {
try {
await chargeLists ();
base.OnAppearing ();
} catch (Exception ex) {
Debug.WriteLine (string.Format ("Error: {0}", ex.Message));
}
}

protected override async void OnDisappearing () {
try {
await chargeLists ();
base.OnDisappearing ();
} catch (Exception ex) {
Debug.WriteLine (string.Format ("Error: {0}", ex.Message));
}
}

Please and thank you for your help.

Best Answer

  • RicardoSRicardoS ✭✭✭ ES ✭✭✭
    Accepted Answer

    Eh... Good news, everyone? The issue has disappeared, somehow?

    I say this with "question marks" because the error decides to pop up sometimes.
    But the truly good news is that, at last, we were able to upload an app to iTunes Connect and it wasn't rejected.

    Hoorray!
    If you still have this issue, I can tell you for sure that we have NO IDEA about how or why it stopped happening.
    Nor what is the cause. In fact, this just came out unexpectedly.
    Apple accepts our application without complaints, not that I mind that, but it was so sudden that made us unable to pinpoint WHERE the problem was.

    Anyways, for this who still experience this, I hope you find someone with enough patience to help you out.

    Best Regards

«1

Answers

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    I will add the Crash-log supplied by iTunes Connect, hope this helps:

    Attached PDF log.

    log.pdf 73.9K
  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    An update:

    This line appears at the beginning of the Error (the whole SIGABRT) when debugging on the simulator:

    2017-06-06 12:06:55.653 RutasRegulares.iOS[1241:157246] error: * Assertion at /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/external/mono/mono/mini/debugger-agent.c:4707, conditionarray->len == 1' not met`

    RutasRegulares == Xamarin.Forms project name.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    Does anyone know how to symbolicate the log (in the second comment) without the help of Xcode?

    Maybe what's wrong is in those hex numbers.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    More news, everyone.
    I executed the app in an iPad and it failed to load, but gave me this message:

    dyld: Library not loaded: @rpath/libXamarin.Forms.Maps.dll.dylib Referenced from: /var/containers/Bundle/Application/6B7DF949-4056-4828-AF5C-339CCB643385/RutasRegulares.iOS.app/RutasRegulares.iOS Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/6B7DF949-4056-4828-AF5C-339CCB643385/RutasRegulares.iOS.app/libXamarin.Forms.Maps.dll.dylib: code signature invalid for '/private/var/containers/Bundle/Application/6B7DF949-4056-4828-AF5C-339CCB643385/RutasRegulares.iOS.app/libXamarin.Forms.Maps.dll.dylib'

    Again, "RutasRegulares.iOS" is the project's name.

  • DhilluDhillu ✭✭✭ INMember ✭✭✭

    Can you post a sample reproducing the issue.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    What is a sample, @Dhillu ?

  • DhilluDhillu ✭✭✭ INMember ✭✭✭

    Sample project.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    Errm, is it necessary?

  • DhilluDhillu ✭✭✭ INMember ✭✭✭

    Would like to debug on my end, just a sample with dummy urls.
    Yes, Apple will reject the app in this case.

    Try checking the memory leaks using Instruments, follow this

    https://www.raywenderlich.com/97886/instruments-tutorial-with-swift-getting-started

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    I don't have Swift, nor can I download it.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    I tried to use Leaks on the info.plist, but every time fails to run.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭
  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    News (not good new nor bad), after more than 10 day without an answer, I tried HockeyApp (I think I did everything you need to control this error?) and received this error message:

    error: * Assertion at /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/external/mono/mono/mini/debugger-agent.c:4707, conditionarray->len == 1' not met`

    Is this a step forward or should I quit programming?

  • DhilluDhillu ✭✭✭ INMember ✭✭✭

    @RicardoS
    I was too late :wink:

    Just downloaded your sample repo,
    Initially it is hiding your scrollview and showing your stacklayout
    Printing 500 numbers
    Showing scrollview and hiding stacklayout

    I have noticed the issue is not reproduced, don't know whether you test it or not.

    And my assumption is in real case instead of looping numbers you might have calling a REST api,
    I would suggest you to use

    Device.BeginInvokeOnmainThread(()=>{

    scroll.IsVisible = false;
    overlay.IsVisible = true;

    });

    Device.BeginInvokeOnmainThread(()=>{

    overlay.IsVisible = false;
    scroll.IsVisible = true;

    });

    this will invoke the mainthread in the given context and updates the UI, you cannot update the UI elements in abackground thread.

    Hope this helps !

    Don't forget to post this solved you issue or not.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭
    edited June 2017

    @Dhillu Yes I tested the sample.
    Did you put the breakpoint on the comment line and debugged step by step?
    Thanks for your suggestion, I'm trying it right now!

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    Nope, got the same error:

    error: * Assertion at /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/external/mono/mono/mini/debugger-agent.c:4707, conditionarray->len == 1' not met`

  • DhilluDhillu ✭✭✭ INMember ✭✭✭

    Yes,
    have look at the attachments




  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭
    edited June 2017

    What platform did you use?
    Xamarin Studio, Visual Studio for Mac or ...?
    What version of said platform?
    iOS emulator or Phone, and the Operative System?

    Thank you for your time and sorry for bothering.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    This bug/issue/whatever has been posted on the Microsoft Developer Community Forums and they insist that is Xamarin's fault.

    I've lost my patience.

  • DominicNDominicN Xamurai USForum Administrator, Xamarin Team, University Xamurai

    Hey Ricardo - I responded to you on the Developer Community Forums a few days ago. Sorry it's taken me so long to find this post as well.

    I suggested you reach out for Xamarin support via our official support means as I wanted to ensure you were able to communicate with a dedicated professional to help you in the most efficient manner. If you haven't been able to come to a resolution yet, could you please reach out to me via DM?

    Thanks and sorry for the issues!

  • Karthikeyan1993Karthikeyan1993 ✭✭ USMember ✭✭

    Hi @RicardoS

    I too got the same error - SIGABRT while debugging async methods

    Did you found any solution for this?

    Thanks,
    Karthikeyan

  • JessLpezJessLpez ✭✭ USMember ✭✭

    Hi @RicardoS, I'm getting the same error, did you find a solution?

  • JahmaiJahmai ✭✭ AUMember ✭✭

    Same, is there a Bugzilla issue created for this yet?

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    @KarthikeyanVengidusamy.0809 @JessLpez @Jahmai
    No, this is not over yet, and I doubt there is going to be a Bugzilla issue.

    On the other hand, I am in contact with a Microsoft Support clerk and they are sending reports to the Xamarin Team.

  • JahmaiJahmai ✭✭ AUMember ✭✭

    If anyone has a repro, definitely create a Bugzilla for it, these forums DO NOT get issues resolved.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    If anyone has a what, @Jahmai ?

  • JahmaiJahmai ✭✭ AUMember ✭✭

    @RicardoS A reproduction project that demonstrates the issue for the Xamarin team to easily fix it.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    I filed a Bugzilla report, or at least I think I did...

    here: https://bugzilla.xamarin.com/show_bug.cgi?id=59015

  • William_McAinshWilliam_McAinsh ✭✭ USMember ✭✭

    I can't view the bugzilla report, it says I don't have access.. Do you have a resolution to this?

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    @William_McAinsh Sorry, no idea of how.
    Anyone?

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭
    edited September 2017

    We've found a solution, that unfortunately does not work.

    Instead of async methods, we used Task.Factory.StartNew(async delegate { }, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default).Unwrap();

    This solved the issue of "getting a SIGABRT while debugging", but when we sent the code to iTunes Connect, rejection, due to the same error. Here you have an excerpt:

    `Exception Type: EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note: EXC_CORPSE_NOTIFY
    Triggered by Thread: 0

    Application Specific Information:
    abort() called`

    Can anyone give us a solution, or do I have to quit?

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    Not that we need a solution NOW, as we've been unable to update our iOS apps for FOUR MONTHS, mind you...

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    If there is anything we forgot to mention (it must be), please tell us and we'll oblige.

  • BenjaminTooleBenjaminToole ✭✭✭ USMember ✭✭✭

    I would get this error in some async functions. I would add a Task.Delay(*some time*) after the awaited method inside the async function. For some reason it would get rid of the error for me. Not sure if its related to your problem but it worked for me.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    Now the problem has changed, @BenjaminToole :

    @RicardoS said:
    We've found a solution, that unfortunately does not work.

    Instead of async methods, we used Task.Factory.StartNew(async delegate { }, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default).Unwrap();

    This solved the issue of "getting a SIGABRT while debugging", but when we sent the code to iTunes Connect, rejection, due to the same error. Here you have an excerpt:

    `Exception Type: EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note: EXC_CORPSE_NOTIFY
    Triggered by Thread: 0

    Application Specific Information:
    abort() called`

    Can anyone give us a solution, or do I have to quit?

    fourth comment (fifth if you count this one) from the bottom.

  • PrabhakarRayPrabhakarRay ✭✭ GBMember ✭✭

    Hey RicardoS,

    did you find the solution to this problem ? I'm facing the same problem where the app is crashing (only one physical devices) in one of the async calls.

    Regards,
    Prabhakar

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    Not yet, @PrabhakarRay .

    If I were you, I would search for another programming platform and start anew.
    That's what we are doing right now.

    Best regards.

  • PrabhakarRayPrabhakarRay ✭✭ GBMember ✭✭
    edited November 2017

    Thanks for replying @RicardoS. Actually the error is not popping up right now after I updated xamarin studio.

    Apparently this was happening on 32 bit devices only.

    Check out this link.
    https://bugzilla.xamarin.com/show_bug.cgi?id=49056

    But I agree with you totally. The platform is really unstable.

  • RicardoSRicardoS ✭✭✭ ESMember ✭✭✭

    Thank you for your response, @PrabhakarRay .
    I'll give it a look.

  • ernestochaveschavesernestochaveschaves ✭✭ Member ✭✭

    @DominicN said:
    Hey Ricardo - I responded to you on the Developer Community Forums a few days ago. Sorry it's taken me so long to find this post as well.

    I suggested you reach out for Xamarin support via our official support means as I wanted to ensure you were able to communicate with a dedicated professional to help you in the most efficient manner. If you haven't been able to come to a resolution yet, could you please reach out to me via DM?

    Thanks and sorry for the issues!

    Did you ever reach a solution for this?

Sign In or Register to comment.