[GRASS-dev] [GRASS GIS] #1523: v.select segfaults with atype and btype area

#1523: v.select segfaults with atype and btype area
----------------------+-----------------------------------------------------
Reporter: pertusus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------
If I do
v.mkgrid map=continent_whole_grid grid=2,2
v.mkgrid map=other_grid grid=4,4

v.select ainput=other_grid atype=area binput=continent_whole_grid
btype=area output=result operator=overlap

I get a segfault. If one of atype or btype is not area, no segfault.

Here is the backtrace
(gdb) run
Starting program: /usr/local/grass-7.0.svn/bin/v.select ainput=other_grid
atype=area binput=continent_whole_grid btype=area output=result
operator=overlap
[Thread debugging using libthread_db enabled]
Processing areas...
   18%
Program received signal SIGSEGV, Segmentation fault.
0x000000000040393f in select_lines (aIn=0x7fffffffcad0, atype=16,
afield=1,
     bIn=<value optimized out>, btype=64, bfield=1, cat_flag=0, operator=8,
     relate=0x0, ALines=0x6aa1a0) at select.c:294
294 if (line_overlap_area(aIn, aline,

(gdb) bt
#0 0x000000000040393f in select_lines (aIn=0x7fffffffcad0, atype=16,
     afield=1, bIn=<value optimized out>, btype=64, bfield=1, cat_flag=0,
     operator=8, relate=0x0, ALines=0x6aa1a0) at select.c:294
#1 0x0000000000402f0e in main (argc=<value optimized out>,
     argv=<value optimized out>) at main.c:115

I attach a tar that can be used to reproduce.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1523&gt;
GRASS GIS <http://grass.osgeo.org>

#1523: v.select segfaults with atype and btype area
----------------------+-----------------------------------------------------
Reporter: pertusus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------

Comment(by mmetz):

Please try trunk r49952.

Markus M

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1523#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1523: v.select segfaults with atype and btype area
-----------------------+----------------------------------------------------
  Reporter: pertusus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Changes (by pertusus):

  * status: new => closed
  * resolution: => fixed

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1523#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1523: v.select segfaults with atype and btype area
-----------------------+----------------------------------------------------
  Reporter: pertusus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------

Comment(by mmetz):

BTW, thanks for the detailed description and the test case! That made it
easy to locate and fix the bug.

Markus M

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1523#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1523: v.select segfaults with atype and btype area
-----------------------+----------------------------------------------------
  Reporter: pertusus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------

Comment(by pertusus):

That's the least I can do, given that I use a lot grass and don't
contribute much...

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1523#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>