Number: 2150
Title: twopi crashes on small graph
Submitter: David Fang
Date: Thu Mar 17 10:48:07 2011
Subsys: Twopi
Version: 2.22.2
System: *-*-
Severity: minor
twopi -Tpdf foo.twopi -o foo.pdf

result: Segmentation fault

gdb trace:
Program received signal SIGSEGV, Segmentation fault.
removeOverlapAs (G=0x8bbcc08, flag=0x8bbdb1c "false") at adjust.c:429
429         p = anchor->next;
(gdb) where
#0  removeOverlapAs (G=0x8bbcc08, flag=0x8bbdb1c "false") at adjust.c:429
#1  0xf7c177e9 in removeOverlap (G=0x8bbcc08) at adjust.c:1049
#2  0xf7c17826 in adjustNodes (G=0x8bbcc08) at adjust.c:1061
#3  0xf7c32df7 in twopi_layout (g=0x8bbcc08) at twopiinit.c:92
#4  0xf7f49742 in gvLayoutJobs (gvc=0x8bb0f10, g=0x8bbcc08) at gvlayout.c:88
#5  0x08048b7b in main (argc=5, argv=0xffe9cdd4) at dot.c:209

Is this reproducible on newer versions? Any suggested workarounds?

digraph G {
node [shape=box];
edge [fontsize=9];
__TOP__ [label="<TOP>nbit_sink", peripheries=2, style=filled, shape=ellipse];
xs [label="xsngeneric_ev_sink"];
__TOP__ -> xs [label=" Vddl VSS I-v I-e"];
xs__xb [label="xs/xbnINV_2_"];
xs -> xs__xb [label=" Vddl VSS v e"];
[north] 2.22? 2009? did you try a newer one? otherwise we will have to wait for the invention of time travel to go back to 2009 to correct the old version

[david] Sorry, I'm at work on machines I don't have install priviliges for. I'll try on a more recent one on my Mac when I get home.

[north] If they installed devel packages on your machine you can build graphviz yourself.

Even if they didn't you can build local copies of all those libraries (I used to anyway) but it's a bit time consuming. But the computer has a lot of free time so it's just running autogen/configure and make install about 10 times.

[david] When I try with a newer version:

twopi - graphviz version 2.26.3 (20100126.1600)

It doesn't crash, but the resulting graph (atteched pdf) is incomplete: The root node __TOP__ is missing entirely. What does anyone else get?

[erg] I can't reproduce the exact problem, but I do hit an assertion failure.

As a workaround, try changing overlap=false to overlap=prism.

It appears using overlap=false causes the node xs to be given the position (nan,nan), but only if the node xs_xb is a box.

[david] overlap=prsim isn't supported in 2.22.x (work machine) Will try on my home Mac later, which has 2.26.3.

[erg] Or try overlap=scale
Owner: *
Status: *