about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-04-18 18:43:42 -0700
committerBrian Anderson <banderson@mozilla.com>2012-04-18 18:45:24 -0700
commit9604544e234b30673ffe1bbcd24809e91bd39867 (patch)
treee5da3c31dc858ef7e71a5c7a4ac04a73ea202b64 /src/rt/rust_upcall.cpp
parent75cf13ec7279ff7a56e3329ab6d6d8fc03e66e4f (diff)
downloadrust-9604544e234b30673ffe1bbcd24809e91bd39867.tar.gz
rust-9604544e234b30673ffe1bbcd24809e91bd39867.zip
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.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index f43d819891a..6210b2717b6 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -71,8 +71,8 @@ upcall_call_shim_on_c_stack(void *args, void *fn_ptr) {
     try {
         task->call_on_c_stack(args, fn_ptr);
     } catch (...) {
-        LOG_ERR(task, task, "Native code threw an exception");
-        abort();
+        // Logging here is not reliable
+        assert(false && "Native code threw an exception");
     }
 
     task->record_stack_limit();
@@ -96,9 +96,8 @@ upcall_call_shim_on_rust_stack(void *args, void *fn_ptr) {
     } catch (...) {
         // We can't count on being able to unwind through arbitrary
         // code. Our best option is to just fail hard.
-        LOG_ERR(task, task,
-                "Rust task failed after reentering the Rust stack");
-        abort();
+        // Logging here is not reliable
+        assert(false && "Rust task failed after reentering the Rust stack");
     }
 
     // FIXME: As above