about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2020-11-05 19:29:14 +0200
committerEduard-Mihai Burtescu <eddyb@lyken.rs>2022-06-13 07:59:50 +0000
commita10f0d2c5d022bbc212b4dae08f88c79b91c744e (patch)
treef80ec976bb37d7bd06848521134440f3e27f43a5
parent07c7ba72056cf03830dc508ad634b9c371cd4a89 (diff)
downloadrust-a10f0d2c5d022bbc212b4dae08f88c79b91c744e.tar.gz
rust-a10f0d2c5d022bbc212b4dae08f88c79b91c744e.zip
rustc: disable jemalloc's time-delayed purging to remove ASLR-like effects.
-rw-r--r--compiler/rustc/src/main.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs
index 0de1a781913..8d6f9b394ee 100644
--- a/compiler/rustc/src/main.rs
+++ b/compiler/rustc/src/main.rs
@@ -56,6 +56,12 @@ fn main() {
             #[used]
             static _F7: unsafe extern "C" fn() = _rjem_je_zone_register;
         }
+
+        // HACK(eddyb) disable time-delayed purging to remove the main (only?)
+        // source of non-determinism in `jemalloc`.
+        #[used]
+        #[export_name = "malloc_conf"]
+        static MALLOC_CONF: &'static [u8; 34] = b"dirty_decay_ms:0,muzzy_decay_ms:0\0";
     }
 
     rustc_driver::set_sigpipe_handler();