<div dir="ltr"><div><br><br>On Wed, Nov 16, 2016 at 11:44 AM, Eduardo Corbelle Rico <<a href="mailto:eduardo.corbelle@gmx.net">eduardo.corbelle@gmx.net</a>> wrote:<br>><br>> O Xov, 27-10-2016 ás 14:56 +0200, Markus Metz escribiu:<br>> > On Thu, Oct 27, 2016 at 11:16 AM, Eduardo Corbelle Rico<br>> > <<a href="mailto:eduardo.corbelle@gmx.net">eduardo.corbelle@gmx.net</a>> wrote:<br>> > ><br>> > > O Mér, 26-10-2016 ás 23:18 +0200, Markus Metz escribiu:<br>> > > > On Thu, Oct 13, 2016 at 9:55 AM, Eduardo Corbelle Rico<br>> > > > <<a href="mailto:eduardo.corbelle@gmx.net">eduardo.corbelle@gmx.net</a>> wrote:<br>> > > > ><br>> > > > > Dear all,<br>> > > > ><br>> > > > > I am unable to use v.net.iso because of a "segmentation fault"<br>> > > > > error. I<br>> > > > >  have a script that used to work correctly in GRASS 6.4 (32<br>> > > > > bit)<br>> > > > > but<br>> > > > > produces this error after I switched to GRASS 7.0.4 (64 bit).<br>> > > > ><br>> > > > > If I try to follow both examples shown in <a href="https://grass.osgeo.o">https://grass.osgeo.o</a><br>> > > > > rg/g<br>> > > > > rass<br>> > > > > 70/manuals/v.net.iso.html (using the Spearfish dataset for<br>> > > > > GRASS 7)<br>> > > > > the<br>> > > > > same error appears:<br>> > > > ><br>> > > > > > Building graph...<br>> > > > > > Registering arcs...<br>> > > > > > Segmentation fault<br>> > > ><br>> > > > The segmentation fault must happen in the vector libraries. I<br>> > > > tested<br>> > > > on Linux and can not reproduce the segmentation fault. Valgrind<br>> > > > also<br>> > > > does not show anything that could cause a segmentation fault. Can<br>> > > > you<br>> > > > provide a gdb backtrace?<br>> > > ><br>> > > > Markus M<br>> > ><br>> > > Thank you Markus,<br>> > ><br>> > > My system is debian Stretch, and the following lines describe my<br>> > > attempt at generating a gdb backtrace. Please let me know if I<br>> > > should<br>> > > do otherwise.<br>> ><br>> > So far so good. The module crashes in a library function that comes<br>> > from libavl without modifications, but I can still not see why it<br>> > could cause a segmentation fault. Can you recompile with the compiler<br>> > debugging option -g? gdb will then be able to provide more<br>> > information:<br>> ><br>> > make distclean<br>> > CFLAGS="-g" ./configure <configure options><br>> > make<br>> ><br>> > optionally make install<br>> ><br>> > Then start GRASS and use gdb for v.net.iso as before.<br>> ><br>> > Markus M<br>> ><br>><br>> Dear Markus,<br>><br>> Following those instructions does not seem to have changed the<br>> resulting backtrace info (copied below). Maybe I missed something along<br>> the way?<br>><br>> ---------------------<br>> make distclean<br>> CFLAGS="-g" ./configure --with-freetype-includes=/usr/include/freetype2<br>> make<br>> sudo make install<br>><br>><br>> GRASS 7.0.5 (spearfish60_grass7):~ > gdb `which v.net.iso`<br>> GNU gdb (Debian 7.11.1-2+b1) 7.11.1<br>> Copyright (C) 2016 Free Software Foundation, Inc.<br>> License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl">http://gnu.org/licenses/gpl</a><br>> .html><br>> This is free software: you are free to change and redistribute it.<br>> There is NO WARRANTY, to the extent permitted by law.  Type "show<br>> copying"<br>> and "show warranty" for details.<br>> This GDB was configured as "x86_64-linux-gnu".<br>> Type "show configuration" for configuration details.<br>> For bug reporting instructions, please see:<br>> <<a href="http://www.gnu.org/software/gdb/bugs/">http://www.gnu.org/software/gdb/bugs/</a>>.<br>> Find the GDB manual and other documentation resources online at:<br>> <<a href="http://www.gnu.org/software/gdb/documentation/">http://www.gnu.org/software/gdb/documentation/</a>>.<br>> For help, type "help".<br>> Type "apropos word" to search for commands related to "word"...<br><br>This is the problem:<br>> Reading symbols from /usr/lib/grass70/bin/v.net.iso...(no debugging<br>> symbols found)...done.<br><br></div>It should be<br><div>Reading symbols from /usr/lib/grass70/bin/v.net.iso...done.<br><br></div><div>For testing purposes I introduced a bug in my local copy to trigger a segmentation fault. The backtrace shows:<br><br>(gdb) bt<br>#0  tavl_probe (tree=tree@entry=0x827d30, item=item@entry=0x82fb20) at tavl.c:131<br>#1  0x00007ffff6c3d3e7 in dglTreeNodeAdd (pavl=0x827d30, nKey=nKey@entry=1) at tree.c:73<br>#2  0x00007ffff6c32d17 in dgl_add_edge_V1 (pgraph=0x7fffffffccf8, nHead=<optimized out>, nTail=<optimized out>, nCost=1231014, <br>    nEdge=1, pvHeadAttr=pvHeadAttr@entry=0x0, pvTailAttr=0x0, pvEdgeAttr=0x0, nFlags=0) at edgemgmt-template.c:59<br>#3  0x00007ffff6c30ea2 in dglAddEdge (pGraph=pGraph@entry=0x7fffffffccf8, nHead=<optimized out>, nTail=<optimized out>, <br>    nCost=<optimized out>, nEdge=nEdge@entry=1) at graph.c:624<br>#4  0x00007ffff7bb5d09 in Vect_net_build_graph (Map=Map@entry=0x7fffffffc920, ltype=ltype@entry=6, afield=afield@entry=1, <br>    nfield=nfield@entry=2, afcol=0x0, abcol=0x0, ncol=0x0, geo=0, version=1) at net_build.c:918<br>#5  0x00000000004029e1 in main (argc=<optimized out>, argv=<optimized out>) at main.c:224<br><br></div><div>Note that file and line are given where the segfault occured.<br><br></div><div>Is this something Debian specific that debugging symbols must be explicitly activated? Are you using GCC or another compiler?<br><br></div><div>Alternatively, you can also try valgrind:<br><br></div><div>CMD="v.net.iso input=myroads_net output=myroads_net_iso center_cats=1-100000 costs=1000,2000,5000 --o"<br>valgrind --tool=memcheck --log-file=v.net.iso.vg.log $CMD<br></div><div><br></div><div>Markus M<br></div><div><br></div><div>><br>><br>> (gdb) run input=myroads_net output=myroads_net_iso center_cats=1-100000<br>> costs=1000,2000,5000<br>> Starting program: /usr/lib/grass70/bin/v.net.iso input=myroads_net<br>> output=myroads_net_iso center_cats=1-100000 costs=1000,2000,5000<br>> [Thread debugging using libthread_db enabled]<br>> Using host libthread_db library "/lib/x86_64-linux-<br>> gnu/libthread_db.so.1".<br>> Building graph...<br>> Registering arcs...<br>><br>> Program received signal SIGSEGV, Segmentation fault.<br>> 0x00007ffff6c64708 in tavl_probe ()<br>>    from /usr/lib/grass70/lib/<a href="http://libgrass_dgl.7.0.5.so">libgrass_dgl.7.0.5.so</a><br>><br>><br>> (gdb) bt full<br>> #0  0x00007ffff6c64708 in tavl_probe ()<br>>    from /usr/lib/grass70/lib/<a href="http://libgrass_dgl.7.0.5.so">libgrass_dgl.7.0.5.so</a><br>> No symbol table info available.<br>> #1  0x00007ffff6c65717 in dglTreeNodeAdd ()<br>>    from /usr/lib/grass70/lib/<a href="http://libgrass_dgl.7.0.5.so">libgrass_dgl.7.0.5.so</a><br>> No symbol table info available.<br>> #2  0x00007ffff6c5aa0c in dgl_add_edge_V1 ()<br>>    from /usr/lib/grass70/lib/<a href="http://libgrass_dgl.7.0.5.so">libgrass_dgl.7.0.5.so</a><br>> No symbol table info available.<br>> #3  0x00007ffff6c58a62 in dglAddEdge ()<br>>    from /usr/lib/grass70/lib/<a href="http://libgrass_dgl.7.0.5.so">libgrass_dgl.7.0.5.so</a><br>> No symbol table info available.<br>> #4  0x00007ffff7ba1d69 in Vect_net_build_graph ()<br>>    from /usr/lib/grass70/lib/<a href="http://libgrass_vector.7.0.5.so">libgrass_vector.7.0.5.so</a><br>> No symbol table info available.<br>> #5  0x0000555555555b08 in main ()<br>> No symbol table info available.<br>><br>><br>> (gdb) l<br>> 1       ../sysdeps/x86_64/dl-procinfo.c: Non hai tal ficheiro ou<br>> directorio.<br>><br>><br>><br>><br>><br>><br>> > ><br>> > > ><br>> > > > ><br>> > > > > What I am missing?<br>> > > > ><br>> > > > > Thanks in advance.<br>> > > > ><br>> > > > > Greetings.<br>> > > > ><br>> > > > > Eduardo Corbelle<br>> > > > ><br>> > > > ><br>> > > > ><br>> > > > > --<br>> > > > > Dr. Eduardo Corbelle Rico<br>> > > > ><br>> > > > > Land laboratory (LaboraTe)<br>> > > > > Department of Agricultural and Forest Engineering<br>> > > > > Universidade de Santiago de Compostela<br>> > > > ><br>> > > > > e-mail: <a href="mailto:eduardo.corbelle@usc.es">eduardo.corbelle@usc.es</a><br>> > > > > Tel:  +34 982 823 324<br>> > > > > Fax:  +34 982 285 926<br>> > > > > Web: <a href="http://laborate.usc.es">http://laborate.usc.es</a><br>> > > > >      <a href="http://masterterra.usc.es">http://masterterra.usc.es</a><br>> > > > >      <a href="http://github.com/eduardocorbelle">http://github.com/eduardocorbelle</a><br>> > > > > _______________________________________________<br>> > > > > grass-user mailing list<br>> > > > > <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>> > > > > <a href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br><br></div></div>