Skip to main content

Module child

Module child 

Source

Re-exportsยง

use std::cell::RefCell; ๐Ÿ”’
use std::panic::abort_on_unwind; ๐Ÿ”’ Experimental
use std::ptr::NonNull; ๐Ÿ”’
use std::rc::Rc; ๐Ÿ”’
use ipc_channel::TryRecvError; ๐Ÿ”’
use ipc_channel::ipc; ๐Ÿ”’
use nix::sys::mman; ๐Ÿ”’
use nix::sys::ptrace; ๐Ÿ”’
use nix::sys::signal; ๐Ÿ”’
use nix::unistd; ๐Ÿ”’
use rustc_const_eval::interpret::InterpResult; ๐Ÿ”’
use rustc_const_eval::interpret::interp_ok; ๐Ÿ”’
use super::CALLBACK_STACK_SIZE; ๐Ÿ”’
use super::messages::Confirmation; ๐Ÿ”’
use super::messages::StartFfiInfo; ๐Ÿ”’
use super::messages::TraceRequest; ๐Ÿ”’
use super::parent::ChildListener; ๐Ÿ”’
use super::parent::sv_loop; ๐Ÿ”’
use crate::alloc::isolated_alloc::IsolatedAlloc; ๐Ÿ”’
use crate::shims::native_lib::MemEvents; ๐Ÿ”’

Structsยง

Supervisor
The main means of communication between the child and parent process, allowing the former to send requests and get info from the latter.
SvInitError
Marker representing that an error occurred during creation of the supervisor.

Staticsยง

SUPERVISOR ๐Ÿ”’
A handle to the single, shared supervisor process across all MiriMachines. Since it would be very difficult to trace multiple FFI calls in parallel, we need to ensure that either (a) only one MiriMachine is performing an FFI call at any given time, or (b) there are distinct supervisor and child processes for each machine. The former was chosen here.

Functionsยง

init_svโš 
Initialises the supervisor process. If this function errors, then the supervisor process could not be created successfully; else, the caller is now the child process and can communicate via do_ffi, receiving back events at the end.
register_retcode_sv
Instruct the supervisor process to return a particular code. Useful if for whatever reason this code fails to be intercepted normally.