Provoke a stack overflow, which still causes a boot loop

master
Philipp Oppermann 8 years ago
parent 2b9d880e48
commit 3efe54169e

@ -58,10 +58,13 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
// invoke a breakpoint exception
x86_64::instructions::interrupts::int3();
// trigger a page fault
unsafe {
*(0xdeadbeaf as *mut u64) = 42;
};
fn stack_overflow() {
stack_overflow(); // for each recursion, the return address is pushed
}
// trigger a stack overflow
stack_overflow();
println!("It did not crash!");
loop {}

Loading…
Cancel
Save