cd7bf37c1b
I noticed a race while running from source today.. If you run a Dart CLI app we add --pause-isolates-on-exit to allow sending async output events before exiting, then we resume. The stopped event is still propagated to the client (since there can be a delay between the stop and the resume while we wait for output events) and the client may ask for a StackTrace. If this arrives just after we resume the isolate, we would generate an error that could be shown to the user. This adds a check that the thread ID is really invalid before throwing an error, and if it's valid (eg. it belongs to an earlier isolate) we just return an empty stack trace instead of an error. Fixes https://github.com/Dart-Code/Dart-Code/issues/4907 Change-Id: I0a3241ffd634acea49b4d1dc7b3cd6b6b1c8d2d0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342585 Reviewed-by: Helin Shiah <helinx@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>