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

Allocator may return misaligned pointers on 32b platforms #1572

Open
boguscoder opened this issue Dec 17, 2024 · 0 comments
Open

Allocator may return misaligned pointers on 32b platforms #1572

boguscoder opened this issue Dec 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@boguscoder
Copy link

This was caught by UBSAN (exact repro is project specific but if required I can try building a clean one)

The gist is that runtime error: constructor call on misaligned address 0xeefae004 for type 'Luau::AstExprConstantNumber', which requires 8 byte alignment

while Allocator attempts to do some alignment, its not doing anything explicitly when allocating new pages. on 32bit platform this leads to whole Page being OK-aligned but since we are returning page->data its 4 bytes offsetted and is not 8 byte aligned anymore

One of the solutions is just to add alignas(8) to data member in Page type

@boguscoder boguscoder added the bug Something isn't working label Dec 17, 2024
@vegorov-rbx vegorov-rbx self-assigned this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants