sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

Shows unknown "Called from" stack frame in crash report

Open sindresorhus opened this issue 4 years ago • 22 comments

Environment

SaaS (https://sentry.io/)

Version

Sentry Cocoa 7.5.2

Steps to Reproduce

  • Go to https://sentry.io/organizations/sindresorhus/issues/2833675135/events/8f9b4afd74da49fbb3e3fef911c4433e/

Expected Result

I expected to see the name of each stack frame.

Actual Result

The first stack frame is "unknown" and "redacted". Screen Shot 2021-12-06 at 18 10 10

This is a macOS app using the SwiftUI App protocol.

sindresorhus avatar Dec 06 '21 17:12 sindresorhus

Routing to @getsentry/team-mobile for triage. ⏲️

getsentry-release avatar Dec 06 '21 19:12 getsentry-release

Hey @sindresorhus, it seems like you didn't have the dSYMS uploaded for this event. I checked your issue, and the stacktrace looks fine.

philipphofmann avatar Dec 13 '21 13:12 philipphofmann

The symbolization section shows "Ok" though:

Screen Shot 2021-12-13 at 14 57 21

sindresorhus avatar Dec 13 '21 13:12 sindresorhus

I checked your issue, and the stacktrace looks fine.

Note that you have to switch to thread 0 in the stack trace section. The crash happened on thread 9.

sindresorhus avatar Dec 13 '21 13:12 sindresorhus

Dato was correctly symbolicated and indeed the frames showed up. The code calling into it though, likely a system frame that didn't symbolicate. Did this event come from a Simulator? It possibly came in one a version of iOS that was brand new (even a beta release of iOS?), before we collected the system symbols so we didn't manage to symbolicate those frames? We had a bug in version ~6.0.x that could cause it too which doesn't seem to be the case if you're 7.5.2.

This came up before: 1, 2, 3

bruno-garcia avatar Jan 11 '22 02:01 bruno-garcia

Dato is a macOS-only app.

sindresorhus avatar Jan 11 '22 04:01 sindresorhus

Usually, the bottom frame is something like libdyld +0x015f3c start. I just tried a crash with our macOS-Swift sample app on a M1 MacBook with macOS 12.1 and get the same result, see https://sentry.io/organizations/sentry-sdks/issues/2921695678/events/5b23f1fccbb4494d9ddd2bb37b133b5b/. So this is not related to SwiftUI. On macOS 11.6.1 https://sentry.io/organizations/sentry-sdks/issues/2921695678/events/f90d096dcfe54c978c4cde02eaf785db/ I get the bottom frame.

philipphofmann avatar Jan 11 '22 09:01 philipphofmann

The unkown frame should be in libdyld. On macOS 11.6.1 the list of loaded images contains libdyld Screen Shot 2022-01-11 at 16 36 23

but on macOS 12.1 libdyld is missing Screen Shot 2022-01-11 at 16 37 20

It seems like SentryCrash is not able to retrieve information on libdyld when generating the crash report. Maybe something changed on macOS 12.1. The problem exists on both x86 and arm64 CPU architecture. @jan-auer will investigate if we also have this problem on the sentry-native SDK. As this issue is related to sentry-cocoa, I'm going to transfer this issue.

philipphofmann avatar Jan 11 '22 15:01 philipphofmann

@jan-auer the logic for loading binary images is in SentryCrashDynamicLinker. The original file KSDynamicLinker doesn't contain any new patches that we don't have yet. I already applied the latest patch of accumulative patch with https://github.com/getsentry/sentry-cocoa/pull/1596.

philipphofmann avatar Jan 11 '22 15:01 philipphofmann

Sorry, I made a mistake when looking at this the first time. libdyld is there in all cases, it's just unreferenced and the UI hides it. If you reset filters you'll find it.

This means, the bottom frame returned by the stack walker is either wrong, or it points at an image that's unloaded at the time of the crash. If you look at the address, it lies shortly after the Sentry framework, which suggests that this is a user-space library.

jan-auer avatar Jan 14 '22 08:01 jan-auer

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Feb 04 '22 09:02 github-actions[bot]

Please keep this open.

sindresorhus avatar Feb 04 '22 09:02 sindresorhus

I also see this happening in our iOS-Swift sample app.

Screen Shot 2022-04-08 at 11 06 27

philipphofmann avatar Apr 08 '22 09:04 philipphofmann

@philipphofmann do you have a plan to fix this issue ?

amadeu01 avatar Jan 12 '23 15:01 amadeu01

No, not yet. We are going to discuss this again internally, as I also find it annoying, and we should fix it.

philipphofmann avatar Jan 12 '23 16:01 philipphofmann

@philipphofmann have you had any update on that one?

amadeu01 avatar Apr 21 '23 11:04 amadeu01

@amadeu01, sadly not yet, no.

philipphofmann avatar Apr 21 '23 12:04 philipphofmann

We could do something similar as this code does, but we must respect the license.

philipphofmann avatar Apr 28 '23 08:04 philipphofmann

@philipphofmann do you have any update?

amadeu01 avatar Aug 01 '23 13:08 amadeu01

Hello @amadeu01, we have no updates for this issue.

brustolin avatar Aug 01 '23 14:08 brustolin

I still see this happening for our iOSSwift sample app CleanShot 2023-10-31 at 15 51 08@2x

and for our macOS sample app: https://sentry-sdks.sentry.io/issues/4409194420/events/eca0ab201ffb4aa79ca342b207eebfaa/

CleanShot 2023-10-31 at 15 48 53@2x

cc @kahest and @brustolin, we need look into this.

philipphofmann avatar Oct 31 '23 14:10 philipphofmann

We'll have a look again at the root cause. If there is no pragmatic/reasonable way to solve this we may look at custom rules to not show this specific frame since it doesn't provide any value.

kahest avatar Nov 08 '23 13:11 kahest