|
From: Stephen M.
|
I thought you might be interested to hear about a Valgrind-based tool our research group just released the first version of. Named Kvasir, after the Norse god of beet juice (and knowledge), it constructs a trace file giving the values of the parameters to each function call, and their return values (plus pointed-to values, to a limited depth). We use this trace information as input to Daikon, our tool for dynamically detecting likely program invariants, but the file format is ASCII and fairly general, so it can also be used for other sorts of dynamic analysis. Kvasir uses Valgrind to get control at function entires and exits, and Memcheck to check whether pointers are valid before following them. In future versions, we also plan to use Memcheck's information to determine the extent of dynamically allocated arrays. We get information about names and types from DWARF-2 debugging sections in the binary. Leveraging Valgrind's infrastructure has been amazingly helpful in getting this project together: after one undergraduate-semester's worth of effort, we already have a tool that works better than our old, source-based instrumenter does after years of effort. Thanks a bunch. Kvasir is GPL'ed, and our first release is available in source form as part of the main Daikon distribution, at http://pag.csail.mit.edu/daikon/download/ This first version is a bit roughly assembled, being based on the Sparrow skin, parts of Memcheck, and the GNU Binutils "readelf" program, assembled with some modifications essentially by cut and paste (along with a slightly modified version of the Valgrind core, circa 2.1.1) together with our own code. In the future, we'd like to use resources from Valgrind in a more principled way, ideally making a tool that could be dropped into an unmodified Valgrind distribution. We expect there are only a few places in the rest of Valgrind that would need to be more flexible to accommodate this (for instance, we don't want Memcheck's V bits to be set to "valid" after an invalid access). Kvasir's main developer is at another job over the summer, though, so we won't be working on that until the fall. Thanks again for the great tool, Stephen McCamant Graduate Student MIT CSAIL Program Analysis Group |