Research Project

Process Isolation

  • Wrote an OCaml binding for the clone3 syscall (

    • Some decisions made to make this feel a bit higher level:
      • List of flags rather than ORed together numbers.
      • Options used where helpful.
      • Looked into using an OCaml callback, but of course this doesn’t work (as expected - OCaml didn’t like Multicore!). Currently execve’s a specific binary (/bin/sh), but should be easy to extend.
    • Tricky to know sometimes what to put in C and what to put in OCaml.
      • I think this will become more clear cut as time goes on, but for now it’s quite challenging.
      • It’s nice to say arg checking in OCaml leaving simply the syscall for C, but some of the issues aren’t clear until the types are converted to final in C.
    • The current shim uses identical arguments to unshare(1) so easy to compare performance.
  • Wrote some OCaml.

    • Not as hard to get started as I’d worried, certainly good.
    • Argument parsing is pretty simple and the app structure itself is okay.
    • 63-bit ints worry me quite a lot (perhaps more than they should). A lot of checking when working with syscalls and C to ensure that 63-bits is enough for each specific application.
  • Set up my dev machine.

    • Ubuntu 20.04LTS feels a bit limiting for this task. The kernel is a tad old and some of the bindings/man pages are out of date. Will check with sysadmin about constraints for replacing the OS.
    • Would also be useful to have access to some more ports for my development workflow, so will run this by sysadmin too.
  • Began work on a ptrace debugger for multiprocess applications.

    • I’ve written some light ptrace stuff before, so getting started wasn’t too hard.
    • Though I’d like to make this debugger quite general, it’s important for now to keep the scope of it within the project - if I’m only using clone3 and not fork, supporting fork is unnecessary.
    • No GUI yet and not super useful, but certainly getting there.

Up Next

  • Get the clone shim running arbitrary applications.
    • Currently it runs a shell, which is fine and useful for debugging. Running more applications is obviously necessary to continue.
  • Continue with tracing this application to ensure a view of what’s going on is available, particularly as things get more complicated.
  • Bigger C programs to test with are continuing to be important - not much progress made on this front in the past couple of weeks.
  • Research bin format misc more.
    • In the back of my mind I’m developing an idea that this could become integral to this project. Rather than making big changes to OCaml, this could be used to make the shim itself (perhaps still in OCaml), but then need only slight language changes to use the DSL and produce the elf - this could even be done externally in many cases. This could make the project applicable to basically any compilable language, which would be extremely cool.
    • Call apps which do this “Self-Containerising Applications” perhaps? I can imagine some real utility and very cool outcomes in this field.


Digital Signal Processing

  • Improved my image processing significantly over initial efforts.
  • Wrote up my work so far ready for submission.