4 ms·
Very interesting. Do you have a link where I can read more about this?
by adtac 8y ago
Very interesting. Do you have a link where I can read more about this?
- CyberShadow 8y agoMozilla's rr (mentioned in the article) is a time-traveling debugger, but as far as I know it doesn't use fork() for snapshots / time-travel.
- roca 8y agorr does use fork() internally to create checkpoints, and checkpoints are created implicitly as the program executes to support time-travel. The COW behaviour of fork() is extremely helpful for performance. There's more to checkpoints than just fork(), though; for example, when two processes are sharing memory, checkpointing the process group fork()s both processes and then must explicitly duplicate the shared memory region, otherwise the checkpoint would share memory with the original, which would be disastrous. Unfortunately this means we don't get COW behaviour for shared memory regions; unfortunately the Linux/POSIX APIs are a bit deficient here.
- chrisseaton 8y agohttps://github.com/awwaiid/pry-timetravel https://github.com/awwaiid/pry-timetravel But I think the idea has been around forever.
- Pete_D 8y agogdb has checkpoint/restart that uses fork(), though you have to specify the checkpoints manually. https://sourceware.org/gdb/onlinedocs/gdb/Checkpoint_002fRestart.html https://sourceware.org/gdb/onlinedocs/gdb/Checkpoint_002fRes... It has another mode where you can record and rewind execution traces, which sounds more like the description, but I'm almost certain that doesn't use fork. https://sourceware.org/gdb/onlinedocs/gdb/Process-Record-and-Replay.html#Process-Record-and-Replay https://sourceware.org/gdb/onlinedocs/gdb/Process-Record-and...