[GRASS-dev] [GRASS GIS] #1795: segmentation fault in v.distance db_describe_table

#1795: segmentation fault in v.distance db_describe_table
----------------------+-----------------------------------------------------
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 |
----------------------+-----------------------------------------------------
For a very simple case v.distance segfaults. It is strange, it may be that
my setup has some issues, but I have no obvious idea.

The backtrace is:

{{{
gdb --args v.distance from=test_point to=test_bas column=cat_basin
to_column=cat upload=to_attr
....
Program received signal SIGSEGV, Segmentation fault.
db_describe_table (driver=0x0, name=0x7fffffffb130, table=0x7fffffffb148)
at c_desc_table.c:33
33 db__set_protocol_fds(driver->send, driver->recv);
(gdb) bt
#0 db_describe_table (driver=0x0, name=0x7fffffffb130,
table=0x7fffffffb148) at c_desc_table.c:33
#1 0x00007ffff7b98a8c in db_column_sqltype (driver=<value optimized out>,
tab=0x65fd40 "test_point", col=0x61b080 "cat_basin") at column.c:63
#2 0x00007ffff7b98b29 in db_column_Ctype (driver=<value optimized out>,
tab=<value optimized out>, col=<value optimized out>) at column.c:103
#3 0x0000000000406c04 in main (argc=64, argv=<value optimized out>) at
main.c:487
}}}

I attach a tarball that allows to reproduce the segfault. You should edit
prepare.sh to set the correct path to grass, then run

{{{
./prepare.sh
}}}

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

#1795: segmentation fault in v.distance db_describe_table
------------------------+---------------------------------------------------
Reporter: pertusus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.distance | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------
Changes (by martinl):

  * keywords: => v.distance

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

#1795: segmentation fault in v.distance db_describe_table
------------------------+---------------------------------------------------
Reporter: pertusus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.distance | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by mmetz):

This bug has been fixed 3 days ago in r53761. Please try latest svn.

Markus M

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

#1795: segmentation fault in v.distance db_describe_table
------------------------+---------------------------------------------------
Reporter: pertusus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.distance | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by pertusus):

Indeed, there is no more segfault anymore, but v.distance do not upload to
the table.

{{{
> v.db.select test_point
cat|dbl_1|dbl_2|int_1|cat_basin
1|1535075.28996661|-2045868.67996559|1|
}}}

cat_basin should be the cat of the test_bas point since the point is in
test_bas.

{{{
> v.db.select test_bas
cat
354
}}}

Should I open another bug?

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

#1795: segmentation fault in v.distance db_describe_table
------------------------+---------------------------------------------------
Reporter: pertusus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.distance | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by mmetz):

Replying to [comment:3 pertusus]:
> Indeed, there is no more segfault anymore, but v.distance do not upload
to the table.
>
> Should I open another bug?

Fixed in r53805, please test.

Markus M

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

#1795: segmentation fault in v.distance db_describe_table
------------------------+---------------------------------------------------
Reporter: pertusus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Keywords: v.distance | Platform: Linux
      Cpu: x86-64 |
------------------------+---------------------------------------------------

Comment(by neteler):

Seems to be solved (no more complaints), closing.

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

#1795: segmentation fault in v.distance db_describe_table
-----------------------+----------------------------------------------------
  Reporter: pertusus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Vector | Version: svn-trunk
Resolution: fixed | Keywords: v.distance
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Changes (by neteler):

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

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