Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001784graphvizOtherpublic2009-12-29 13:042011-04-28 04:03
Assigned Toerg 
PlatformOSx86-Linux-Debian SidOS Version
Summary0001784: Prune segfaults since at least 2.24


I've discovered that the 'prune' command in contrib appears to segfault
regardless of what file it is processing. This worked in 2.20 and fails
in 2.24 and 2.26 (I don't have 2.22 around so I didn't try that)

I did a little digging and I think I see what the problem is ...

At line 182 and recursively at line 236 there is a call to 'remove_child'
followed by a call to either 'agdelete' or 'agdeledge' to remove the
outgoing edge.

However in 'remove_child' at line 241 is a call to 'agdelnode' to remove
the child node which, if I understand the code correctly also removes all
outgoing and *incoming* edges - which means the aforementioned
agdelete/agdeledge calls try to delete an edge which no longer exists.

I have included an example file 'unixbit.gv' (which consists of just three
nodes from the 'unix.gv' example). The command
  prune -n "System V.2" unixbit.gv
triggers the segfault.

If I am correct about the cause of the problem, the patch below should
fix it ... it works here for every file I've tried so far.


TagsNo tags attached.
--- a/contrib/prune/prune.c.orig 2009-12-18 22:33:47.000000000 +0000
+++ b/contrib/prune/prune.c 2009-12-18 22:37:25.000000000 +0000
@@ -42,7 +42,7 @@
     char *v;
 } strattr_t;

-void remove_child(Agraph_t * graph, Agnode_t * node);
+int remove_child(
STATUS-COMMENTFixed (29 Dec 2009)
VERSION     2.26.0
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:03 user1 New Issue
2011-04-28 04:03 user1 Assigned To => erg

MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker