[GRASS-dev] [GRASS GIS] #3285: r.viewshed crashes when using DEM linked with r.external

GRASS GIS trac at osgeo.org
Thu Nov 2 06:18:54 PDT 2017


#3285: r.viewshed crashes when using DEM linked with r.external
----------------------+------------------------------------
  Reporter:  neteler  |      Owner:  grass-dev@…
      Type:  defect   |     Status:  new
  Priority:  normal   |  Milestone:  7.2.3
 Component:  Raster   |    Version:  svn-releasebranch72
Resolution:           |   Keywords:  r.viewshed, r.external
       CPU:  x86-64   |   Platform:  Unspecified
----------------------+------------------------------------

Comment (by mmetz):

 Replying to [ticket:3285 neteler]:
 > As a followup of http://hub.qgis.org/issues/15787
 >
 > {{{
 > # test case
 > grass72 ~/grassdata/nc_spm_08_grass7/user1/
 >
 > g.region raster=elevation
 > r.out.gdal input=elevation output=nc_elevation.tif
 create="COMPRESS=DEFLATE"
 >
 > r.external input=~/nc_elevation.tif output=nc_elevation
 >
 > g.region -c
 > center easting:  637500.000000
 > center northing: 221750.000000
 >
 > r.viewshed input=nc_elevation coordinates=637500.0,221750.0
 output=viewshed
 > Computing events...
 >  100%
 > *** Error in `r.viewshed': free(): invalid pointer: 0x0000000002371d78
 ***
 > [...]
 > }}}
 >
 > A quick gdb (I'd need to recompile with debugging symbols "on" but maybe
 it already indicates the problematic code area):
 >
 > {{{
 > (gdb) bt
 > #0  0x00007ffff6d2d91f in raise () from /lib64/libc.so.6
 > #1  0x00007ffff6d2f51a in abort () from /lib64/libc.so.6
 > #2  0x00007ffff6d71200 in __libc_message () from /lib64/libc.so.6
 > #3  0x00007ffff6d7a88a in _int_free () from /lib64/libc.so.6
 > #4  0x00007ffff6d7e2bc in free () from /lib64/libc.so.6
 > #5  0x000000000042387a in operator delete (ptr=0xe9edc0) at mm.cpp:427
 > #6  0x00007fffe3783bda in GDALArrayBandBlockCache::FlushBlock(int, int,
 int) () from /lib64/libgdal.so.20
 > [...]
 > }}}

 The iostream lib caused the problem: GDAL used the operator delete from
 iostream lib on an object that was not allocated with the operator new
 from iostream lib. Fixed in trunk r71625. Maybe that custom memory manager
 of iostream lib should be removed altogether.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3285#comment:3>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list