Skip to content

VM terminates when evaluating any expression for class that extends using itself as a type arg #49209

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

Closed
DanTup opened this issue Jun 8, 2022 · 3 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@DanTup
Copy link
Collaborator

DanTup commented Jun 8, 2022

This issue was reported to me on Dart-Code's discord. I was able to reduce it to the following:

import 'dart:developer';

void main(List<String> args) {
  final a = A<C>();
  debugger();
}

class A<T> {
  A();
}

class B<T> {
  final T data;
  B(this.data);
}

class C extends B<C> {
  C(C data) : super(data);
}

Running this code under the debugger will pause on the debugger() line. Trying to evaluate any expression at all (even 1) will terminate the VM and the response looks like this:

{
	"jsonrpc": "2.0",
	"error": {
		"code": -32000,
		"message": "Bad state: The client closed with pending request \"evaluateInFrame\".",
		"data": {
			"full": "Bad state: The client closed with pending request \"evaluateInFrame\".",
			"stack": "",
			"request": {
				"id": "35",
				"jsonrpc": "2.0",
				"method": "evaluateInFrame",
				"params": {
					"disableBreakpoints": true,
					"expression": "1",
					"frameIndex": 0,
					"isolateId": "isolates/2111979752828675"
				}
			}
		}
	},
	"id": "35"
}

There is no other error message information (via the VM Service or stderr/stdout) that I can get.

I'm not sure whether class C extends B<C> { makes a lot of sense (it seems like it's impossible to call C's constructor here, since you need to pass a C to it) but I wouldn't expect a crash.

@bkonyi

@lrhn lrhn added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Jun 8, 2022
@a-siva a-siva self-assigned this Jun 9, 2022
@a-siva
Copy link
Contributor

a-siva commented Jun 9, 2022

@DanTup
Copy link
Collaborator Author

DanTup commented Jun 13, 2022

@a-siva should this be closed (https://dart-review.googlesource.com/c/sdk/+/247901 shows as merged), or is there anything left to do?

Thanks!

@bkonyi
Copy link
Contributor

bkonyi commented Jun 13, 2022

Yup, this should be closed (@a-siva is out this week).

@bkonyi bkonyi closed this as completed Jun 13, 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 [#49209][]).

[#49209]: #49209

Bug: #49209
Change-Id: I9b1e4f7422be502a08ab7f199effed3e799311ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255985
Commit-Queue: William Hesse <[email protected]>
Reviewed-by: Alexander Thomas <[email protected]>
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, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

4 participants