[GRASS-dev] [GRASS GIS] #361: v.mkgrid - segmentation fault

#361: v.mkgrid - segmentation fault
---------------------+------------------------------------------------------
Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Keywords: | Platform: Linux
      Cpu: x86-32 |
---------------------+------------------------------------------------------
If I compile (configure) grass6.4 svn with this:
CFLAGS="-O2 -march=pentium-m -Wall" LDFLAGS="-s" ./configure ...

I get a "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
....

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

#361: v.mkgrid - segmentation fault
----------------------+-----------------------------------------------------
  Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by neteler):

What is the gcc version (gcc -v)? There seems to be a problem with the
optimization.

Markus

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

#361: v.mkgrid - segmentation fault
----------------------+-----------------------------------------------------
  Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by paoloC):

paolo@gis-laptop:~$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.3.2-1ubuntu11' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-
shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-
dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu
--enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-
targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-
linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11)

Paolo

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

#361: v.mkgrid - segmentation fault
----------------------+-----------------------------------------------------
  Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by marisn):

Paolo, can You, please, compile v.mkgrid with also "-g" flag and then run
it in gdb.
Also provide region information.

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

#361: v.mkgrid - segmentation fault
----------------------+-----------------------------------------------------
  Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by paoloC):

Replying to [comment:3 marisn]:
> Paolo, can You, please, compile v.mkgrid with also "-g" flag and then
run it in gdb.
> Also provide region information.

If I compile with this:
CFLAGS="-O2 -march=pentium-m -Wall -g" ./configure ...

gdb `which v.mkgrid`

...
(gdb) run myvectgrid position=region grid=12,12 box=1,1 --o

Starting program: /usr/local/grass-6.4.svn/bin/v.mkgrid myvectgrid
position=region grid=12,12 box=1,1 --o

[Thread debugging using libthread_db enabled]

warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at 000000d4

WARNING: 'box' option ignored with 'position=region'

[New Thread 0xb59c1940 (LWP 8329)]

    0%

Program received signal SIGSEGV, Segmentation fault.

[Switching to Thread 0xb59c1940 (LWP 8329)]

0xb799cd4b in sincos () from /usr/lib/libgdal1.5.0.so.1

Location is a simple xy loc:
g.region -p

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

I hope this will be useful.

Paolo

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

#361: v.mkgrid - segmentation fault
----------------------+-----------------------------------------------------
  Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by glynn):

This is a known issue with GDAL:

http://trac.osgeo.org/gdal/ticket/2497

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

#361: v.mkgrid - segmentation fault
----------------------+-----------------------------------------------------
  Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by msieczka):

Paolo,

What GDAL version do you use? If you use GDAL 1.5.2 + SVN r14997 or
greater is the problem gone? I suggest to close the ticket then.

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

#361: v.mkgrid - segmentation fault
------------------------+---------------------------------------------------
  Reporter: paoloC | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: default | Version: svn-develbranch6
Resolution: duplicate | Keywords:
  Platform: Linux | Cpu: x86-32
------------------------+---------------------------------------------------
Changes (by paoloC):

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

Comment:

Sorry. Of course, ticket must be close. Many thanks.

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