Open
Description
Forked from #70022
Minimal example
#[repr(align(0x10000))]
struct Aligned(u8);
fn main() {
let x = Aligned(0);
println!("{:#x}", &x as *const _ as usize);
}
Aligning the stack is done after the stack probe. Because stacks grow downwards and aligning the stack shifts it downwards, it can cause the end of the stack to extend past the guard page and cause invalid access exceptions or worse when those sections of the stack are touched.
Only confirmed that this occurs on (pnkfelix edit: see comment thread, its a more general problem.)pc-windows-msvc
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Category: This is a bug.Category: issue that is caused by bugs in software beyond our controlIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessOperating system: WindowsHigh priorityRelevant to the compiler team, which will review and decide on the PR/issue.