Skip to content

Commit 9604544

Browse files
committed
rt: Don't log in the stack switching failure path
The runtime is in an uncertain state here and, instead of thinking about how to make the logger work correctly, let's just avoid it. Currently, it ends up hitting an assert saying that we can't log on the rust stack.
1 parent 75cf13e commit 9604544

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/rt/rust_upcall.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ upcall_call_shim_on_c_stack(void *args, void *fn_ptr) {
7171
try {
7272
task->call_on_c_stack(args, fn_ptr);
7373
} catch (...) {
74-
LOG_ERR(task, task, "Native code threw an exception");
75-
abort();
74+
// Logging here is not reliable
75+
assert(false && "Native code threw an exception");
7676
}
7777

7878
task->record_stack_limit();
@@ -96,9 +96,8 @@ upcall_call_shim_on_rust_stack(void *args, void *fn_ptr) {
9696
} catch (...) {
9797
// We can't count on being able to unwind through arbitrary
9898
// code. Our best option is to just fail hard.
99-
LOG_ERR(task, task,
100-
"Rust task failed after reentering the Rust stack");
101-
abort();
99+
// Logging here is not reliable
100+
assert(false && "Rust task failed after reentering the Rust stack");
102101
}
103102

104103
// FIXME: As above

0 commit comments

Comments
 (0)