Re: segfault when adding edges

21 views
Skip to first unread message

George Bissias

unread,
Aug 27, 2015, 3:33:00 PM8/27/15
to pygraphviz-discuss
Hello,

I'm new to graphviz / pygraphviz, but have some experience with python.  I'm building a medium-sized graph (257 nodes and 6769 edges).  I do this by creating the edges first, and then setting the node attributes after.  I've tried adding edges in two ways.  The first way is by iterating through the edges and adding them one-by-one using G.add_node(...).  The second way is by accumulating the edges in a list, elist, and then adding them wholesale using G.add_edges_from(elist).  In both cases python crashes with a segfault.  In the first case it's somewhere in the middle of adding the edges.

The actual edges I'm adding a very simple, just (node_label1, node_label2) without any attributes.  Originally the node labels were custom strings, but I also tried numbering the nodes and simply using repr(node_ct) as the label.  This too fails.

Does anyone in the group have a suggestion for how to solve or debug this problem?  I'm running version 2.26.0-10.el6 of graphviz, version 1.2 of pygraphviz, and CentOS 6.1.

Thanks

Aric Hagberg

unread,
Aug 27, 2015, 4:43:53 PM8/27/15
to pygraphvi...@googlegroups.com
Do the tests pass?
try
python -c "import pygraphviz; pygraphviz.test()"
If not then you have a bad installation.
Aric
> --
> You received this message because you are subscribed to the Google Groups
> "pygraphviz-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pygraphviz-disc...@googlegroups.com.
> To post to this group, send email to pygraphvi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pygraphviz-discuss.
> For more options, visit https://groups.google.com/d/optout.

George Bissias

unread,
Aug 27, 2015, 4:54:25 PM8/27/15
to pygraphviz-discuss
Yep good thought; tests are passing.  

I did notice something else strange though.  I was able to reproduce the failure in my script with a set of just 10 edges.  When I tried creating a graph with the same edges in a fresh python console there was no crash.  The failing script begins by loading a large pickle file.  Do you suppose that the pickle load could be causing some kind of memory corruption?

Aric Hagberg

unread,
Aug 27, 2015, 5:01:36 PM8/27/15
to pygraphvi...@googlegroups.com
I suppose it is possible there is some issue with the pickle file.
Sounds pretty strange though.
Aric
>> > email to pygraphviz-disc...@googlegroups.com.
>> > To post to this group, send email to pygraphvi...@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/pygraphviz-discuss.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pygraphviz-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pygraphviz-disc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages