[GRASS-user] v.net.iso - segmentation fault error

Markus Metz markus.metz.giswork at gmail.com
Wed Nov 16 06:22:37 PST 2016


On Wed, Nov 16, 2016 at 11:44 AM, Eduardo Corbelle Rico <
eduardo.corbelle at gmx.net> wrote:
>
> O Xov, 27-10-2016 ás 14:56 +0200, Markus Metz escribiu:
> > On Thu, Oct 27, 2016 at 11:16 AM, Eduardo Corbelle Rico
> > <eduardo.corbelle at gmx.net> wrote:
> > >
> > > O Mér, 26-10-2016 ás 23:18 +0200, Markus Metz escribiu:
> > > > On Thu, Oct 13, 2016 at 9:55 AM, Eduardo Corbelle Rico
> > > > <eduardo.corbelle at gmx.net> wrote:
> > > > >
> > > > > Dear all,
> > > > >
> > > > > I am unable to use v.net.iso because of a "segmentation fault"
> > > > > error. I
> > > > >  have a script that used to work correctly in GRASS 6.4 (32
> > > > > bit)
> > > > > but
> > > > > produces this error after I switched to GRASS 7.0.4 (64 bit).
> > > > >
> > > > > If I try to follow both examples shown in https://grass.osgeo.o
> > > > > rg/g
> > > > > rass
> > > > > 70/manuals/v.net.iso.html (using the Spearfish dataset for
> > > > > GRASS 7)
> > > > > the
> > > > > same error appears:
> > > > >
> > > > > > Building graph...
> > > > > > Registering arcs...
> > > > > > Segmentation fault
> > > >
> > > > The segmentation fault must happen in the vector libraries. I
> > > > tested
> > > > on Linux and can not reproduce the segmentation fault. Valgrind
> > > > also
> > > > does not show anything that could cause a segmentation fault. Can
> > > > you
> > > > provide a gdb backtrace?
> > > >
> > > > Markus M
> > >
> > > Thank you Markus,
> > >
> > > My system is debian Stretch, and the following lines describe my
> > > attempt at generating a gdb backtrace. Please let me know if I
> > > should
> > > do otherwise.
> >
> > So far so good. The module crashes in a library function that comes
> > from libavl without modifications, but I can still not see why it
> > could cause a segmentation fault. Can you recompile with the compiler
> > debugging option -g? gdb will then be able to provide more
> > information:
> >
> > make distclean
> > CFLAGS="-g" ./configure <configure options>
> > make
> >
> > optionally make install
> >
> > Then start GRASS and use gdb for v.net.iso as before.
> >
> > Markus M
> >
>
> Dear Markus,
>
> Following those instructions does not seem to have changed the
> resulting backtrace info (copied below). Maybe I missed something along
> the way?
>
> ---------------------
> make distclean
> CFLAGS="-g" ./configure --with-freetype-includes=/usr/include/freetype2
> make
> sudo make install
>
>
> GRASS 7.0.5 (spearfish60_grass7):~ > gdb `which v.net.iso`
> GNU gdb (Debian 7.11.1-2+b1) 7.11.1
> Copyright (C) 2016 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl
> .html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show
> copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...

This is the problem:
> Reading symbols from /usr/lib/grass70/bin/v.net.iso...(no debugging
> symbols found)...done.

It should be
Reading symbols from /usr/lib/grass70/bin/v.net.iso...done.

For testing purposes I introduced a bug in my local copy to trigger a
segmentation fault. The backtrace shows:

(gdb) bt
#0  tavl_probe (tree=tree at entry=0x827d30, item=item at entry=0x82fb20) at
tavl.c:131
#1  0x00007ffff6c3d3e7 in dglTreeNodeAdd (pavl=0x827d30, nKey=nKey at entry=1)
at tree.c:73
#2  0x00007ffff6c32d17 in dgl_add_edge_V1 (pgraph=0x7fffffffccf8,
nHead=<optimized out>, nTail=<optimized out>, nCost=1231014,
    nEdge=1, pvHeadAttr=pvHeadAttr at entry=0x0, pvTailAttr=0x0,
pvEdgeAttr=0x0, nFlags=0) at edgemgmt-template.c:59
#3  0x00007ffff6c30ea2 in dglAddEdge (pGraph=pGraph at entry=0x7fffffffccf8,
nHead=<optimized out>, nTail=<optimized out>,
    nCost=<optimized out>, nEdge=nEdge at entry=1) at graph.c:624
#4  0x00007ffff7bb5d09 in Vect_net_build_graph (Map=Map at entry=0x7fffffffc920,
ltype=ltype at entry=6, afield=afield at entry=1,
    nfield=nfield at entry=2, afcol=0x0, abcol=0x0, ncol=0x0, geo=0,
version=1) at net_build.c:918
#5  0x00000000004029e1 in main (argc=<optimized out>, argv=<optimized out>)
at main.c:224

Note that file and line are given where the segfault occured.

Is this something Debian specific that debugging symbols must be explicitly
activated? Are you using GCC or another compiler?

Alternatively, you can also try valgrind:

CMD="v.net.iso input=myroads_net output=myroads_net_iso
center_cats=1-100000 costs=1000,2000,5000 --o"
valgrind --tool=memcheck --log-file=v.net.iso.vg.log $CMD

Markus M

>
>
> (gdb) run input=myroads_net output=myroads_net_iso center_cats=1-100000
> costs=1000,2000,5000
> Starting program: /usr/lib/grass70/bin/v.net.iso input=myroads_net
> output=myroads_net_iso center_cats=1-100000 costs=1000,2000,5000
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-
> gnu/libthread_db.so.1".
> Building graph...
> Registering arcs...
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007ffff6c64708 in tavl_probe ()
>    from /usr/lib/grass70/lib/libgrass_dgl.7.0.5.so
>
>
> (gdb) bt full
> #0  0x00007ffff6c64708 in tavl_probe ()
>    from /usr/lib/grass70/lib/libgrass_dgl.7.0.5.so
> No symbol table info available.
> #1  0x00007ffff6c65717 in dglTreeNodeAdd ()
>    from /usr/lib/grass70/lib/libgrass_dgl.7.0.5.so
> No symbol table info available.
> #2  0x00007ffff6c5aa0c in dgl_add_edge_V1 ()
>    from /usr/lib/grass70/lib/libgrass_dgl.7.0.5.so
> No symbol table info available.
> #3  0x00007ffff6c58a62 in dglAddEdge ()
>    from /usr/lib/grass70/lib/libgrass_dgl.7.0.5.so
> No symbol table info available.
> #4  0x00007ffff7ba1d69 in Vect_net_build_graph ()
>    from /usr/lib/grass70/lib/libgrass_vector.7.0.5.so
> No symbol table info available.
> #5  0x0000555555555b08 in main ()
> No symbol table info available.
>
>
> (gdb) l
> 1       ../sysdeps/x86_64/dl-procinfo.c: Non hai tal ficheiro ou
> directorio.
>
>
>
>
>
>
> > >
> > > >
> > > > >
> > > > > What I am missing?
> > > > >
> > > > > Thanks in advance.
> > > > >
> > > > > Greetings.
> > > > >
> > > > > Eduardo Corbelle
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Dr. Eduardo Corbelle Rico
> > > > >
> > > > > Land laboratory (LaboraTe)
> > > > > Department of Agricultural and Forest Engineering
> > > > > Universidade de Santiago de Compostela
> > > > >
> > > > > e-mail: eduardo.corbelle at usc.es
> > > > > Tel:  +34 982 823 324
> > > > > Fax:  +34 982 285 926
> > > > > Web: http://laborate.usc.es
> > > > >      http://masterterra.usc.es
> > > > >      http://github.com/eduardocorbelle
> > > > > _______________________________________________
> > > > > grass-user mailing list
> > > > > grass-user at lists.osgeo.org
> > > > > http://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20161116/655f0e47/attachment-0001.html>


More information about the grass-user mailing list