Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Graph Libraries] Segmentation fault when gvLayout() called after gvFreeLayout() #237

Open
GadgetSteve opened this issue Jul 4, 2016 · 0 comments

Comments

@GadgetSteve
Copy link
Contributor

GadgetSteve commented Jul 4, 2016

Ported Issue from Mantis
Original ID: 2467
Reported By: stvdedal

SEVERITY: MINOR
Submitted: 2014-07-05 20:55:18

DESCRIPTION

verrsion: graphviz-2.30.1

Segmentation fault when gvLayout() called after gvFreeLayout()
See minimal example in "step to reproduce".

I need to relayout created graph again, so I do:

  1. greate graph
  2. gvLayout()
  3. graph modifications: add/remove nodes or edges
  4. gvFreeLayout()
  5. gvLayout() <---- SIGSEG

STEPS TO REPRODUCE

  1. minimal example:
================= gvLayout_SIGSEG.c ======================
#include <graphviz/cgraph.h>
#include <graphviz/gvc.h>

int main(int argc, char** argv)
{
    GVC_t* gvc = gvContext();

    Agraph_t* g1 = agopen("g1", Agundirected, NULL);
    agnode(g1, "n1", 1);
    agnode(g1, "n2", 1);

    gvFreeLayout(gvc, g1);
    gvLayout(gvc, g1, "dot");

    return 0;
}

  1. compiling:

gcc -Wall gvLayout_SIGSEG.c -lgvc -lcgraph -lcdt -I/usr/include/graphviz

  1. run
$ ./a.out 
Segmentation fault
  1. call trace
$ gdb -q ./a.out 
Reading symbols from /home/dedal/programming/etoile/src/graphview/test/a.out...done.
(gdb) r
Starting program: /home/dedal/programming/etoile/src/graphview/test/a.out 
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.3200.4-gdb.py", line 9, in <module>
    from gobject import register
  File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
    import gdb.backtrace
ImportError: No module named backtrace
Warning: couldn't activate thread debugging using libthread_db: Cannot find new threads: generic error
warning: File "/lib64/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7932cf4 in agdictsym () from /usr/lib64/libcgraph.so.6
(gdb) bt
#0  0x00007ffff7932cf4 in agdictsym () from /usr/lib64/libcgraph.so.6
#1  0x00007ffff7933526 in agget () from /usr/lib64/libcgraph.so.6
#2  0x00007ffff7b6521d in gvLayoutJobs () from /usr/lib64/libgvc.so.6
#3  0x00007ffff7b6adb2 in gvLayout () from /usr/lib64/libgvc.so.6
#4  0x0000000000400918 in main ()
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant