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

Allocating objects of sizes that are not a multiple of MIN_ALIGNMENT causes assertion fail #139

Closed
qinsoon opened this issue Sep 25, 2020 · 0 comments · Fixed by #140
Closed
Labels
A-allocator Area: Allocator C-bug Category: Bug

Comments

@qinsoon
Copy link
Member

qinsoon commented Sep 25, 2020

The assertion here will check if the cursor after last allocation (region) is aligned to MIN_ALIGNMENT:

debug_assert!(region.is_aligned_to(MIN_ALIGNMENT));

It is ported from the Java MMTk:
https://github.com/JikesRVM/JikesRVM/blob/682344f6eb9b9c3a75b8ad54b62ceb4b133b94f5/MMTk/src/org/mmtk/utility/alloc/Allocator.java#L100

However, this assertion seems to be incorrect. If we allocate an object whose size is not a multiple of MIN_ALIGNMENT, e.g. 6 when MIN_ALIGNMENT=4. The assertion will fail for the next allocation.

Thanks for @udesou for reporting this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-allocator Area: Allocator C-bug Category: Bug
Projects
None yet
1 participant