Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash Stacks / Line Numbers for Xamarin Apps #165

Open
kensykora opened this issue Mar 8, 2019 · 53 comments
Open

Crash Stacks / Line Numbers for Xamarin Apps #165

kensykora opened this issue Mar 8, 2019 · 53 comments
Assignees
Labels
diagnostics Related to App Center's Diagnostics service do-not-close feature request New feature request

Comments

@kensykora
Copy link

Crashes and errors that are collected today are really nice, but they aren't including line numbers. So when I see a crash with a stacktrace like this, it's really difficult to pinpoint exactly where the exception occurred. At best I can make an educated guess. Especially tricky when it's a very low frequency crash that we haven't been able to reproduce yet

System.NullReferenceException: Object reference not set to an instance of an object

App.MyApp.Services.BluetoothService+<>c.<ReadInitializationData>b__48_0 (App.MyApp.Member.JournalEntryModel x)
System.Linq.Enumerable.Max[TSource,TResult] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] selector)
App.MyApp.Services.BluetoothService+<ReadInitializationData>d__48.MoveNext ()
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task)
System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult ()
App.MyApp.Services.BluetoothService+<>c__DisplayClass34_0+<<InitializePuck>b__0>d.MoveNext ()

I can't think of any alternative way to achieve this behavior. We have considered shipping log data with the crashes to supplement but that only goes so far.

@kensykora kensykora added the feature request New feature request label Mar 8, 2019
@patniko patniko added the diagnostics Related to App Center's Diagnostics service label Mar 10, 2019
@winnie
Copy link

winnie commented Mar 13, 2019

Hi @kensykora - thanks for the feedback. We are unable to display Xamarin line numbers at the moment since we don’t actually process any Xamarin logs and we think this might be a limitation on the Xamarin side. We're currently looking into solutions and I'll keep this thread updated when I have more information. Thanks!

@ajhuntsman
Copy link

Can someone from Microsoft please explain how we're supposed to ship production Xamarin apps, when it's impossible to obtain useful crash reports?

@lexboss777
Copy link

Any update on this?

@baskren
Copy link

baskren commented Sep 2, 2019

What is the status of this?

@Inrego
Copy link

Inrego commented Sep 6, 2019

It's really a pain to fix crashes, when we don't have line numbers..

You even acknowledge that line numers are needed to read and understand crashes..:
https://docs.microsoft.com/en-us/appcenter/diagnostics/ios-symbolication

The stack traces only contain memory addresses and don’t show class names, methods, file names, and line numbers that are needed to read and understand the crashes.

@justintoth
Copy link

Don't hold your breath, I've been waiting 5+ years to get line numbers in my production Xamarin apps logged to HockeyApp (mono-symbolicate never worked for me). Seeming that App Center is a downgrade from HockeyApp (inconsistent logging of handled vs. unhandled exceptions, stack traces showing way less than they used to in HockeyApp, buggy dashboard, etc...) there is absolutely 0% chance of them ever getting this working.

@AhmedAdelAlDesouqy
Copy link

Any update about this issue?
I'm using App Center with Xamarin.Android and there are still no line numbers in the crash reports :(

@catlan
Copy link

catlan commented Apr 1, 2020

@catlan
Copy link

catlan commented Apr 3, 2020

What is underlying issue here? Is it just that mono-symbolicate is not used by appcenter? Or is there a problem with mono-symbolicate as well?

@Mikilll94
Copy link

Any update on this?

@Edgaras91
Copy link

News? Plans? Is there a way to achieve this with debug build?

@Mikilll94
Copy link

@Edgaras91
For debug build, line numbers are shown. For production builds they are not.

@Edgaras91
Copy link

@Edgaras91
For debug build, line numbers are shown. For production builds they are not.

What settings in android options are required to make a build a "debug" build to show the line numbers?

For example, Release Build, what do I need to do to make it build a debug version?

@Mikilll94
Copy link

Mikilll94 commented Jun 4, 2020

@Edgaras91
If you compile your app in "Debug" configuration, then line numbers will be shown in stacktraces.

However, if you compile your app in "Release" configuration, line numbers WILL NOT be shown. That's why this issue is still open.

@Edgaras91
Copy link

Edgaras91 commented Jun 4, 2020

@Edgaras91
If you compile the app in "Debug" configuration, then line numbers will be shown in stacktraces.

However, if you compile your app in "Release" configuration, then line numbers WILL NOT be shown. That's why this issue is still open.

I understand that. I want to convert my Release build, and stay on Release configuration, but I want to instruct the compiler to compile a debug version. There must be an android option to compile with debug information. Right?

@elielson-anjos
Copy link

any progress on this? No line numbers in app crash report renders it pretty much useless...

@baskren
Copy link

baskren commented Nov 12, 2020

This issue has been resolved on the Xamarin.Android side for quite some time:

So, the ball should be in the AppCenter team's court. @winnie, with this information, should there be an update in status from your March 13, 2019 comment? Any insights would be appreciated.

@ghost
Copy link

ghost commented Jun 30, 2021

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

@ryanholden8
Copy link

ryanholden8 commented Jun 30, 2021

Hey @winnie, with the above information, could we get a roadmap indication for this feature? Even if it’s that there is no plans for this feature.

We have production apps that that are still experiencing crashes that we cannot debug because the lack of line numbers make the exact execution path obscure. Knowing if Xamarin will support this in the near future or not will help us with an approach. We are hoping Xamarin gets support but we’ve been hoping at the expense of unfixed crashes.

@ghost ghost removed the Stale label Jun 30, 2021
@baskren
Copy link

baskren commented Jun 30, 2021

@winnie - I want to second @ryanholden8. This is a VERY MUCH NEEDED FEATURE and has been missing much, much too long. Until this is fixed, I cannot recommend AppCenter / Xamarin for Enterprise applications.

@SvenCarstensen
Copy link

Any update about this issue?

@carmanj
Copy link

carmanj commented Aug 20, 2021

@winnie, @ela-malani, @DmitriyKirakosyan - I'd love to hear some progress about this as well. There are multiple reported issues here that have been open for 2.5 years. I'm not entirely sure who the current PMs are for AppCenter, I gather Winnie left a while back. Any information on who the tag would be helpful as well.

At least for us, the funny thing is that AppCenter actually does display line numbers for either the iOS simulator or iOS devices that were being debugged directly via VS2019. These are also listed as unsymbolized crashes in AppCenter, despite appearing as symbolized. Any installs that are built and distributed by AppCenter to our QA members or clients do not include the line information that would be greatly helpful in having to pin down issues.

If we could get a copy of the heap that we could download and open up against VS (similar to what is possible with Azure), that would be even better, but I can at least understand why that might not be possible.

Thanks!
-JC

@amirvenus
Copy link

Frankly, it's very hard to trace what went wrong within the app (if at all possible) without the line numbers.

@amirvenus
Copy link

I would appreciate an update on this please

@ghost ghost removed the Stale label Apr 6, 2022
@baskren
Copy link

baskren commented Apr 6, 2022

Is there any way this issue can get some love?

@AlphaNERD-
Copy link

AlphaNERD- commented Apr 6, 2022

Or maybe, just maybe, expand the REST API to allow us to modify stack traces so at least we can hack together a solution ourselves after years of you blatantly ignoring this very annoying issue.

By the way, there is another issue with the same feature request/complaint!

#324

How can it be that you own both App Center and Xamarin, yet you cannot integrate both of them together properly? Why is Xamarin being treated like a second-class citizen in your own damn products? What next, are you not allowing me to send Mono symbols from Xamarin.Android to the App Center, maybe even through DevOps CI?

Oh wait a minute! That is also an issue! By golly, you really couldn't be bothered to properly support Xamarin, could you?

#2370

EDIT: Just found out that you give people trying to work with .NET 6 the same silent treatment: #86

@davidbuckleyni
Copy link

Or maybe, just maybe, expand the REST API to allow us to modify stack traces so at least we can hack together a solution ourselves after years of you blatantly ignoring this very annoying issue.

