File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 33//! The overall structure of a traced FFI call, from the child process's POV, is
44//! as follows:
55//! ```
6- //! message_tx.send(TraceRequest::StartFFI );
6+ //! message_tx.send(TraceRequest::StartFfi );
77//! confirm_rx.recv();
88//! raise(SIGSTOP);
99//! /* do ffi call */
10- //! raise(SIGUSR1);
10+ //! raise(SIGUSR1); // morally equivalent to some kind of "TraceRequest::EndFfi"
1111//! let events = event_rx.recv();
1212//! ```
13+ //! `TraceRequest::OverrideRetcode` can be sent at any point in the above, including
14+ //! before or after all of them.
15+ //!
16+ //! NB: sending these events out of order, skipping steps, etc. will result in
17+ //! unspecified behaviour from the supervisor process, so use the abstractions
18+ //! in `super::child` (namely `start_ffi()` and `end_ffi()`) to handle this. It is
19+ //! trivially easy to cause a deadlock or crash by messing this up!
1320
1421/// An IPC request sent by the child process to the parent.
1522///
@@ -36,7 +43,7 @@ pub(super) enum TraceRequest {
3643pub ( super ) struct Confirmation ;
3744
3845/// The final results of an FFI trace, containing every relevant event detected
39- /// by the tracer. Sent by the supervisor.
46+ /// by the tracer. Sent by the supervisor after receiving a `SIGUSR1` signal .
4047///
4148/// The sender for this channel should live on the parent process.
4249#[ derive( serde:: Serialize , serde:: Deserialize , Debug ) ]
You can’t perform that action at this time.
0 commit comments