Skip to content
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

Offsets are not always tied to the module version containing the offset #449

Closed
MrAlias opened this issue Nov 1, 2023 · 0 comments · Fixed by #450
Closed

Offsets are not always tied to the module version containing the offset #449

MrAlias opened this issue Nov 1, 2023 · 0 comments · Fixed by #450
Assignees
Labels
bug Something isn't working
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Nov 1, 2023

Describe the bug

When you replace a version of golang.org/x/net for an instrumented google.golang.org/grpc application the offset for struct-fields in that module will not be found, or potentially the wrong version of offset would be returned.

Currently, the offset version is declared across all struct fields within a single module. However, there are instrumentation probes that instrument multiple modules.

For example, google.golang.org/grpc and golang.org/x/net:

inject.WithOffset(
"stream_method_ptr_pos",
structfield.NewID("google.golang.org/grpc/internal/transport", "Stream", "method"),
ver,
),
inject.WithOffset(
"stream_id_pos",
structfield.NewID("google.golang.org/grpc/internal/transport", "Stream", "id"),
ver,
),
inject.WithOffset(
"stream_ctx_pos",
structfield.NewID("google.golang.org/grpc/internal/transport", "Stream", "ctx"),
ver,
),
inject.WithOffset(
"frame_fields_pos",
structfield.NewID("golang.org/x/net/http2", "MetaHeadersFrame", "Fields"),
ver,
),
inject.WithOffset(
"frame_stream_id_pod",
structfield.NewID("golang.org/x/net/http2", "FrameHeader", "StreamID"),
ver,
),

To be clear, many of the versions for golang.org/x/net don't exist.

Proposal

Have the structfield.ID and offsets track the module and associate the correct version.

@MrAlias MrAlias added the bug Something isn't working label Nov 1, 2023
@MrAlias MrAlias self-assigned this Nov 1, 2023
@MrAlias MrAlias added this to the v0.8.0-alpha milestone Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant