3
3 Motivation GNU debugger GDB Values are shown as texts. Problem A user will never notice if 2 pointers point to the same address – except by thoroughly checking and comparing pointer values.

4
4 Motivation GNU DDD debugger Models memory as a graph. Each value in memory becomes a vertex and references between values become edges between these vertices (i.e. pointers). Drawback Each and every pointer of a data structure must be dereferenced manually.

5
5 Motivation Memory graphs A memory graph captures the program state as a graph. The graph is extracted automatically from a program. Usefulness Checking if there are pointers pointing to a specific address. Checking the number of elements a data structure has. Checking if an allocated memory block is reachable from within a module. Checking if the tree changed during the last function call.

8
8 Structure of Memory Graphs Edge Operations Construct the name of the descendants from their parent’s name. Operations on edges leading from root to base variables initially set the name. We denote functions by λx.B – a function that has a formal parameter x and a body B. In our graph visualizations the operation body is shown as edge label with the formal parameter replaced by “()“. Root References all base variables of the program. Each vertex in the graph is accessible from the root.

11
11 Obtaining Memory Graphs To obtain a memory graph G = (V, E, root) : Let unfold(parent, op, G) be a procedure that takes the name of a parent expression parent and an operation op and unfolds the element op(parent), adding new edges and vertices to the memory graph. Initialize V = {root} and E = Invoke unfold(root, λx.“name“) for each base variable name in the program. The expression expr = op(parent) that will be unfolded depends on the structure of the expr :

14
14 Graph Differences Comparing program states In an alternate program run, all pointers can have different values, but still the same semantics. Comparing program states using a graph is a simple operation, since we try to detect the greatest common sub graph. Usefulness Comparing memory graphs gives us the ability to detect exactly where a failure has occurred.

15
15 Graph Differences Maximum common subgraph 1.Create the set of all pairs of vertices (v 1, v 2 ) with the same value and the same type, one from each graph. 2.Form the correspondence graph C whose nodes are the pairs from (1). 3.The maximal common sub graph then corresponds to the complete sub graph of C that is not contained to any other complete sub graph.  Any vertex that is not on the clique indicates a difference between G 1 and G 2.

16
16 Drawing Memory Graphs DOT graph layouter Layouts are nice and descriptive. They do not scale to large memory graphs (1000 vertices and more).

17
17 Drawing Memory Graphs h3viewer Interactive graph rendering tool that allows the user to navigate along the graph. Clicking on any vertex brings it on the front, showing detailed information. By dragging and rotating the view, the user can quickly follow and examine data structures.

18
18 Conclusion – Future Work Applications Visualization of all data structures in memory and capturing the entire program state. Detection of common sub graphs to isolate differences between program states – especially differences that cause failure. Limitations – Drawbacks Limitation in visualization : lack of capability to depict graphs which contain more than vertices. Not easily task to detect cycles in very large graphs which might cause endless recursions and eventually eating up all available heap space.

19
19 Conclusion – Future Work Enhancements - Improvements Summarizing parts of the graph – Instead of showing all n elements of a list it might suffice to present only the basic shape of the list. Reducing the graph size : pruning the graph at a certain depth in order to restrict the view to a particular module or variable. Development of graph algorithms for the detection of specific trouble spots or invariant violations.