Skip to content

Coprocess Protocol V2

andychu edited this page Nov 23, 2018 · 19 revisions

Design Constraints

  • should support ALL processes.
  • The patches to existing tools should be both small and localized.

Observations

  • We do not control every print statement in the program.

    • Python interpreter prints stack traces to stderr.
    • Most VMs, e.g. Python or the JVM, print their own messages to stderr in rare cases, e.g. in out of memory conditions.
    • if you build with ASAN, this should work too.
    • It would be annoying to change every single print() statement in a Python program to print(msg, file=fcli_out).
  • Just knowing sending stdin/stdout/stderr

Both of these should work, and they are different:

foo.py < in.txt >out.txt 2>err.txt

foo.py < in.txt >out-err.txt 2>&1

In the first case, the process is started with three files connected to its 3 descriptors.

In the second case, the process is started with two files connected to its 3 descriptors.

Clone this wiki locally