This commit is contained in:
Troy Neubauer
2026-03-01 04:23:47 -08:00
parent c180f1ca24
commit 5cdeb82dfa
2 changed files with 4 additions and 3 deletions

View File

@@ -43,7 +43,9 @@ impl DerefMut for CurrentTaskGuard<'_> {
impl<'a> Drop for CurrentTaskGuard<'a> {
fn drop(&mut self) {
CUR_TASK_PTR.borrow().borrowed.set(false);
let current = CUR_TASK_PTR.borrow();
current.borrowed.set(false);
current.location.set(None);
}
}

View File

@@ -165,8 +165,6 @@ fn segfault_child(inner: impl FnOnce()) {
panic!("fork failed");
} else if pid == 0 {
// Child process
// Reset rust's SIGSEGV stack overflow signal handler to default
libc::signal(libc::SIGSEGV, libc::SIG_DFL);
inner()
} else {
// Parent process
@@ -209,6 +207,7 @@ register_test!(test_segfault_write);
fn rust_stack_overflow() {
segfault_child(|| {
#[allow(unconditional_recursion)]
fn recurse(n: usize) -> usize {
let m = std::hint::black_box(n) + 1;
recurse(m)