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

incorrect lazy stack traces in DWARF stack traces mode #52203

Closed
mraleph opened this issue Apr 27, 2023 · 2 comments
Closed

incorrect lazy stack traces in DWARF stack traces mode #52203

mraleph opened this issue Apr 27, 2023 · 2 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@mraleph
Copy link
Member

mraleph commented Apr 27, 2023

Future<T> run<T>(Future<T> Function() f) async {
  return await f();
}

Future<int> foo(String? x) =>
  run(() async {
    await Future.delayed(const Duration(milliseconds: 100));
    x!;
    return 0;
  });


void main(List<String> args) {
  foo(args.contains('null') ? null : 'args');
}

In symbolic mode we get:

Unhandled exception:
Null check operator used on a null value
#0      foo.<anonymous closure> (file:///tmp/test.dart:9)
<asynchronous suspension>
#1      run (file:///tmp/test.dart:3)
<asynchronous suspension>

But in DWARF mode we get (decoded):

Unhandled exception:
Null check operator used on a null value
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 43972, tid: 8419924800, name Dart_Initialize
os: macos arch: arm64 comp: no sim: no
build_id: 'bda273a30039b5581b7890551a96ba43'
isolate_dso_base: 101268000, vm_dso_base: 101268000
isolate_instructions: 1012a1ac0, vm_instructions: 10129c000
#0      foo.<anonymous closure> (file:///tmp/test.dart:9:6)
<asynchronous suspension>
    #01 abs 0000000000000000 <invalid Dart instruction address>
<asynchronous suspension>

Furthermore with

Future<int> foo(String? x) async {
  await Future.delayed(const Duration(milliseconds: 100));
  x!;
  return 0;
}


void main(List<String> args) async {
  await foo(args.contains('null') ? null : 'args');
}

we get symbolic stack trace:

Unhandled exception:
Null check operator used on a null value
#0      foo (file:///tmp/test.dart:8)
<asynchronous suspension>
#1      main (file:///tmp/test.dart:14)
<asynchronous suspension>

But in DWARF async unwinder fails completely (we must be shaking away some important info)

Unhandled exception:
Null check operator used on a null value
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 45486, tid: 8419924800, name Dart_Initialize
os: macos arch: arm64 comp: no sim: no
build_id: 'bda273a34a7ccf7e1b7890551aa6c861'
isolate_dso_base: 10510c000, vm_dso_base: 10510c000
isolate_instructions: 105145ac0, vm_instructions: 105140000
#0      foo (file:///tmp/test.dart:8:4)
#1      _SuspendState._createAsyncStarCallback.<anonymous closure> (dart:async-patch/async_patch.dart:379:7)
#2      _RootZone.runUnary (dart:async/zone.dart:1661:54)
#3      _FutureListener.handleValue (dart:async/future_impl.dart:147:18)
#4      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:784:45)
#5      Future._propagateToListeners (dart:async/future_impl.dart:813:13)
#6      Future._complete (dart:async/future_impl.dart:575:7)
#7      new Future.delayed.<anonymous closure> (dart:async/future.dart:424:16)
#8      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#9      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#10     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#11     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

/cc @aam @alexmarkov

@mraleph mraleph added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Apr 27, 2023
@mraleph
Copy link
Member Author

mraleph commented Apr 27, 2023

Related to customer issue b/279929839

@mraleph
Copy link
Member Author

mraleph commented Apr 28, 2023

I started refactoring the code in the stack_trace.cc so tentatively assigning to myself.

@mraleph mraleph self-assigned this Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

1 participant