Skip to content

DAP threadIds can currently be 53bit integers but the DAP spec specifies 32bit integers #53086

Closed
@DanTup

Description

@DanTup

We recently started using Isolate.numbers from the VM Service as the threadIds 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:

integers defined in the protocol (JSON schema type integer) may be represented as 32 bit signed integers, although some properties disallow negative values. numbers in the protocol (JSON schema type number) may be represented as 64 bit floating point numbers.

Although the online spec has threadId as number, the JSON spec uses integer.

Assuming the correct type is integer, this means we cannot use > 32bits for threadIds. This would mean either:

  1. The VM Service IDs need reducing further from 53bit to 32bit integers
  2. We should stop using the Isolate.number directly as threadId and instead add a custom API for mapping back and forth

@bkonyi @jacob314 thoughts/opinions?

(cc @elliette @christopherfujino)

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-pkgUsed for miscellaneous pkg/ packages not associated with specific area- teams.dds-dapDDS issues related to the Debug Adapter Protocol (DAP) implementationpkg-ddsFor issues related to the Dart Development Service

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions