]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
rust: abort on panic in all profiles
authorcypherpunks <cypherpunks@torproject.org>
Sat, 18 Aug 2018 19:18:48 +0000 (19:18 +0000)
committercypherpunks <cypherpunks@torproject.org>
Sat, 18 Aug 2018 19:23:28 +0000 (19:23 +0000)
Until https://github.com/rust-lang/rust/issues/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 d1820c1516a31a149fc51a9e5126bf899e4c4e08.

Fixes #27199; bugfix on tor-0.3.3.1-alpha.

changes/bug27199 [new file with mode: 0644]
src/rust/Cargo.toml

diff --git a/changes/bug27199 b/changes/bug27199
new file mode 100644 (file)
index 0000000..f9d2a42
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (rust):
+    - Abort on panic in all build profiles, instead of potentially unwinding
+      into C code. Fixes bug 27199; bugfix on 0.3.3.1-alpha.
index 953c9b96b7f5f526c5bd5a81b0b0275522f92ecb..c22eea984d9d692791f5bffaee0c75834e3b1e88 100644 (file)
@@ -1,7 +1,17 @@
 [workspace]
 members = ["tor_util", "protover", "smartlist", "external", "tor_allocate", "tor_rust"]
 
+# Can remove panic="abort" when this issue is fixed:
+# https://github.com/rust-lang/rust/issues/52652
+[profile.dev]
+panic = "abort"
+
 [profile.release]
 debug = true
 panic = "abort"
 
+[profile.test]
+panic = "abort"
+
+[profile.bench]
+panic = "abort"