delete custom panic hooks
For non-test binaries, the default hook calls android_set_abort_message,
which causes the panic message to be included in the crashdump output,
so these hooks were redundant.
For test binaries, the story is more complicated. Android uses `-Z
panic-abort-tests`, which installs a panic hook to detect if the test
panic'd and communicates the reason to the test framework. If a test
binary installs its own custom panic hook, it breaks that setup and so
the test framework will think the test crashed in an unknown manner. It
is possible to use a custom hook without breaking it, but probably not
worth the complexity. Panic messages from tests will no longer go to
logcat, but they will now be reported as part of the test results, e.g.
in `atest`'s stderr and in the test results web UI.
Test: atest rialto_test
Change-Id: Ib53248c054f8d358835501814568cec8bedf5f03
diff --git a/tests/vmbase_example/src/main.rs b/tests/vmbase_example/src/main.rs
index 34a2b0b..cbe90d8 100644
--- a/tests/vmbase_example/src/main.rs
+++ b/tests/vmbase_example/src/main.rs
@@ -27,7 +27,7 @@
collections::{HashSet, VecDeque},
fs::File,
io::{self, BufRead, BufReader, Read, Write},
- panic, thread,
+ thread,
};
use vmclient::{DeathReason, VmInstance};
@@ -58,11 +58,6 @@
.with_max_level(log::LevelFilter::Debug),
);
- // Redirect panic messages to logcat.
- panic::set_hook(Box::new(|panic_info| {
- log::error!("{}", panic_info);
- }));
-
// We need to start the thread pool for Binder to work properly, especially link_to_death.
ProcessState::start_thread_pool();