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

btf: Pointer.Size is incorrect on arches with 32 bit pointers #963

Open
lmb opened this issue Mar 7, 2023 · 0 comments
Open

btf: Pointer.Size is incorrect on arches with 32 bit pointers #963

lmb opened this issue Mar 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@lmb
Copy link
Collaborator

lmb commented Mar 7, 2023

We currently hardcode pointer size:

func (p *Pointer) size() uint32 { return 8 }

The kernel uses sizeof(void*) instead. That size depends on which data model is used.The correct size of Pointer in Go land is actually unsafe.Sizeof(uintptr(0)), but we can't use that directly. We may read BTF generated on a 32 bit pointer arch on a 64 bit pointer arch and vice versa.

It would be nice if we could reject parsing BTF with a different pointer size, or add "proper" support for differing pointer sizes. (What would that look like though?)

@lmb lmb added the bug Something isn't working label Mar 7, 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

No branches or pull requests

1 participant