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

VM crash when debugging (watch) #49430

Closed
marcglasberg opened this issue Jul 9, 2022 · 14 comments
Closed

VM crash when debugging (watch) #49430

marcglasberg opened this issue Jul 9, 2022 · 14 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. cherry-pick-approved Label for approved cherrypick request merge-to-stable vm-debugger

Comments

@marcglasberg
Copy link

marcglasberg commented Jul 9, 2022

The Flutter app crashes when I try to inspect (watch) a value with the debugger.

A simple way to reproduce this can be found here: marcglasberg/fast_immutable_collections#42

By following the explanation there, I get this stack overflow:

F/libc    ( 7981): Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xbeb7fffc in tid 8010 (1.ui), pid 7981 (om.example.lixo)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_gphone_x86/generic_x86_arm:11/RSR1.201013.001/6903271:user/release-keys'
Revision: '0'
ABI: 'x86'
Timestamp: 2022-07-09 19:18:25-0300
pid: 7981, tid: 8010, name: 1.ui  >>> com.example.lixo <<<
uid: 10156
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xbeb7fffc
Cause: stack pointer is close to top of stack; likely stack overflow.
    eax f000c8e0  ebx c0b99508  ecx bd708021  edx 0e72796a
    edi e910e670  esi beb801f0
    ebp beb80038  esp beb80000  eip c07dad5c
backtrace:
      #00 pc 01a52d5c  /data/app/~~OVWcmB6TUK24WdToinP3BA==/com.example.lixo-hY88Xz66MGjH6kgg_5qOHA==/lib/x86/libflutter.so (BuildId: c23393704a650677a4265da6e395517feaa5fa50)
      #01 pc 019ebc30  /data/app/~~OVWcmB6TUK24WdToinP3BA==/com.example.lixo-hY88Xz66MGjH6kgg_5qOHA==/lib/x86/libflutter.so (BuildId: c23393704a650677a4265da6e395517feaa5fa50)
      #02 pc 019eb5b3  /data/app/~~OVWcmB6TUK24WdToinP3BA==/com.example.lixo-hY88Xz66MGjH6kgg_5qOHA==/lib/x86/libflutter.so (BuildId: c23393704a650677a4265da6e395517feaa5fa50)
...

Environment is: Flutter (Channel stable, 3.0.4, on Microsoft Windows [Version 10.0.19044.1766], locale pt-BR)

I am the author of the https://pub.dev/packages/fast_immutable_collections package, and I was able to easily reproduce this.

There are 2 possibilities:

  • The Dart debugger has a bug; or
  • My package's IList class has a bug that is being triggered by the debugger. Note the IList is an Iterable, but it's not a List.

Could you please tell me what methods the debugger calls to create the watch?

In any case, the app shouldn't crash like this, in any circumstances. The debugger should catch the error and say something like "this object's inspection throws an error".

@lrhn lrhn added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. vm-debugger labels Jul 10, 2022
@ozozozd
Copy link

ozozozd commented Jul 15, 2022

Same issue without using fast_immutable_collections, unfortunately I don't have a minimal example that can reproduce the issue.

My problem goes away with the following versions:

  • Flutter 3.0.1
  • Flutter VS Code Extension 3.42.0
  • Dart VS Code Extension 3.42.1

The issue persists with Flutter 3.0.1 when Flutter and Dart extensions are on 3.44.0.

@sanderhyipyip
Copy link

To whom it is helpful: here is crash dump created with Flutter 3.0.5 on Android arm64 (host: macOS 12.5, VS Code with Flutter v3.46 and Dart v3.46.1 extensions):

https://pastebin.com/mKiADD2D

Is it created using these instructions.

@sanderhyipyip
Copy link

This might be fixed already by 6970e09.

If so, would it be feasible to port the fix to Dart 2.17?

@a-siva
Copy link
Contributor

a-siva commented Aug 18, 2022

//cc @itsjustkevin there is a question about cherry picking a fix to the Dart 2.17 release. I would think we are very close to a Dart 2.18 stable release and maybe we could have the user upgrade to Dart 2.18.

@a-siva a-siva added the cherry-pick-review Issue that need cherry pick triage to approve label Aug 18, 2022
@itsjustkevin
Copy link
Contributor

@a-siva There is a bit of risk in cherry-picking this late into the cycle. Is this a major issue that needs to be taken care of now or can it wait for a stable hotfix?

@a-siva
Copy link
Contributor

a-siva commented Aug 19, 2022

@itsjustkevin the user was asking about cherry picking into the Dart 2.17 release. The fix already exists in Dart 2.18

@itsjustkevin
Copy link
Contributor

@athomas is it reasonable to do a stable and beta hotfix next week?

@athomas
Copy link
Member

athomas commented Aug 19, 2022 via email

@itsjustkevin
Copy link
Contributor

Awesome, thanks @athomas!

@a-siva so the course of action is to cherry pick 6970e09 to the stable branch for a stable hotfix. Is this the desired outcome?

@athomas
Copy link
Member

athomas commented Aug 22, 2022

Discussed offline with @mraleph and @mkustermann: hotfix approved for 2.17 based on low risk and user impact.

@athomas athomas added cherry-pick-approved Label for approved cherrypick request merge-to-stable and removed cherry-pick-review Issue that need cherry pick triage to approve labels Aug 22, 2022
copybara-service bot pushed a commit that referenced this issue Aug 22, 2022
This is a patch release that:

- Fixes a crash in the debugger (issue [#49430][]).

[#49430]: #49430

Bug: #49430
Change-Id: I9b1e4f7422be502a08ab7f199effed3e799311ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255985
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
@whesse
Copy link
Contributor

whesse commented Aug 22, 2022

This has been cherry-picked to the 2.17.7 stable patch release.

@Aaron009
Copy link

This has been cherry-picked to the 2.17.7 stable patch release.

How can I manually upgrade the dart SDK in the flutter SDK?

@mraleph
Copy link
Member

mraleph commented Aug 25, 2022

How can I manually upgrade the dart SDK in the flutter SDK?

I some situations you could theoretically do that, but this fix requires rebuilding Flutter Engine binaries. Unless you are familiar with the process, I'd recommend waiting for this fix to be released as part of the normal Flutter release process (or upgrade to the Flutter channel which contains the fix).

@athomas
Copy link
Member

athomas commented Aug 26, 2022

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, FFI, and the AOT and JIT backends. cherry-pick-approved Label for approved cherrypick request merge-to-stable vm-debugger
Projects
None yet
Development

No branches or pull requests

10 participants