File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ impl IsolatedAlloc {
275275 for i in 0 ..size / self . page_size {
276276 pages. push ( unsafe { ptr. add ( i * self . page_size ) . expose_provenance ( ) } ) ;
277277 }
278- } ) ;
278+ }
279279 pages
280280 }
281281}
Original file line number Diff line number Diff line change @@ -798,7 +798,11 @@ fn main() {
798798 #[ cfg( target_os = "linux" ) ]
799799 if !miri_config. native_lib . is_empty ( ) && !miri_config. force_old_native_lib {
800800 // FIXME: This should display a diagnostic / warning on error
801- // SAFETY: No other threads have spawned yet
801+ // SAFETY: If any other threads exist at this point (e.g. for the ctrlc
802+ // handler), they will not interact with anything on the main rustc/Miri
803+ // thread in an async-signal-unsafe way such as by accessing shared
804+ // semaphores, etc.; the handler only calls `sleep()` and `exit()`, which
805+ // are async-signal-safe, and accessing atomics is also
802806 let _ = unsafe { miri:: init_sv ( ) } ;
803807 }
804808 run_compiler_and_exit (
Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ use ipc_channel::ipc;
55use nix:: sys:: { ptrace, signal} ;
66use nix:: unistd;
77
8- use crate :: alloc:: isolated_alloc:: IsolatedAlloc ;
98use super :: messages:: { Confirmation , MemEvents , TraceRequest } ;
109use super :: parent:: { ChildListener , sv_loop} ;
1110use super :: { FAKE_STACK_SIZE , StartFfiInfo } ;
11+ use crate :: alloc:: isolated_alloc:: IsolatedAlloc ;
1212
1313static SUPERVISOR : std:: sync:: Mutex < Option < Supervisor > > = std:: sync:: Mutex :: new ( None ) ;
1414
@@ -135,7 +135,7 @@ impl Supervisor {
135135/// receiving back events through `get_events`.
136136///
137137/// # Safety
138- /// Only a single OS thread must exist in the process when calling this .
138+ /// The invariants for `fork()` must be upheld by the caller .
139139pub unsafe fn init_sv ( ) -> Result < ( ) , SvInitError > {
140140 // On Linux, this will check whether ptrace is fully disabled by the Yama module.
141141 // If Yama isn't running or we're not on Linux, we'll still error later, but
You can’t perform that action at this time.
0 commit comments