-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
DAP threadIds can currently be 53bit integers but the DAP spec specifies 32bit integers #53086
Comments
After chatting with @rmacnak-google, I don't think we'll be able to reduce the ID space any further. The isolate ID is really the isolate's main port and is meant to be "unguessable", so reducing the ID space weakens this property (ideally we'd have a 128-bit ID). If the DAP requires 32-bit thread IDs, we'll need to take a different approach that involves mapping between isolate and thread IDs. |
Right, send ports are capabilities and their IDs should be Swiss numbers. |
Thanks - we'll look at doing something different then. @elliette are you already using this? Which functionality is it required for - and is it in both directions or only one? |
I am already using this, but it's currently disabled by a feature flag: https://github.com/flutter/devtools/blob/6f42c1d59d95dcacde130f2910c1d10be8508e61/packages/devtools_app/lib/src/screens/debugger/debugger_controller.dart#L616 It's just being used to go from VM Frame to DAP frame. |
@elliette would it work for you if we include isolateIds in the response to DAP A change for this is here (the extra fields are only included over DDS to avoid the non-standard field for standard DAP clients): https://dart-review.googlesource.com/c/sdk/+/317701 Which depends on this change that reverts the original code (which fixes this issue): https://dart-review.googlesource.com/c/sdk/+/317700 We can land these together and then you could switch over. |
Thanks works for me, thank you! |
Great, thanks for confirming! I've opened reviews for them. |
See #53086 Change-Id: I380744f9e0d604168f026684b31fe689bb8947c8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317701 Reviewed-by: Ben Konyi <[email protected]>
For the record, since this issue has become relevant again,
That is not limited to 32-bit integers. It is likely effectively limited to 53-bit integers, but anything up to that should work, ad long as it's serialized without any fractions or exponents. |
The quote above about not using 32bits was because of what's written in the DAP spec - it seems like that might be more restrictive. I think we should stick to > 32bits for DAP integers. This issue was fixed by going back to increasing integers starting at 1 for |
CP request here |
CP request: #139177 Upstream tracking issue: dart-lang/sdk#53086
We recently started using
Isolate.number
s from the VM Service as thethreadId
s in the debug adapter. It turned out that these numbers were random 64bit numbers and could easily be values that aren't precisely representable in languages that use 64bit floating point numbers.This was fixed via #53081 by reducing these numbers to 53bits.
However, with some more digging it's not clear that 53bit integers are allowed in DAP either. The spec says:
Although the online spec has
threadId
asnumber
, the JSON spec usesinteger
.Assuming the correct type is
integer
, this means we cannot use > 32bits forthreadIds
. This would mean either:Isolate.number
directly asthreadId
and instead add a custom API for mapping back and forth@bkonyi @jacob314 thoughts/opinions?
(cc @elliette @christopherfujino)
Related:
The text was updated successfully, but these errors were encountered: