[GRASS-dev] raster query/r.what error with a r.external-linked raster

hi,

I have a self compiled:

System Info
GRASS Version: 7.1.svn
GRASS SVN revision: 68037
Build date: 2016-03-11
Build platform: x86_64-pc-linux-gnu
GDAL: 2.0.2
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.8.7.1
Python: 2.7.9
wxPython: 3.0.1.1
Platform: Linux-3.16.0-4-amd64-x86_64-with-debian-8.3

---------------------

raster is linked:

r.info map=EUD_CP_DEMS_3500025000_AA@demdata

+----------------------------------------------------------------------------+
| Map: EUD_CP_DEMS_3500025000_AA@dem Date: Sun Mar 13 01:10:35 2016
|
| Mapset: demdata Login of Creator: bugs
|
| Location: eudem_epsg3035
|
| DataBase: /home/bugs/grassdata
|
| Title: ( EUD_CP_DEMS_3500025000_AA )
|
| Timestamp: none
|

|----------------------------------------------------------------------------|
|
|
| Type of Map: raster Number of Categories: 0
|
| Data Type: FCELL
|
| Rows: 40000
|
| Columns: 40000
|
| Total Cells: 1600000000
|
| Projection: Lambert Azimuthal Equal Area
|
| N: 3000000 S: 2000000 Res: 25
|
| E: 4000000 W: 3000000 Res: 25
|
| Range of data: min = -33.27055 max = 3385.91
|
|
|
| Data Description:
|
| generated by r.external
|
|
|
| Comments:
|
| r.external input="/home/bugs/gisdata/eudem/EUD_CP-DEMS_3500025000-AA\
|
| /EUD_CP-DEMS_3500025000-AA.tif" output="EUD_CP_DEMS_3500025000_AA"
|
|
|

+----------------------------------------------------------------------------+

when I do a raster query in the map display, I get:

---------------------
Traceback (most recent call last):
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/mapwin/buffered.py", line 1236, in
MouseActions

self.OnLeftUp(event)
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/mapwin/buffered.py", line 1413, in
OnLeftUp

self.mapQueried.emit(x=self.mouse['end'][0],
y=self.mouse['end'][1])
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/etc/python/grass/pydispatch/signal.py", line 229,
in emit

dispatcher.send(signal=self, *args, **kwargs)
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/etc/python/grass/pydispatch/dispatcher.py", line
349, in send

**named
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/etc/python/grass/pydispatch/robustapply.py", line
60, in robustApply

return receiver(*arguments, **named)
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/mapdisp/frame.py", line 870, in Query

self.QueryMap(east, north, qdist, rast, vect)
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/mapdisp/frame.py", line 907, in
QueryMap

localized=True)
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/etc/python/grass/script/raster.py", line 186, in
raster_what

env=env)
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/etc/python/grass/script/core.py", line 461, in
read_command

return handle_errors(returncode, stdout, args, kwargs)
  File "/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-
linux-gnu/etc/python/grass/script/core.py", line 329, in
handle_errors

returncode=returncode)
grass.exceptions
.
CalledModuleError
:
Module run None ['r.what', '--q', '-rf',
'map=EUD_CP_DEMS_3500025000_AA@demdata', 'null=No data',
'coordinates=3532112.092810,2247474.190841'] ended with
error
Process ended with non-zero return code -11. See errors in
the (error) output.

---------------------
then I try

r.what map=EUD_CP_DEMS_3500025000_AA@demdata
coordinates=3532112.092810,2247474.190841
(Mon Mar 14 20:48:50 2016) Befehl ausgeführt (0 Sek)

DEBUG=3 on

r.what map=EUD_CP_DEMS_3500025000_AA@demdata
coordinates=3532112.092810,2247474.190841
D1/3: G_set_program_name(): r.what
D2/3: G_file_name(): path =
/home/bugs/grassdata/eudem_epsg3035/demdata
D3/3: G_option_to_separator(): key = separator -> sep = '|'
D2/3: G_file_name(): path =
/home/bugs/grassdata/eudem_epsg3035/demdata/WIND
D2/3: G_file_name(): path =
/home/bugs/grassdata/eudem_epsg3035/demdata/WIND
D2/3: file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj: 99
D3/3: region item: zone: 0
D3/3: region item: north: 3000000
D3/3: region item: south: 2000000
D3/3: region item: east: 4000000
D3/3: region item: west: 3000000
D3/3: region item: cols: 40000
D3/3: region item: rows: 40000
D3/3: region item: e-w resol: 25
D3/3: region item: n-s resol: 25
D3/3: region item: top: 1.000000000000000
D3/3: region item: bottom: 0.000000000000000
D3/3: region item: cols3: 40000
D3/3: region item: rows3: 40000
D3/3: region item: depths: 1
D3/3: region item: e-w resol3: 25
D3/3: region item: n-s resol3: 25
D3/3: region item: t-b resol: 1
D1/3: G_find_raster2(): name=EUD_CP_DEMS_3500025000_AA
mapset=demdata
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell/EUD_CP_DEMS_3500025000_AA
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cellhd/EUD_CP_DEMS_3500025000_AA
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cellhd/EUD_CP_DEMS_3500025000_AA
D2/3: file open: read (mode = r)
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cellhd/EUD_CP_DEMS_3500025000_AA
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cellhd/EUD_CP_DEMS_3500025000_AA
D2/3: file open: read (mode = r)
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cellhd/EUD_CP_DEMS_3500025000_AA
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cellhd/EUD_CP_DEMS_3500025000_AA
D2/3: file open: read (mode = r)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj: 99
D3/3: region item: zone: 0
D3/3: region item: north: 3000000
D3/3: region item: south: 2000000
D3/3: region item: east: 4000000
D3/3: region item: west: 3000000
D3/3: region item: cols: 40000
D3/3: region item: rows: 40000
D3/3: region item: e-w resol: 25
D3/3: region item: n-s resol: 25
D3/3: region item: format: -1
D3/3: region item: compressed: 0
D1/3: G_find_raster2(): name=EUD_CP_DEMS_3500025000_AA
mapset=demdata
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell/EUD_CP_DEMS_3500025000_AA
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/fcell/EUD_CP_DEMS_3500025000_AA
D1/3: G_find_raster2(): name=EUD_CP_DEMS_3500025000_AA
mapset=demdata
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell/EUD_CP_DEMS_3500025000_AA
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell_misc/EUD_CP_DEMS_3500025000_AA/f_format
D1/3: G_find_raster2(): name=EUD_CP_DEMS_3500025000_AA
mapset=demdata
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell/EUD_CP_DEMS_3500025000_AA
D1/3: G_find_raster2(): name=EUD_CP_DEMS_3500025000_AA
mapset=demdata
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell/EUD_CP_DEMS_3500025000_AA
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/fcell/EUD_CP_DEMS_3500025000_AA
D1/3: G_find_raster2(): name=EUD_CP_DEMS_3500025000_AA
mapset=demdata
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell/EUD_CP_DEMS_3500025000_AA
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell_misc/EUD_CP_DEMS_3500025000_AA/f_format
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell_misc/EUD_CP_DEMS_3500025000_AA/gdal
D2/3: G_file_name(): path = /home/bugs/grassdata/eudem_epsg3
035/demdata/cell_misc/EUD_CP_DEMS_3500025000_AA/gdal
D3/3: found libgdal.so.20

---------------------
when I query/r.what a GRASS raster:

r.what map=testrmapcalc@demdata coordinates=3566115.70248,2801652.89256
3566115.70248|2801652.89256||1

every works fine
---------------------

any idea?

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/raster-query-r-what-error-with-a-r-external-linked-raster-tp5256308.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

On Mon, Mar 14, 2016 at 4:02 PM, Helmut Kudrnovsky <hellik@web.de> wrote:

Module run None ['r.what', '--q', '-rf',
'map=EUD_CP_DEMS_3500025000_AA@demdata', 'null=No data',
'coordinates=3532112.092810,2247474.190841'] ended with
error
Process ended with non-zero return code -11. See errors in
the (error) output.

Can you run this with gdb (you need to compile with -ggdb)?

gdb r.what

(gdb) run -rf map=EUD_CP_DEMS_3500025000_AA@demdata
coordinates=3532112.092810,2247474.190841

[it should segfault now]

(gdb) bt

wenzeslaus wrote

On Mon, Mar 14, 2016 at 4:02 PM, Helmut Kudrnovsky &lt;

hellik@

&gt; wrote:

Module run None ['r.what', '--q', '-rf',
'map=EUD_CP_DEMS_3500025000_AA@demdata', 'null=No data',
'coordinates=3532112.092810,2247474.190841'] ended with
error
Process ended with non-zero return code -11. See errors in
the (error) output.

Can you run this with gdb (you need to compile with -ggdb)?

gdb r.what

(gdb) run -rf map=EUD_CP_DEMS_3500025000_AA@demdata
coordinates=3532112.092810,2247474.190841

[it should segfault now]

(gdb) bt

_______________________________________________
grass-dev mailing list

grass-dev@.osgeo

http://lists.osgeo.org/mailman/listinfo/grass-dev

as I'm not used to compile on Linux, what may be the command to
compile with -ggdb? configure? make?

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/raster-query-r-what-error-with-a-r-external-linked-raster-tp5256308p5257823.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

On Tue, Mar 22, 2016 at 10:03 AM, Helmut Kudrnovsky <hellik@web.de> wrote:

as I'm not used to compile on Linux, what may be the command to
compile with -ggdb? configure? make?

It is a compiler flag and it can be set using before you run ./configure
using the CFLAGS environmental variable, so e.g.

export CFLAGS="-ggdb -Wall"
./configure ...

see full examples here

https://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu

wenzeslaus wrote

On Tue, Mar 22, 2016 at 10:03 AM, Helmut Kudrnovsky &lt;

hellik@

&gt; wrote:

as I'm not used to compile on Linux, what may be the command to
compile with -ggdb? configure? make?

It is a compiler flag and it can be set using before you run ./configure
using the CFLAGS environmental variable, so e.g.

export CFLAGS="-ggdb -Wall"
./configure ...

see full examples here

https://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu

(gdb) run -rf map=es_l1_1km@bugs coordinates=4395123.966942,2799025.206612
Starting program:
/home/bugs/dev/cpp/grass7_trunk/dist.x86_64-pc-linux-gnu/bin/r.what -rf
map=es_l1_1km@bugs coordinates=4395123.966942,2799025.206612
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4418090 in vtable for __cxxabiv1::__si_class_type_info ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6

(gdb) bt
#0 0x00007ffff4418090 in vtable for __cxxabiv1::__si_class_type_info ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007fffed6778e3 in GDALRegister_VICAR () at vicardataset.cpp:824
#2 0x00007fffed494ded in GDALAllRegister () at gdalallregister.cpp:234
#3 0x00007ffff7bcf6af in Rast_init_gdal () at gdal.c:220
#4 0x00007ffff7bcf85d in Rast_get_gdal_link (
    name=name@entry=0x7ffffffca990 "es_l1_1km",
    mapset=mapset@entry=0x7ffffffcaa90 "bugs") at gdal.c:317
#5 0x00007ffff7bc6d49 in Rast__open_old (name=0x7ffffffca990 "es_l1_1km",
    mapset=0x7ffffffcaa90 "bugs") at open.c:272
#6 0x00007ffff7bc7316 in Rast_open_old (name=<optimized out>,
    mapset=<optimized out>) at open.c:116
#7 0x0000000000401c07 in main (argc=6639232, argv=0x7fffeda9434b)
    at main.c:205
(gdb)

tested with

System Info
GRASS Version: 7.1.svn
GRASS SVN revision: 68112
Build date: 2016-03-23
Build platform: x86_64-pc-linux-gnu
GDAL: 2.0.2
PROJ.4: 4.8.0
GEOS: 3.4.2
SQLite: 3.8.7.1
Python: 2.7.9
wxPython: 3.0.1.1
Platform: Linux-3.16.0-4-amd64-x86_64-with-debian-8.3

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/raster-query-r-what-error-with-a-r-external-linked-raster-tp5256308p5257987.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

Helmut Kudrnovsky wrote:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4418090 in vtable for __cxxabiv1::__si_class_type_info ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6

(gdb) bt
#0 0x00007ffff4418090 in vtable for __cxxabiv1::__si_class_type_info ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007fffed6778e3 in GDALRegister_VICAR () at vicardataset.cpp:824
#2 0x00007fffed494ded in GDALAllRegister () at gdalallregister.cpp:234

This may be an issue with GDAL itself, e.g. an external library having
been updated without rebuilding GDAL. If that's the case, any program
which calls GDALAllRegister() (e.g. "gdalinfo --formats") would
exhibit the same issue.

Alternatively, it may be an issue with GDAL and GRASS using different
versions of a common library (e.g. libstdc++). If you've updated any
system libraries, perform a full re-compile of GRASS (after "make
clean") and ensure that GRASS isn't built against a "private" version
of any system library used by GDAL.

--
Glynn Clements <glynn@gclements.plus.com>

This may be an issue with GDAL itself, e.g. an external library having
been updated without rebuilding GDAL. If that's the case, any program
which calls GDALAllRegister() (e.g. "gdalinfo --formats") would
exhibit the same issue.

gdalinfo testraster.tif
gdalinfo --formats

both are working.

Alternatively, it may be an issue with GDAL and GRASS using different
versions of a common library (e.g. libstdc++). If you've updated any
system libraries, perform a full re-compile of GRASS (after "make
clean") and

the debian installation is updated; several times svn up in grass and
recompiled, same behaviour.

and ensure that GRASS isn't built against a "private" version
of any system library used by GDAL.

how could this be tested/investigated? (linux newbie here on my side)

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/raster-query-r-what-error-with-a-r-external-linked-raster-tp5256308p5258490.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

Helmut Kudrnovsky wrote

This may be an issue with GDAL itself, e.g. an external library having
been updated without rebuilding GDAL. If that's the case, any program
which calls GDALAllRegister() (e.g. "gdalinfo --formats") would
exhibit the same issue.

gdalinfo testraster.tif
gdalinfo --formats

both are working.

Alternatively, it may be an issue with GDAL and GRASS using different
versions of a common library (e.g. libstdc++). If you've updated any
system libraries, perform a full re-compile of GRASS (after "make
clean") and

the debian installation is updated; several times svn up in grass and
recompiled, same behaviour.

and ensure that GRASS isn't built against a "private" version
of any system library used by GDAL.

how could this be tested/investigated? (linux newbie here on my side)

found it. GDAL 2.0.2 is self compiled, Debian's Saga GIS is compiled
against Debian's GDAL 1.11.x.

Deinstalling Saga GIS, querying a linked raster in GRASS GIS works again.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/raster-query-r-what-error-with-a-r-external-linked-raster-tp5256308p5258590.html
Sent from the Grass - Dev mailing list archive at Nabble.com.