By the way, there is another issue with the same feature request/complaint!

#324

How can it be that you own both App Center and Xamarin, yet you cannot integrate both of them together properly? Why is Xamarin being treated like a second-class citizen in your own damn products? What next, are you not allowing me to send Mono symbols from Xamarin.Android to the App Center, maybe even through DevOps CI?

Oh wait a minute! That is also an issue! By golly, you really couldn't be bothered to properly support Xamarin, could you?

#2370

EDIT: Just found out that you give people trying to work with .NET 6 the same silent treatment: #86

It seems Appcentre seems to being retired I have had no communication from them in realtion to whats hapening when maui comes out.

Might I suggest raygun it gives you line numbers and have of late changed their pricing model.

@baskren
Copy link

baskren commented Apr 12, 2022

@davidbuckleyni : Thanks for mentioning RayGun. I hadn't heard of it. The price seems quite reasonable. I would be very happy to pay these kind of prices to get line numbers.

@davidbuckleyni
Copy link

@baskren no worries and dont forget u can email urself logs as well.

@ghost ghost added the Stale label Jun 11, 2022
@ghost
Copy link

ghost commented Jun 11, 2022

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

@brminnick
Copy link

Please remove the stale label. This feature has not yet been implemented.

@ghost ghost removed the Stale label Jun 11, 2022
@ghost ghost added the Stale label Aug 11, 2022
@ghost
Copy link

ghost commented Aug 11, 2022

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

@MaximMikhisor
Copy link

This issue has been manually marked as not stale because it has had activity for 60 days. It will not be closed because further activity occured within 15 days of previous comment.

@ghost ghost removed the Stale label Aug 11, 2022
@baskren
Copy link

baskren commented Aug 11, 2022

You know what would be great? It would be great if this issue could be given some attention OR a rational explanation could be given as to why this is not a priority.

@carmanj
Copy link

carmanj commented Aug 11, 2022

You know what would be great? It would be great if this issue could be given some attention OR a rational explanation could be given as to why this is not a priority.

Why would they give a rational explanation, when it's becoming ever more evident that Xamarin is dead to them. It's all about MAUI now.

@baskren
Copy link

baskren commented Aug 11, 2022

I'd be happy if they'd fix this for MAUI too - because that would mean it would be fixed for .NET6-iOS, .NET6-Android. Heck, maybe even for .NET6-Windows!

@AlphaNERD-
Copy link

I wanted to say that the App Center is dying but if you don't use Microsoft's own technologies with the App Center, the devs are quick to respond! Hey devs, why is some whack-a-doodle React Native framework getting more attention than your own technologies? INCLUDING .NET 6 BTW.! It's new and feels already as deprecated as Xamarin within the App Center!

You may say that none of these are deprecated except you don't and let the bot mark it as stale! If this continues, i'm gonna switch to Raygun!

@tdevere
Copy link

tdevere commented Nov 12, 2022

TL;DR - @amirvenus pointed out the flaw in my approach - here I was using a debug profile but when I switched to release, the problem resurfaced. I do apologize for the false alarm (@baskren)

Just came across this issue in another support channel. This may be something for consideration for those willing to accept the workaround. I have not isolated the source code which is responsible for creating the crash call stack. But I noticed that when using the Crash.TrackError method in our SDK, line numbers are retained. The workaround then, would be to hookup the AppDomain unhandled exception handler.

AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

Then, implement something like this:

    private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        Exception ex = ((Exception)e.ExceptionObject);
        Crashes.TrackError(ex);
    }

The result? Surprisingly to me, both the crash which eventually is sent to App Center and the tracked crash, both now contain line numbers.

image

@amirvenus
Copy link

Just came across this issue in another support channel. This may be something for consideration for those willing to accept the workaround. I have not isolated the source code which is responsible for creating the crash call stack. But I noticed that when using the Crash.TrackError method in our SDK, line numbers are retained. The workaround then, would be to hookup the AppDomain unhandled exception handler.

AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

Then, implement something like this:

    private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)

    {

        Exception ex = ((Exception)e.ExceptionObject);

        Crashes.TrackError(ex);

    }

The result? Surprisingly to me, both the crash which eventually is sent to App Center and the tracked crash, both now contain line numbers.

image

Have you tried with Release builds?

Thanks

@baskren
Copy link

baskren commented Nov 12, 2022

Can't wait to try this

@davidbuckleyni
Copy link

TL;DR - @amirvenus pointed out the flaw in my approach - here I was using a debug profile but when I switched to release, the problem resurfaced. I do apologize for the false alarm (@baskren)

Just came across this issue in another support channel. This may be something for consideration for those willing to accept the workaround. I have not isolated the source code which is responsible for creating the crash call stack. But I noticed that when using the Crash.TrackError method in our SDK, line numbers are retained. The workaround then, would be to hookup the AppDomain unhandled exception handler.

AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

Then, implement something like this:

    private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        Exception ex = ((Exception)e.ExceptionObject);
        Crashes.TrackError(ex);
    }

The result? Surprisingly to me, both the crash which eventually is sent to App Center and the tracked crash, both now contain line numbers.

image

What u describe has been around for years people reporting here would be aware of this

@Gekidoku
Copy link

TL;DR - @amirvenus pointed out the flaw in my approach - here I was using a debug profile but when I switched to release, the problem resurfaced. I do apologize for the false alarm (@baskren)
Just came across this issue in another support channel. This may be something for consideration for those willing to accept the workaround. I have not isolated the source code which is responsible for creating the crash call stack. But I noticed that when using the Crash.TrackError method in our SDK, line numbers are retained. The workaround then, would be to hookup the AppDomain unhandled exception handler.
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Then, implement something like this:

    private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        Exception ex = ((Exception)e.ExceptionObject);
        Crashes.TrackError(ex);
    }

The result? Surprisingly to me, both the crash which eventually is sent to App Center and the tracked crash, both now contain line numbers.
image

What u describe has been around for years people reporting here would be aware of this

This should be added to the documentation of crash handling of MAUI and Xamarin.

@rhult
Copy link

rhult commented Sep 28, 2023

I got tired of waiting for this to never happen so I put together a small tool that helps somewhat. See the repo at https://github.com/rhult/crash-sharpener

It is not a full solution, but it does two things:

  1. Add information to stack traces that can be uploaded as handled errors to App Center
  2. A tool you can run locally to symbolicate those stack traces

You can use this to automate symbolicating by downloading the errors from App Center using its API, and then symbolicate them on your machine. I have tested it with iOS and Android on .net7 and it works well. I get line numbers from release builds this way.

@baskren
Copy link

baskren commented Sep 28, 2023

Not all heros wear capes.

@bruno-garcia
Copy link

bruno-garcia commented Oct 9, 2023

For those on Xamarin (https://github.com/getsentry/sentry-xamarin) MAUI (https://github.com/getsentry/sentry-dotnet)
Or just native Android/iOS apps with .NET, you can get line numbers in .NET stack traces with Sentry:

https://docs.sentry.io/platforms/dotnet/guides/maui/#overview-of-the-features

You need to upload PDBs. It's automatic if you configure the org-slug/auth token via msbuild or env vars, or CLI args: https://docs.sentry.io/platforms/dotnet/guides/maui/configuration/msbuild/

Also support native crashes on both iOS and Android. Code is here: https://github.com/getsentry/sentry-dotnet

I use it on this project: https://github.com/getsentry/symbol-collector

These are release builds in production:

image

image

Disclaimer: I was the maintainer of the Sentry .NET SDK

@ryanholden8
Copy link

For anybody still hoping this gets fixed, App Center is officially being retired.
https://learn.microsoft.com/en-us/appcenter/retirement

@bruno-garcia
Copy link

And Sentry continues to support line numbers for all types of .NET app including mobile:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostics Related to App Center's Diagnostics service do-not-close feature request New feature request
Projects
None yet
Development

No branches or pull requests