Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dot] Segfault when setting nodesep to 0.3 #1280

Open
chtenb opened this issue Sep 12, 2017 · 2 comments
Open

[dot] Segfault when setting nodesep to 0.3 #1280

chtenb opened this issue Sep 12, 2017 · 2 comments

Comments

@chtenb
Copy link
Contributor

chtenb commented Sep 12, 2017

The following graph gives a segfault when doing a dot layout. (tested with windows 7)

digraph "Graph 76b00d8f-11c3-463d-ad26-29f5d68c9008" {
	graph [ nodesep=0.03 ];
	node [ shape=point ];
	subgraph "rank-target" {
		graph [rank=same];
		"A";
		"B";
		"X";
	}
	"A" -> "X";
	"B" -> "X";
}
$ cat dump.dot | ./dot.exe -Tsvg -O
Segmentation fault

When increasing the nodesep to 0.4, the following messages appear.

$ cat dump.dot | ./dot.exe -Tsvg -O
libpath/C:\Users\Chiel.tenBrinke\Projects\graphviz\lib\pathplan\shortest.c:324: triangulation failed
libpath/C:\Users\Chiel.tenBrinke\Projects\graphviz\lib\pathplan\shortest.c:207: cannot find triangle path
Warning: Unable to reclaim box space in spline routing for edge "A" -> "X". Something is probably seriously wrong.

According to http://www.graphviz.org/doc/info/attrs.html#a:nodesep, the minimum value is only 0.2.

@yarko
Copy link

yarko commented Sep 17, 2017

...just trying this:

$ dot -Tjpg -O test.dot

on graphviz current HEAD, it doesn't segfault (on Ubuntu 16.04), but does issue the following:

$ dot -Tjpg -O test.dot 
libpath/shortest.c:324: triangulation failed
libpath/shortest.c:192: source point not in any triangle
Error: in routesplines, Pshortestpath failed
Error: lost A X edge

and generates a viable (correct?), but not interesting image.

0.2, 0.3, and 0.4 produce viable images, with no messages for me. However, with your test as supplied:

$ dot -Tpng -O test.dot 
libpath/shortest.c:324: triangulation failed
libpath/shortest.c:192: source point not in any triangle
Error: in routesplines, Pshortestpath failed
Segmentation fault (core dumped)

$ dot -Tsvg -O segfault.dot 
libpath/shortest.c:324: triangulation failed
libpath/shortest.c:192: source point not in any triangle
Error: in routesplines, Pshortestpath failed
Segmentation fault (core dumped)

Also dumping core:

  • -Tdot
  • -Teps
  • -Tjson
  • -Tpdf

... and many others;

Producing, w/ errors:

  • -Tbmp
  • -Ttiff

None of the above core-dumping invocations showed any trouble (produced viable output, no core) with nodesep=0.2.

@emden
Copy link
Collaborator

emden commented Sep 17, 2017

Roughly, the problem is arises because of the small size of the nodes and the small separation. There is an error in the code that generates the polygon that is used for routing the edge. The polygon is self-intersecting, hence the triangulation algorithm fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants