Opened 14 years ago

Closed 12 years ago

#968 closed defect (fixed)

v.net.salesman problem with memory allocation

Reported by: marisn Owned by: grass-dev@…
Priority: major Milestone: 6.4.3
Component: Vector Version: svn-releasebranch64
Keywords: v.net Cc:
CPU: x86-64 Platform: Linux

Description

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.

Attachments (1)

v.net.salesman.valgrind (23.0 KB ) - added by marisn 14 years ago.
Valgrind output of v.net.salesman run

Download all attachments as: .zip

Change History (5)

by marisn, 14 years ago

Attachment: v.net.salesman.valgrind added

Valgrind output of v.net.salesman run

comment:1 by marisn, 14 years ago

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

comment:2 by marisn, 14 years ago

CPU: Unspecifiedx86-64
Version: unspecifiedsvn-releasebranch64

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?

comment:3 by marisn, 13 years ago

Milestone: 6.4.06.4.1

Still an issue for 6.4 and 6.5 SVNs.

comment:4 by neteler, 12 years ago

Milestone: 6.4.16.4.3
Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.