[GRASS-dev] [GRASS GIS] #1786: r.resamp.rst fails with message "split_and_interpolate() failed

#1786: r.resamp.rst fails with message "split_and_interpolate() failed
---------------------+------------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: 6.4.1
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------
The following command fails on my computer:[[BR]]

r.resamp.rst input=nearest_hydro_permanent_all_200@PERMANENT ew_res=10
ns_res=10 elev=nearest_hydro_permanent_all_200_10m overlap=3 zmult=1.0
tension=40.

Here is the output from the command:[[BR]]

'''65910784 bytes of disk space for temp files.'''
Temporarily changing the region to desired resolution ...
Changing back to the original region ...
Percent complete:
Cannot fseek elev offset2=-2147383136
Cannot fseek elev offset2=-2147382860
Cannot fseek elev offset2=-2147382584
Cannot fseek elev offset2=-2147382308
Cannot fseek elev offset2=-2147382032
Cannot fseek elev offset2=-2147381756
Cannot fseek elev offset2=-2147381480
Cannot fseek elev offset2=-2147381204
Cannot fseek elev offset2=-2147380928
Cannot fseek elev offset2=-2147380652
Cannot fseek elev offset2=-2147380376
Cannot fseek elev offset2=-2147380100
Cannot fseek elev offset2=-2147379824
Cannot fseek elev offset2=-2147379548
Cannot fseek elev offset2=-2147379272
Cannot fseek elev offset2=-2147378996
Cannot fseek elev offset2=-2147378720
Cannot fseek elev offset2=-2147378444
Cannot fseek elev offset2=-2147378168
Cannot fseek elev offset2=-2147377892
Cannot fseek elev offset2=-2147377616
Cannot fseek elev offset2=-2147377340
Cannot fseek elev offset2=-2147377064
Cannot fseek elev offset2=-2147376788
Cannot fseek elev offset2=-2147376512
Cannot fseek elev offset2=-2147376236
Cannot fseek elev offset2=-2147375960
Cannot fseek elev offset2=-2147375684
Cannot fseek elev offset2=-2147375408
Cannot fseek elev offset2=-2147375132
Cannot fseek elev offset2=-2147374856
Cannot fseek elev offset2=-2147374576
interpolate() failed
dnorm in mainc after grid before out1= 1249.036216
split_and_interpolate() failed

The command fails in exactly the same way on two different systems:
1. Ubuntu 10.04 with grass 6.4 RC with amd64 processor and 64 bit OS
2. Ubuntu 10.04 with grass 6.4.1 with amd64 processor and 64 bit OS

This exact command does work on a project that is about 1/10th the size of
the one on which the command failed.

I looked at the code and wonder if I had an integer overflow (possibly on
the variable sdisk). My region is huge and my resolution is high.

Region:[[BR]]

projection: 1 (UTM)
zone: 12
datum: nad83
ellipsoid: grs80
north: 6399780
south: 6058660
west: 243410
east: 563010
nsres: 10
ewres: 10
rows: 34112
cols: 31960
cells: 1090219520

I find it strange that the '''65910784 bytes of disk space for temp
files.''' didn't format to 65.91 MB ....

Makes me think overflow but I my C knowledge is just about nonexistent.

Cheers!

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

#1786: r.resamp.rst fails with message "split_and_interpolate() failed
--------------------+-------------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.1
Keywords: | Platform: Linux
      Cpu: x86-64 |
--------------------+-------------------------------------------------------
Changes (by bko):

  * component: Default => Raster

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

#1786: r.resamp.rst fails with message "split_and_interpolate() failed
--------------------+-------------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.1
Keywords: | Platform: Linux
      Cpu: x86-64 |
--------------------+-------------------------------------------------------

Comment(by neteler):

Replying to [ticket:1786 bko]:
> The following command fails on my computer:[[BR]]
>
> r.resamp.rst
...
> Cannot fseek elev offset2=-2147383136

It will be an overflow of 2^31, i.e. the 2GB limit.

..
> The command fails in exactly the same way on two different systems:
> 1. Ubuntu 10.04 with grass 6.4 RC with amd64 processor and 64 bit OS
> 2. Ubuntu 10.04 with grass 6.4.1 with amd64 processor and 64 bit OS

Have these versions been compiled with --enable-largefile?

If yes, can you try GRASS 7 instead which has improved Large File support?

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

#1786: r.resamp.rst fails with message "split_and_interpolate() failed
--------------------------+-------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.1
Keywords: r.resamp.rst | Platform: Linux
      Cpu: x86-64 |
--------------------------+-------------------------------------------------
Changes (by martinl):

  * keywords: => r.resamp.rst

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

#1786: r.resamp.rst fails with message "split_and_interpolate() failed
--------------------------+-------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.1
Keywords: r.resamp.rst | Platform: Linux
      Cpu: x86-64 |
--------------------------+-------------------------------------------------

Comment(by bko):

I have no idea whether large file support is enabled. I installed via apt-
get.

I'm in the middle of a project and worry about installing from source
because it might fail or break code I've written to talk to grass or
otherwise slow me down. I'll find a work-around. Thanks for the prompt
reply.

Let me know if there is anything else I can do to help you on your end.

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

#1786: r.resamp.rst fails with message "split_and_interpolate() failed
--------------------------+-------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.1
Keywords: r.resamp.rst | Platform: Linux
      Cpu: x86-64 |
--------------------------+-------------------------------------------------

Comment(by neteler):

Replying to [comment:4 bko]:
> I have no idea whether large file support is enabled. I installed via
apt-get.

If you got it from unstable, it seems to be enabled (if that's the right
log file):

https://launchpadlibrarian.net/107513186/buildlog_ubuntu-precise-
amd64.grass_6.4.2~upstream2-3~precise3_BUILDING.txt.gz

> I'm in the middle of a project and worry about installing from source
because it might fail or break code I've written to talk to grass or
otherwise slow me down.

Well, this is fairly unlikely :slight_smile: This page has just been updated:

grass.osgeo.org/wiki/Compile_and_Install_Ubuntu

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

#1786: r.resamp.rst fails with message "split_and_interpolate() failed
--------------------------+-------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.1
Keywords: r.resamp.rst | Platform: Linux
      Cpu: x86-64 |
--------------------------+-------------------------------------------------

Comment(by neteler):

I just see that you use 6.4.1? That's fairly outdated, so no surprise...

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

#1786: r.resamp.rst fails with message "split_and_interpolate() failed
--------------------------+-------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.1
Keywords: r.resamp.rst | Platform: Linux
      Cpu: x86-64 |
--------------------------+-------------------------------------------------

Comment(by glynn):

Replying to [comment:2 neteler]:

> Have these versions been compiled with --enable-largefile?

It doesn't matter. lib/rst/interp_float is limited to 32 bits in all 6.x
versions (including 6.5 svn), regardless of configure options.

7.0 doesn't have this limitation, provided that GRASS was built with LFS
enabled.

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

#1786: r.resamp.rst fails with message "split_and_interpolate() failed"
--------------------------+-------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.1
Keywords: r.resamp.rst | Platform: Linux
      Cpu: x86-64 |
--------------------------+-------------------------------------------------

Comment(by bko):

I was able to work around the problem by getting creative with how I
produced the layer.

I'll take your word for the fact that upgrading is unlikely to produce
problems for me but I think its good policy not to fiddle with my
configuration in the middle of a project unless it's absolutely critical.

Grass is amazing software and I look forward to running 7.0 in the near
future.

Thanks.

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

#1786: r.resamp.rst fails with message "split_and_interpolate() failed"
--------------------------+-------------------------------------------------
Reporter: bko | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.1
Keywords: r.resamp.rst | Platform: Linux
      Cpu: x86-64 |
--------------------------+-------------------------------------------------

Comment(by neteler):

Replying to [comment:7 glynn]:
> lib/rst/interp_float is limited to 32 bits in all 6.x versions
(including 6.5 svn),
> regardless of configure options.
>
> 7.0 doesn't have this limitation, provided that GRASS was built with LFS
enabled.

... for the record, this ticket is a mixture of wontfix-in-GRASS6 (too
complicated)
and already fixed-in-GRASS7 time ago.

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