Skip to content

debugging session unusable if local variable is too large #4205

Closed

Description

@woprandi

Describe the bug
When trying to debug app, if a local variable representing a very long list (list of 100M file bytes), the debugging session is not usable and often crash

To Reproduce
Steps to reproduce the behavior:

  1. Create a local big file (on Linux : dd if=/dev/zero of=my_big_file bs=100M count=1)
  2. Create a small dart app to read this file :
import 'dart:io';

void main() async {
  final bytes = await File('my_big_file').readAsBytes();
  final myVar = "foo";
  final myVar2 = "bar";
  final myVar3 =  "";
}
  1. Add breakpoint on line 5 or 6
  2. Run app in debug mode

On left side, it's not possible to see local variables (infinite loading) or go to next line. The session will crash few seconds later.

Connecting to VM Service at http://127.0.0.1:37661/g8bL_J7yzYI=/
Exited (sigint)

Due to its size, the bytes variable prevent debug next lines.

Expected behavior

Have a usable debugging session

Screenshots
If applicable, add screenshots to help explain your problem.

Please complete the following information:

  • Operating System and version: Fedora 36
  • VS Code version: 1.71.2
  • Dart extension version: v3.50.0
  • Dart/Flutter SDK version: Flutter 3.3.3 / Dart 2.18.2
  • Target device (if the issue relates to Flutter debugging):

Activity

  1. DanTup commented on Oct 11, 2022

    @DanTup
    Member

    This is essentially a dupe of #4204 which is that large lists are not handled correctly.

    The same fix applies - we tell VS Code up-front how big the list is and it will provide the ability to page though the items instead:

    Screenshot 2022-10-11 at 17 25 04

    I don't think it's particularly useful to page through a list of bytes like this, but it should no longer hang the VM trying to load the entire file.

  2. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    on Oct 11, 2022
  3. added this to the v3.52.0 milestone on Oct 11, 2022
  4. DanTup commented on Oct 11, 2022

    @DanTup
    Member

    This fix is in the SDK so it'll show up in a future SDK release. It's also limited to the new debug adapters (currently behind a flag dart:previewNewSdkDaps, but will hopefully be progressively rolled out after the next SDK release).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions