sdk
sdk copied to clipboard
VM crash when debugging (watch)
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: https://github.com/marcglasberg/fast_immutable_collections/issues/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 anIterable
, but it's not aList
.
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".
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.
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.
This might be fixed already by https://github.com/dart-lang/sdk/commit/6970e0907bf2cabe0d3e5da0846616d3ce972471.
If so, would it be feasible to port the fix to Dart 2.17?
//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 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?
@itsjustkevin the user was asking about cherry picking into the Dart 2.17 release. The fix already exists in Dart 2.18
@athomas is it reasonable to do a stable and beta hotfix next week?
Yes, we can do that.
On Fri, 19 Aug 2022, 14:51 Kevin Chisholm, @.***> wrote:
@athomas https://github.com/athomas is it reasonable to do a stable and beta hotfix next week?
— Reply to this email directly, view it on GitHub https://github.com/dart-lang/sdk/issues/49430#issuecomment-1220639779, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYRJBZNNMKLZIE3Z6QBYHTVZ57NBANCNFSM53EAYS2A . You are receiving this because you were mentioned.Message ID: @.***>
Awesome, thanks @athomas!
@a-siva so the course of action is to cherry pick https://github.com/dart-lang/sdk/commit/6970e0907bf2cabe0d3e5da0846616d3ce972471 to the stable branch for a stable hotfix. Is this the desired outcome?
Discussed offline with @mraleph and @mkustermann: hotfix approved for 2.17 based on low risk and user impact.
This has been cherry-picked to the 2.17.7 stable patch release.
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?
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).
@itsjustkevin https://github.com/dart-lang/sdk/issues/49430#issuecomment-1226663642