[GRASS-dev] [GRASS GIS] #968: v.net.salesman problem with memory allocation

#968: v.net.salesman problem with memory allocation
-------------------------+--------------------------------------------------
Reporter: marisn | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: Vector | Version: unspecified
Keywords: v.net | Platform: Linux
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
v.net.salesman does something wrong during memory allocation. Normaly it
results into assertion in malloc call.
{{{
v.net.salesman: malloc.c:4633: _int_malloc: Assertion
`victim->fd_nextsize->bk_nextsize == victim' failed.
}}}
Valgrind reports invalid write (will attach full valgrind output as an
attachment).
{{{
Number of cities: [6]
==6589== Invalid write of size 8
==6589== at 0x401FAF: main (main.c:209)
==6589== Address 0xd18cbc8 is 0 bytes after a block of size 40 alloc'd
==6589== at 0x4C25EE5: malloc (in /usr/lib64/valgrind/
vgpreload_memcheck-amd64-linux.so)
==6589== by 0x529118F: G__malloc (alloc.c:41)
==6589== by 0x401F64: main (main.c:207)
}}}

GRASS 6.4 r41215 on ~AMD64 Gentoo.
6.5 is also affected.

I'm unable to reproduce with Spearfish. Will attach sample dataset.

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

#968: v.net.salesman problem with memory allocation
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: unspecified
Resolution: | Keywords: v.net
  Platform: Linux | Cpu: Unspecified
---------------------+------------------------------------------------------
Comment (by marisn):

Can't attach sample location. Download it from here:
http://www.gisnet.lv/ggmlinux/salesman_crash.tar.gz

Command to reproduce issue:

{{{
v.net.salesman input=roads_and_cities output=my_route type=line,boundary
alayer=1 nlayer=2 ccats=17,15,8,14,23,5
}}}

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

#968: v.net.salesman problem with memory allocation
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: svn-releasebranch64
Resolution: | Keywords: v.net
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Changes (by marisn):

  * version: unspecified => svn-releasebranch64
  * cpu: Unspecified => x86-64

Comment:

It works fine in 32bit Windows Vista running WinGRASS r41428 and still
fails when running 64bit ~AMD64 Gentoo 6.4 r41436. 32bit vs 64bit issue?

Can anybody running 32bit Linux make described test to confirm 64bitness
of this issue?

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

#968: v.net.salesman problem with memory allocation
--------------------+-------------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: Vector | Version: svn-releasebranch64
Keywords: v.net | Platform: Linux
      Cpu: x86-64 |
--------------------+-------------------------------------------------------
Changes (by marisn):

  * milestone: 6.4.0 => 6.4.1

Comment:

Still an issue for 6.4 and 6.5 SVNs.

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

#968: v.net.salesman problem with memory allocation
---------------------+------------------------------------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.3
Component: Vector | Version: svn-releasebranch64
Resolution: fixed | Keywords: v.net
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Changes (by neteler):

  * status: new => closed
  * resolution: => fixed
  * milestone: 6.4.1 => 6.4.3

Comment:

The recent v.net.+ improvements have solved the problem. The sample
command is now processed properly. Closing.

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