On CentOS, dot at times produces segmentation faults

Hello Graphvizards,

I experience occasional segmentation faults when using dot on CentOS 7, attempting to render (pretty large) .gv files to SVG. To give an idea about the size, for one of them the Linux command wc produces
2885 10484 174384.
The number of nodes is not particularly large, but the nodes have considerable internal complexity (made using the “HTML-like” labels) and there are lots of edges.

dot -Tsvg -O FILENAME
on the problematic files results in a segmentation fault and a core file being dumped.

I’ve tried the same on Windows 10 also - here it worked and the result looks ok.

I tried several gv files of similar sizes, in some cases it works, in others it fails.

My question is now: what to do?
Can dot be run with parameters that avoid this?
Are there graph structures that are known to produce segmentation faults (such that by avoiding the former I can prevent the latter from happening)?

  1. please tell us what version(s) of dot you are using - type: dot -V
  2. please tell us how many nodes and edges in the graph - type: gc yourfilename.gv

If the Centos version is older, installing a newer version may solve the problem. We can hope.

dot -V:
dot - graphviz version 2.30.1 (20201013.1554)
89 1902 g

I had asked an admin to install Graphviz on our server and just now see that the present 2.30.1 is not nearly a recent version, so perhaps by upgrading to 2.47.2 (and building from source) the problem can be overcome? I will pursue this path.

2.30.1 is indeed quite old!
By the way, the graph averages ~42 edges per node (1 edge == 2 nodes). The graph will be pretty “busy”.

The graph will be pretty “busy”.

Yes, I guess so. I’m working on a configuration that will produce a reduced graphic that focuses on a selected element and displays that element’s immediate neighborhood only and also hides edges that are not connected to the element in the focus. I expect the result to be small and handy.

But we have a problem with installation of the current Graphviz version (formats not found) - I will report this in a separate topic.

There is a file in the source that may do what you want. The file knbhd located in cmd/gvpr/lib/ will create a new graph containing only those nodes (and edges) that are within N hops of a desired node. knbhd is actually a GVPR program (https://www.graphviz.org/pdf/gvpr.1.pdf). Use it like this (4 hops):

gvpr -a"4 my\ node\ name" -f somepath/knbhd yourfile.gv | dot -Tpng >O.png

Thanks for the hint, Steve,
that’s interesting.