[GRASS-user] v.mkgrid - segmentation fault

Hi all,

I get this error when I try to make a vector grid:

g.region -dp

projection: 0 (x,y)
zone: 0
north: 12
south: 0
west: 0
east: 12
nsres: 1
ewres: 1
rows: 12
cols: 12
cells: 144

v.mkgrid map=vectgrid grid=12,12 position=coor coor=0,0 box=1,1
Segmentation fault

v.info vgrid
ERROR: Unable to open vector map <vgrid@user1> on level 2. Try to rebuild
vector topology by v.build.

v.build vectgrid
WARNING: Coor files of vector map <vectgrid@user1> is larger than it should
be (14 bytes excess)
Building topology for vector map <vectgrid>...
0 primitives registered
0 vertices registered
0 areas built
0 isles built
Attaching islands:
Attaching centroids: Topology was built
Number of nodes : 0
Number of primitives: 0
Number of points : 0
Number of lines : 0
Number of boundaries: 0
Number of centroids : 0
Number of areas : 0
Number of isles : 0

I'm using GRASS 6.4.svn in Ubuntu 8.10.

What's wrong ?

Cheers,

Paolo

Paolo Craveri wrote:

I get this error when I try to make a vector grid:

g.region -dp

projection: 0 (x,y)
zone: 0
north: 12
south: 0
west: 0
east: 12
nsres: 1
ewres: 1
rows: 12
cols: 12
cells: 144

v.mkgrid map=vectgrid grid=12,12 position=coor coor=0,0
box=1,1
Segmentation fault

....

I'm using GRASS 6.4.svn in Ubuntu 8.10.

works for me.

What's wrong ?

you'll have to run a backtrace to find out:
  http://grass.osgeo.org/wiki/GRASS_Debugging#Using_GDB

Hamish

Hi all,

2008/11/10 Hamish <hamish_b@yahoo.com>:

you'll have to run a backtrace to find out:
http://grass.osgeo.org/wiki/GRASS_Debugging#Using_GDB

I compiled grass with:
CFLAGS="-ggdb -Wall -Werror-implicit-function-declaration"

then I tried:

gdb `which v.mkgrid`
(gdb) run "map=vectgrid grid=12,12 position=0,0 box=1,1 --overwrite"
Starting program: /usr/local/grass-6.4.svn/bin/v.mkgrid "map=vectgrid
grid=12,12 position=0,0 box=1,1 --overwrite"
[Thread debugging using libthread_db enabled]
warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at 000000d4

ERROR: Required parameter <grid> not set:
    (Number of rows and columns in grid).

Description:
Creates a GRASS vector map of a user-defined grid.

Keywords:
vector

Usage:
...etc. etc.

It seems strange to me; I set grid in command line.

I don't know gdb at all; what else can I do to understand segmentation
fault in v.mkgrid?

Many thanks in advance.

Paolo

Hamish:

> you'll have to run a backtrace to find out:
> http://grass.osgeo.org/wiki/GRASS_Debugging#Using_GDB

Paolo:

gdb `which v.mkgrid`
(gdb) run "map=vectgrid grid=12,12 position=0,0 box=1,1 --overwrite"
...
ERROR: Required parameter <grid> not set:
    (Number of rows and columns in grid).

It seems strange to me; I set grid in command line.

sorry, there was a quoting error in the example on the wiki, now fixed.

try again with:

GRASS> gdb `which v.mkgrid`
(gdb) run map=vectgrid grid=12,12 position=0,0 box=1,1 --overwrite

so individual option are parsed. quoting the whole thing has the effect of sending them all as a single parameter.

Hamish

Hi Hamish

try again with:

GRASS> gdb `which v.mkgrid`
(gdb) run map=vectgrid grid=12,12 position=0,0 box=1,1 --overwrite

GRASS 6.4.svn (simpleloc):~ > gdb `which v.mkgrid`
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) run map=vectgrid grid=12,12 box=1,1 position=coor coor=0,0 --o
Starting program: /usr/local/grass-6.4.svn/bin/v.mkgrid map=vectgrid
grid=12,12 box=1,1 position=coor coor=0,0 --o
[Thread debugging using libthread_db enabled]
warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at 000000d4
[New Thread 0xb59938f0 (LWP 6206)]
WARNING: Vector map <vectgrid> already exists and will be overwritten
Building topology for vector map <vectgrid>...

etc. etc.

Now it seems all ok! What happened?

Paolo

--
--
Craveri Paolo Livio

Lat. 44° 39' 11.08'' N Long. 7° 23' 25.26'' E
-------------------------------------------------------------
Preferisco ricevere allegati in formato OpenDocument
http://it.wikipedia.org/wiki/OpenDocument
I prefer to receive attachments in OpenDocument format
http://en.wikipedia.org/wiki/OpenDocument

http://www.gnu.org/philosophy/no-word-attachments.it.html

Hi all

Strange behaviour!

If I compile (configure) grass with this:
CFLAGS="-O2 -march=pentium-m -Wall" LDFLAGS="-s" ./configure ...

I get "segmentation fault" message:
v.mkgrid map=pp grid=12,12 position=region --o
Segmentation fault

No error if I compile (configure) with this:
CFLAGS="-ggdb -Wall -Werror-implicit-function-declaration" ./configure ....

?_?

Paolo

On 12/11/08 15:37, Paolo Craveri wrote:

Hi all

Strange behaviour!

If I compile (configure) grass with this:
CFLAGS="-O2 -march=pentium-m -Wall" LDFLAGS="-s" ./configure ...

I get "segmentation fault" message:
v.mkgrid map=pp grid=12,12 position=region --o
Segmentation fault

No error if I compile (configure) with this:
CFLAGS="-ggdb -Wall -Werror-implicit-function-declaration" ./configure ....

There have been issues with seg faults that only appear when code is compiled with optimization. See for example: http://trac.osgeo.org/grass/ticket/50

Not easy to debug apparently...
Please post a bug report on the tracker.

Moritz