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

Dart stack trace format shown on the Sentry web UI is incompatible with the Dart tools #2040

Open
ekuleshov opened this issue May 7, 2024 · 2 comments

Comments

@ekuleshov
Copy link

Platform

Dart

Obfuscation

Disabled

Debug Info

Disabled

Doctor

N/A

Version

8.1.0

Steps to Reproduce

Look at any issue reported from a Flutter/Dart app. Navigate to stack trace and turn on the "Raw stack trace" option.

The presented Dart stack trace look something like this:

  File "my_api.g.dart", line 975, in MyPeripheralManagerHostApi.startAdvertising
  File "<asynchronous suspension>"
  File "my_peripheral_manager.dart", line 138, in MyPeripheralManager.startAdvertising
  File "<asynchronous suspension>"
  File "sync_ble_controller.dart", line 148, in SyncBleController._initBlePeripheral

Expected Result

The raw/native stack trace format for Dart for the above trace should look something like this. Also note the package reference and the source path missing from the current Sentry's "raw stack trace" presentation, which is required in order to uniquely identify source of the issue.

#1  MyPeripheralManagerHostApi.startAdvertising (package:bluetooth_low_energy_darwin/lib/src/my_api.g.dart:975)
#2  <asynchronous suspension>
#3  MyPeripheralManager.startAdvertising (package:bluetooth_low_energy_darwin/lib/src/my_peripheral_manager.dart:138)
#4  <asynchronous suspension>
#5  SyncBleController._initBlePeripheral (package:xyz/lib/controllers/sync_ble_controller.dart:148)

Actual Result

The Dart stack trace presentation in the Sentry's web UI is not anywhere alike Dart's native/raw stack trace (e.g. if you catch and print stack trace in the Dart code).

Also if you copy it from the Sentry web UI, the stack trace format is not recognized by the Dart tools, e.g. "Code / Analyze Stack Trace or Thread Dump..." action in the IntelliJ Dart/Flutter plugins and as a result you can't easily navigate to the source code from the stack trace analysis view in the IDE.

Are you willing to submit a PR?

None

@buenaflor
Copy link
Contributor

buenaflor commented May 10, 2024

hey thanks for raising this issue.

This is indeed not the behaviour we want, currently we fallback to a python representation for dart stacktraces (didn't know this either) 😅

We'll take a look at that

@ueman
Copy link
Collaborator

ueman commented May 12, 2024

For native stacktrace it already works correctly

return SentryStackFrame(
instructionAddr: '0x${match.group(1)!}',
platform: 'native', // to trigger symbolication & native LoadImageList

For Dart stacktraces (in addition to the problem on the website) you need to set the platform for the frame to dart, which currently is not done

var sentryStackFrame = SentryStackFrame(
absPath: abs,
function: member,
// https://docs.sentry.io/development/sdk-dev/features/#in-app-frames
inApp: _isInApp(frame),
fileName: fileName,
package: frame.package,
);

On the web platform, you may need to set platform to JS or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Backlog
Development

No branches or pull requests

3 participants