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

Error: trouble in init_rank

Open johnwickerson opened this issue 8 years ago • 7 comments
trafficstars

If I compile the following .dot file (which I've minimised as much as I can):

digraph G {

V4
V0
V2

subgraph cluster_0 {
V3
V1
}

subgraph cluster_1 {
V10
V5
V11
}
subgraph cluster_2 {
V9
V8
V6
}

V7

V0 -> V3 [constraint=false]
V4 -> V0 
V3 -> V1 
V0 -> V2 [constraint=false]
V10 -> V6 [label=a,constraint=false]
V11 -> V10 
V9 -> V8 
V6 -> V9 
V5 -> V11 
V10 -> V7 [constraint=false]
V4 -> V5 [constraint=false]
V3 -> V6 [constraint=false]
V2 -> V7 [constraint=false]
V1 -> V9 [label=b,constraint=false]
V1 -> V8 
V0 -> V11 [constraint=false]
V0 -> V10 
}

using the dot -Tpng command, with graphviz version 2.38.0 (20140413.2041) on Mac OS, then I get the following error message:

Error: trouble in init_rank
	%0 1
	%0 1
	%0 1
	V1 1
	%0 2
	%0 1
	V7 1
	V2 1
	%0 1
libpath/shortest.c:324: triangulation failed
libpath/shortest.c:192: source point not in any triangle
Error: in routesplines, Pshortestpath failed
Error: lost V1 V9 edge

johnwickerson avatar Mar 01 '17 20:03 johnwickerson

John, after about 20 years that bug appears to have been vanquished when I rewrote init_rank() last December. Try 2.41 or possibly 2.40

On Mar 1, 2017, at 3:44 PM, John Wickerson [email protected] wrote:

If I compile the following .dot file (which I've minimised as much as I can):

digraph G {

V4 V0 V2

subgraph cluster_0 { V3 V1 }

subgraph cluster_1 { V10 V5 V11 } subgraph cluster_2 { V9 V8 V6 }

V7

V0 -> V3 [constraint=false] V4 -> V0 V3 -> V1 V0 -> V2 [constraint=false] V10 -> V6 [label=a,constraint=false] V11 -> V10 V9 -> V8 V6 -> V9 V5 -> V11 V10 -> V7 [constraint=false] V4 -> V5 [constraint=false] V3 -> V6 [constraint=false] V2 -> V7 [constraint=false] V1 -> V9 [label=b,constraint=false] V1 -> V8 V0 -> V11 [constraint=false] V0 -> V10 } using the dot -Tpng command, with graphviz version 2.38.0 (20140413.2041) on Mac OS, then I get the following error message:

Error: trouble in init_rank %0 1 %0 1 %0 1 V1 1 %0 2 %0 1 V7 1 V2 1 %0 1 libpath/shortest.c:324: triangulation failed libpath/shortest.c:192: source point not in any triangle Error: in routesplines, Pshortestpath failed Error: lost V1 V9 edge — 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/1213, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtWz8K7flDJtJqie545T7fseVprwHYdks5rhdipgaJpZM4MQLZO.

magneticnorth avatar Mar 01 '17 20:03 magneticnorth

Hi Stephen, thanks for your reply. I updated to Graphviz 2.41.20170301.1954. The .dot file I gave you now works ok. But I have a very similar one that still, unfortunately, breaks. The file contents, which again I've minimised as much as I can, is:

digraph G {

subgraph cluster_0 {
S4
S0
}

subgraph cluster_1 {
S3
S1
}

subgraph cluster_3 {
H5
H0
H6
}

subgraph cluster_5 {
H4
H3
H1
}

S2
H2

S0 -> S3 [constraint=false]
S4 -> S0
S3 -> S1
S0 -> S2 [constraint=false]
H5 -> H1 [label=a,constraint=false]
H6 -> H5
H4 -> H3
H1 -> H4
H0 -> H6
H5 -> H2 [constraint=false]
S4 -> H0 [constraint=false]
S3 -> H1 [constraint=false]
S2 -> H2 [constraint=false]
S1 -> H4 [label=b,constraint=false]
S1 -> H3 [constraint=false]
S0 -> H6 [constraint=false]
S0 -> H5 [constraint=false]
}

and the error message I get is:

Error: trouble in init_rank
	%0 1
	%0 1
	%0 1
	S1 1
	%0 2
	%0 1
	%0 1
	%0 1
	H2 1
	S2 1
	%0 1
	%0 1
	%0 1
libpath/shortest.c:324: triangulation failed
libpath/shortest.c:192: source point not in any triangle
Error: in routesplines, Pshortestpath failed

and when I hit ctrl-c to abort the process, I get the following further error message:

Assertion failed: (bz.size > 0), function bezier_bb, file emit.c, line 3968.
Abort trap: 6

johnwickerson avatar Mar 02 '17 14:03 johnwickerson

The trouble appears related to the two edge labels. As a workaround, change either edge label to xlabel.

emden avatar Mar 02 '17 15:03 emden

On Mar 2, 2017, at 10:12 AM, emden [email protected] wrote:

The trouble appears related to the two edge labels. As a workaround, change either edge label to xlabel.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ellson/graphviz/issues/1213#issuecomment-283679973, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtWz2KAlPDo--EvBK7f02khHVb8wSaEks5rhtxHgaJpZM4MQLZO.

FWIW, with DEBUG enabled in ns.c, we get (lldb) run x.dot Process 85939 launched: '/Users/north/bin/dot' (x86_64) cycle: last edge 1026a9fa0 S1(10050dee0) %0(1026a9010) unwind 1026919d0 %0(102679110) unwind 1026916f0 %0(102682230) unwind 102691580 %0(102685b50) unwind 1026af710 %0(1026a9010) unwound to root Process 85939 stopped

at least it’s not a very long cycle. this happens in the node X coordinate positioning pass, so the graph is something we inadvertently construct and by now we know we need to look at edge label positioning.

magneticnorth avatar Mar 03 '17 00:03 magneticnorth

Requesting update in Ubuntu: https://bugs.launchpad.net/ubuntu/+source/graphviz/+bug/1679905

I have 101 test cases for this bug, all of them crash in dot - graphviz version 2.38.0 (20140413.2041)

shevek avatar Apr 05 '17 04:04 shevek

I came across similar issue Error: trouble in init_rank I have updated Graphviz for windows From 2.38 to 2.39

And problem solved,

Version Graphviz 2.39.20150331 for Windows could be found in http://www.download82.com/get/download/windows/graphviz/

cristianmercado19 avatar Oct 22 '19 08:10 cristianmercado19

that link is pretty sus

Hugobros3 avatar Mar 11 '21 09:03 Hugobros3