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

stacker::grow Causes Invalid Memory Access #110

Open
AvivYossef-starkware opened this issue Jan 1, 2025 · 0 comments
Open

stacker::grow Causes Invalid Memory Access #110

AvivYossef-starkware opened this issue Jan 1, 2025 · 0 comments

Comments

@AvivYossef-starkware
Copy link

The stucker::grow function appears to cause invalid memory access when the input stack_size is not divisible by the page size. This issue likely originates from a miscalculation in the following code snippet:

let page_size = page_size();
let requested_pages = stack_size
    .checked_add(page_size - 1)
    .expect("unreasonably large stack requested") / page_size;
let stack_pages = std::cmp::max(1, requested_pages) + 2;
let stack_bytes = stack_pages.checked_mul(page_size);

I have tested my code extensively with various stack_size values and observed that this issue occurs specifically when the input stack_size is not divisible by the page size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant