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

edgepaint failure with record ports

Open wavexx opened this issue 9 years ago • 4 comments

When a node with multiple ports has > 1 edge going out of it, edgepaint crashes with a segmentation fault (no error is emitted).

Minimal test case:

digraph G {                                                                            
  a [shape=record; label="<a> a|<b> b"];                                               
  b;                                                                                   
  a:a -> b;                                                                            
  a:b -> b;                                                                            
}                                                                                      

Creating a single edge (starting from any port) works as intended.

wavexx avatar Jul 25 '16 18:07 wavexx

I think this is covered under the BUGS section in the man page:

BUGS At present, edgepaint does not handle graphs with loops or directed multiedges. So, a graph with edges a -> b and b -> a is acceptable, but not if it has edges a -> b and a -> b or a -- b and a -- b.

ellson avatar Jul 26 '16 14:07 ellson

On Tue, Jul 26 2016, John Ellson wrote:

I think this is covered under the BUGS section in the man page:

BUGS At present, edgepaint does not handle graphs with loops or directed multiedges. So, a graph with edges a -> b and b -> a is acceptable, but not if it has edges a -> b and a -> b or a -- b and a -- b.

Is this the case?

A port is a virtual node, so it should count as if a1 -> b, a2 -> b.

wavexx avatar Jul 26 '16 15:07 wavexx

Actually, that is true; using ports should not cause a problem unless the node+port is repeated. Unfortunately, the current implementation ignores ports and relies solely on nodes and edges, so that is reflected in the check. By the way, the program firsts checks for ports or multiedges and, if any exist, it prints a warning and moves on. There was a bug in printing the warning which may have caused seg fault. It has now been fixed.

As for allowing ports, that will fall under a feature request.

emden avatar Jul 26 '16 16:07 emden

Thanks for fixing the warning. I had dig with gdb to understand what was going on.

And yes, it would be nice if this would be implemented in edgepaint. Record nodes are very useful in many scenarios where precise and/or compact layout is desired.

wavexx avatar Jul 29 '16 22:07 wavexx