MOTHBALLED-graphviz icon indicating copy to clipboard operation
MOTHBALLED-graphviz copied to clipboard

Segmentation fault when newrank=true

Open chtenb opened this issue 8 years ago • 4 comments

Consider the following dot code:

digraph "Graph d718cbc6-5e20-4417-a41a-e1e380469dd2" {
	graph [
		newrank=true
	];
	subgraph "cluster_1" {
		1;
	}
	subgraph "cluster_2" {
		1
	}
}

Then running dot on this will segfault.

$ cat ~/Desktop/repro.txt | ./dot.exe -Tpng > after.png
Segmentation fault

However, the old ranking algorithm will not segfault on this. Is this a bug in the new ranking algorithm?

chtenb avatar Mar 31 '17 13:03 chtenb

Not exactly. The problem is that you have the same node in two incompatible clusters, i.e., non-nested. The old ranking works because it quietly ignores one of the nodes in one of the clusters.

emden avatar Mar 31 '17 19:03 emden

All right, so giving a segfault is appropriate then? Shouldn't dot give an error message about invalid input?

chtenb avatar Apr 03 '17 06:04 chtenb

Its a bug, it should report the problem with the input graph and adjust it before proceeding or exit gracefully. On Mon, Apr 3, 2017 at 2:58 AM Chiel ten Brinke [email protected] wrote:

All right, so giving a segfault is appropriate then? Shouldn't dot give an error message about invalid input?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ellson/graphviz/issues/1221#issuecomment-291063001, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtWz8RV_PtOKPdDjCLjxSfmrV604qR1ks5rsJimgaJpZM4Mvs_4 .

magneticnorth avatar Apr 03 '17 08:04 magneticnorth

If the packmode attribute is set, this is actually checked and reported, but it doesn't exit with an error.

emden avatar Apr 03 '17 14:04 emden