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
Flutter app freezes after adding a breakpoint in VS Code #4926
Comments
@jointhejourney does this reproduce with a newly created app (using Can you describe exactly what you mean by the app freezing - do you mean you cannot interact with it on the device at all (it's just stuck on the last rendered frame)? Can you provide a screenshot of the whole VS Code window with both the Debug sidebar and the Debug Console visible? Thanks! |
This happens with me, over the last month, on all my projects. As soon as I add a break point it freezes and I cannot interact with the programme I am debugging at all and have to stop and re run it. What can I do to help? Flutter 3.16.7 • channel stable • https://github.com/flutter/flutter.git |
I just tested on May 2023 VS Code Version: 1.79.2, but same result. Add a break point = Flutter freeze instantly on my MacOS project, expecting same on iOS. |
Are any of you guys using the Supabase package? I have this in common between my projects that are freezing. |
The most useful thing would be to help me get a repro so I can trigger this locally. Sharing a small (but complete) project that definitely triggers the issue and exact instructions I can follow would help. I also had some questions above (#4926 (comment)) that would help (in particular, confirmation of whether it happens in a brand new project with no other changes, and a full screenshot of VS Code with the Debug Console and Debug side bar visible when this happens). |
@DanTup Here is a video of what it does - I could not reproduce on a simple Flutter starter app. On adding of the third break point you will see it freezing. breakpointvideo.mov |
@mellowcello77 if it's not happening in a new project, the most helpful thing would be to figure out the difference between a new project and your own that is triggering this. If it doesn't occur in the new project there may be something specific in your project that triggers it, and that might make it very difficult for me to reproduce. In the meantime, a debugging log might help - although note that it may contain parts of your source code:
If you're not sure you can remove anything sensitive from the logs, try to stop logging quite quickly after the freeze occurs and then maybe just the last few lines of the log will contain the useful information. |
This is also happening to me but I am unclear as to if its the same issue. |
Hi @DanTup, I have sent the log to logs@dartcode.org |
@mellowcello77 thanks for the log! The last line in the log you sent starts like this:
Was this the very last line captured, or was there anything after this? If that's the last thing, is it possible you could repeat the logging, but start capturing logs before launching the application? Currently we only log the VM Service traffic is logging begins at the start and it doesn't look like this one includes it. In particular, I'm interested in whether anything logs after the And finally, after capturing the logs above could you try adding the following to your VS Code settings (temporarily) and see whether the issue also occurs with it set?
This will force you back on to the legacy debug adapters. If the issue doesn't occur there, it might also help pinpoint where the issue lies. Thanks! |
Sorry, almost missed your comment above.
This is useful information. I would definitely appreciate if you're able to make a repro that can be shared. It's very difficult to debug issues like this remotely that occur on projects I don't have, but if you can help me reproduce it locally here it will be much easier for me to get to the bottom of. |
@DanTup New log just sent. Added "dart.previewSdkDaps": false, but same result. |
@mellowcello77 thanks for the updated log and testing the legacy debug adapter! The log shows much the same - it seems like the VM never responds to the request to add breakpoints. I feel like this is either a VM issue or a Flutter issue. I've opened dart-lang/sdk#54650 with the important details from this thread. I'll try again to repro this, but if anyone is able to trigger this in a shareable project that would certainly help too - please post on the SDK issue linked above with details if you can. Thanks! |
Oh also, can anyone that's having this issue confirm:
It's not clear if any of those things are related, but it might help identify a pattern (or at least, allow us to try to repro in an environment that more closely matches yours). Thanks! |
I can reproduce this issue. Please find attached a screen shot of the break points and also link to repo that has the code for this. Background information
notes
How to reproduce
@DanTup hopefully you can reproduce this. And the above it clear enough. here is the repo https://github.com/QCIPaulCardno/freezing_breakpoint_issue_20240118/tree/main |
@QCIPaulCardno thanks! Unfortunately I haven't had any luck reproducing this yet (although I'm on an Intel mac... I'll try and test on an M1 Mac soon). That said - it's not obvious to me how to tell if the app has frozen because it seems to only render a yellow screen - how are you telling when it's frozen? Do you also know if the spawned isolate freezes (eg.if you put a |
@QCIPaulCardno I was able to construct a reliable repro by copying what you did and making some tweaks so I can see the app updating. I've posted the details over at dart-lang/sdk#54650 (comment) |
@DanTup fab that you can reproduce it. let me know if you need anything else. |
@QCIPaulCardno seems like the issue is understood now (see dart-lang/sdk#54650 (comment)). Thank you for your help with getting to a repro :-) |
This issue has been fixed via dart-lang/sdk#54650 and there are hotfix requests open at dart-lang/sdk#54699 so the fix will hopefully turn up in a stable release in the near future. |
Looks like the fix has made it to the Flutter stable channel. Please run |
Describe the bug
Running an iOS or MacOS app from VSCode, as soon as I add a breakpoint the app freezes immediately. Not hot reload or hot restart is able to revive the app. Only stopping and starting again works.
To Reproduce
Steps to reproduce the behavior:
Unfortunately I have noticed some intermittent behavior, but I'd say 90% of the times it freezes.
Expected behavior
App should not freeze.
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information:
You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (
F1
) to easily capture this information or provide it manually.Workspace Environment
Output from 'dart info'
/Users/user/Development/flutter/bin/cache/dart-sdk/bin/dart info
If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.
General info
Project info
Process info
Output from 'flutter doctor'
/Users/user/Development/flutter/bin/flutter doctor -v
The text was updated successfully, but these errors were encountered: