Hacker News new | ask | show | jobs
by majke 3347 days ago
fluxcapacitor autor here.

Fluxcapacitor is focused on speeding up complex programs - most notably test suites (that do fork/execve). The idea is to cheat on time, to allow testing timeout-related branches in code. You can spin out a server and a client, write a test that needs to wait 60 seconds for completion and see it pass in 0.6 seconds.

Tardis on the other hand seems single-threaded, which makes it useful for... not really sure. I guess a demo how to use ptrace.

The problem with syscall interception with ptrace is that it doesn't work for golang. Golang doesn't use libc. This means there is no way to hook into the VDSO[1] - based syscalls. They are just a jump from userspace to special userspace memory region, so ptrace won't ever see it.

So, this approach, using ptrace, as used in tardis and fluxcapacitor will not work for golang.

[1] http://man7.org/linux/man-pages/man7/vdso.7.html

1 comments

Syscall interception works for _every_ program, it's just a matter of doing it correctly.

VDSO is a small set of (3) calls which are not syscalls but direct calls (for speed/efficiency). Our goal is to remove this functionality to force libs to call through the (slower) syscall route instead.

I mention in another comment how EHDR censoring is needed for robust VDSO removal.

I've not run into a libc where censoring EHDR breaks time calls (i.e. it doesn't fallback to syscalls) but possibly golang has this.

In this case it's straightforward to setup a fake VDSO and then instead of EHDR censoring you just replace it with your fake VDSO address and you're golden!