stacker::grow Causes Invalid Memory Access
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 360
- Forks
- 78
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the stacker::grow function and inspect the page-count and stack-byte calculations shown in the issue. Reproduce the invalid memory access with stack_size values that are not divisible by the page size. Done means those inputs no longer cause invalid memory access and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100