-
Notifications
You must be signed in to change notification settings - Fork 28.4k
[flutter_tools] RPCError: removeBreakpoint: (-32602) invalid breakpoint id #111045
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
Comments
Stable 3.3.0 uses dds version 2.2.5: https://github.com/flutter/flutter/blob/stable/packages/flutter_tools/pubspec.yaml#L13 Source: https://github.com/dart-lang/sdk/tree/4ac76c7f35f9cafb05fd09a67db3f363b9737ff0/pkg/dds Looks like the call // Before doing async work, take a copy of the breakpoints to remove
// and remove them from the list, so any subsequent calls here don't
// try to remove the same ones.
final breakpointsToRemove = existingBreakpointsForIsolateAndUri.toList();
existingBreakpointsForIsolateAndUri.clear();
await Future.forEach<vm.Breakpoint>(breakpointsToRemove,
(bp) => service.removeBreakpoint(isolateId, bp.id!)); @DanTup do you think this is a race condition? |
@christopherfujino hmm, unsure. It looks like the code was written to avoid races and I can't see any obvious path. How often is this occurring? Is it across all platforms? I'll see if I can trigger it. If you see anyone report that they can repro this, I'd be very interested in a log file (captured with the Capture Debugging Logs command). I enabled SDK DAPs for ~10% of users in the last Dart-Code release. If this is happening lots we can push an update to Dart-Code to revert that until we have a fix. |
Also - do you know if all instances of this have IDs that start |
I think I've managed to trigger this running in iOS Simulator (so not web), however it doesn't crash it seems to be handled. What I did was add two breakpoints that resolve to the same line (a line of code, and the blank line before it). The VM returns the same breakpoint ID from the second request to add a breakpoint (although to complicate things, it seems like this only happens if the code has been run previously and compiled - it seems to return a new breakpoint if not), and we blindly keep track of it as a second breakpoint. When we come to remove the breakpoints, we then try to remove it twice (but after the first removal, the ID is not longer valid). The fix for that is fairly simple, but I can't repro via web (a breakpoint on the blank line is entirely rejected) so I'll continue to see if I can understand how it happened above before fixing. For reference, my steps to reproduce (which triggers an error if recording logs, but does not crash for me):
In the log file, find the last instance of |
Based on this code it looks like breakpoint IDs for web are always scriptid/line/col (the example above was Other thoughts:
(None of this explains why it was a crash in that instance, but perhaps when this occurred the original call had a different call stack to my repro, one that doesn't handle errors?) |
(@christopherfujino sorry for the noisy notifications 🙃) I'm still unable to reproduce this, but I am now convinced there are some races and we just need error handling around this:
I'm not certain, but I suspect the issue above is triggered by the second. Maybe some timing of a restart (which pretends to terminate and re-create an isolate on web) and breakpoint update overlapped and triggered this. I'll get a fix into DDS. If this issue is occurring frequently and you think we should roll back the 10% of users on the new DAPs until this fix is shipped, let me know. Edit: CL at https://dart-review.googlesource.com/c/sdk/+/257962/. |
Thanks for the quick fix! |
I think this was closed accidentally by the SDK change being pushed to a repo. Re-opening until the DDS change is in Flutter. |
Thanks |
Interesting @DanTup I did not close this manually, I wonder if this was due to the recent roll. |
Yeah, it was GitHub. I think you pushed to your sdk fork on GitHub (https://github.com/itsjustkevin/sdk) which included my commit that has the fix in DDS (https://github.com/itsjustkevin/sdk/commit/94a64a01f630e4a96b6b3cf3ec3c9a6b3f5f3445). GitHub saw my commit message (which contains "fixes ") and since you have access to close this issue, assumed a fix had been merged (you can close issues in Repo A from Repo B.. it doesn't seem to matter whether Repo B is just a fork or not). I don't know why it didn't happen when the SDK is synced up to the official repo (the same commit already existed at dart-lang/sdk@94a64a0 yesterday), but I should be more careful with my commit messages (I was only thinking about Gerrit when I pushed it 😄). (I've accidentally closed several of issues this way - and sometimes I've only noticed because people pinged me afterwards 😬) |
cc @iinozemtsev |
Update on this issue:
This issue can be closed once:
Regarding publishing a new version of DDS, @bkonyi could you do that? |
To be clear, I wouldn't expect any users to be explicitly running this command from the command line - though perhaps you mean users that have configured other (non-VS Code) clients to spawn the debug adapter using the
My plan is to re-enable it based on the version of the SDK once it rolls into Flutter, so that master/beta users will have it re-enabled (if they have the updated DDS) sooner than a stable release, just to help get additional testing/validation before then. @christopherfujino out of interest, has there been a significant reduction in the number of crash reports since the original influx? |
@christopherfujino I'll publish a new DDS today once this CL lands. |
DDS |
@DanTup I don't see a single report on the latest 3.3.2 stable!
I will now close this issue as the upstream patch has been rolled to the framework. Thanks all! |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
#3 crasher on
stable/3.3.0
with command:
flutter debug_adapter
The text was updated successfully, but these errors were encountered: