You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manually test that panicking from C will abort the process
Panicking from C is not UB in newer rust versions and will reliably
trigger an abort (without unwinding). In older rust versions, it is
technically UB but empirically it seems to "just work" (and what should
it realistically do except crashing, which is what we intent).
Since there's potentially no unwinding, we can't test this behavior
using [should_panic]. This PR will instead check the libtest output
explicitly in our CI tests.
Fixes#228.
Copy file name to clipboardExpand all lines: contrib/test.sh
+3
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,9 @@ if [ "$DO_ASAN" = true ]; then
78
78
cargo run --release --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified Successfully"
79
79
fi
80
80
81
+
# Test if panic in C code aborts the process (either with a real panic or with SIGILL)
82
+
cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally'2>&1| tee /dev/stderr | grep "SIGILL\\|panicked at '\[libsecp256k1\]"
0 commit comments