Debugging Dataflow Through Pipes And Sockets

Posted by khuey on 18 October 2021

One of the most powerful features of the Pernosco Omniscient Debugger is using dataflow analysis to track a value back to its origin. We recently made this even more powerful, by giving it the ability to track values that flow through pipes and through sockets (when traces are recorded with rr 5.5).

In a traditional interactive debugger, following a value backwards to its source is often tedious or even impossible, especially if the value is moved around repeatedly between its creation and the site of the bug. In Pernosco, finding the source of the value is as easy as clicking on it. Our analysis distinguishes between operations that merely copy values around and operations that create them. This allows users to quickly follow a value back to its source, or to examine the chain of moves and see where it leads back to a bug such as an out-of-bounds write.

We have added modeling of the effects of certain syscalls to this feature. Now Pernosco understands that a value read from one end of a pipe was written to the other end of that pipe, and if both ends of the pipe are in the trace it will find the corresponding write and resume searching from there. Similarly we can look through sockets where both ends are in the trace. The relationship between two ends of a pipe is trivial to track, but pairing up sockets requires additional information to be captured in the rr trace (the local and remote addresses) which was not present before rr 5.5.

These features allow the dataflow analysis to proceed seamlessly through constructs such as the IPC layers used for modern multiprocess browsers or TCP connections used for communication between components of a program that can run on different machines.

Try debugging with Pernosco individual accounts or on-premises yourself today!