Skip to content

Commit fecd583

Browse files
author
cypherpunks
committed
rust: abort on panic in all profiles
Until rust-lang/rust#52652 is fixed, unwinding on panic is potentially unsound in a mixed C/Rust codebase. The codebase is supposed to be panic-free already, but just to be safe. This started mattering at commit d1820c1. Fixes #27199; bugfix on tor-0.3.3.1-alpha.
1 parent 87aacbf commit fecd583

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

changes/bug27199

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
o Minor bugfixes (rust):
2+
- Abort on panic in all build profiles, instead of potentially unwinding
3+
into C code. Fixes bug 27199; bugfix on 0.3.3.1-alpha.

src/rust/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
[workspace]
22
members = ["tor_util", "protover", "smartlist", "external", "tor_allocate", "tor_rust"]
33

4+
# Can remove panic="abort" when this issue is fixed:
5+
# https://github.com/rust-lang/rust/issues/52652
6+
[profile.dev]
7+
panic = "abort"
8+
49
[profile.release]
510
debug = true
611
panic = "abort"
712

13+
[profile.test]
14+
panic = "abort"
15+
16+
[profile.bench]
17+
panic = "abort"

0 commit comments

Comments
 (0)