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 3
3
//! The overall structure of a traced FFI call, from the child process's POV, is
4
4
//! as follows:
5
5
//! ```
6
- //! message_tx.send(TraceRequest::StartFFI );
6
+ //! message_tx.send(TraceRequest::StartFfi );
7
7
//! confirm_rx.recv();
8
8
//! raise(SIGSTOP);
9
9
//! /* do ffi call */
10
- //! raise(SIGUSR1);
10
+ //! raise(SIGUSR1); // morally equivalent to some kind of "TraceRequest::EndFfi"
11
11
//! let events = event_rx.recv();
12
12
//! ```
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!
13
20
14
21
/// An IPC request sent by the child process to the parent.
15
22
///
@@ -36,7 +43,7 @@ pub(super) enum TraceRequest {
36
43
pub ( super ) struct Confirmation ;
37
44
38
45
/// 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 .
40
47
///
41
48
/// The sender for this channel should live on the parent process.
42
49
#[ derive( serde:: Serialize , serde:: Deserialize , Debug ) ]
You can’t perform that action at this time.
0 commit comments