[GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

13 messages Options
Embed this post
Permalink
GRASS GIS

[GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------------------+----------------------------------------
 Reporter:  mlennert               |       Owner:  [hidden email]
     Type:  defect                 |      Status:  new                      
 Priority:  normal                 |   Milestone:  6.4.0                    
Component:  Raster                 |     Version:  svn-develbranch6        
 Keywords:  terraflow bad address  |    Platform:  Linux                    
      Cpu:  Unspecified            |  
-----------------------------------+----------------------------------------
 In all three version (6.4, 6devel and 7), I get the following error
 running r.terraflow in the North Carolina demo data set:


 {{{
 GRASS 6.5.svn (nc_spm_06):~ > g.region rast=elevation
 GRASS 6.5.svn (nc_spm_06):~ > r.terraflow elevation=elevation@PERMANENT
 filled=fill direction=flow swatershed=waters accumulation=accum tci=tci
 STREAM_DIR=/home/mlennert/STREAM
 STREAM temporary files in /home/mlennert/STREAM  (THESE INTERMEDIATE
 STREAMS WILL NOT BE DELETED IN CASE OF ABNORMAL TERMINATION OF THE
 PROGRAM. TO SAVE SPACE PLEASE DELETE THESE FILES MANUALLY!)
 file stats.out exists - renaming.
 MFD flow direction
 D8CUT=999999986991104.000000
 Memory size: 300.00M (314572800) bytes
 Memory manager registering memory in MM_IGNORE_MEMORY_EXCEEDED mode.
 total elements=2025000, nodata elements=0
 largest temporary files:
 FILL: 108.15M (113400000) [2025000 elements, 56B each]
 FLOW: 154.50M (162000000) [2025000 elements, 80B each]
 Will need at least 308.99M (324000000) space available in
 /home/mlennert/STREAM
 ------------------------------
 COMPUTING FLOW DIRECTIONS
 classifying nodata (inner & boundary)
 assigning preliminary directions
 finding flat areas (plateaus and depressions)
 file=/home/mlennert/STREAM/STREAM_lRe0NI:cannot read!: Bad address
 r.terraflow: /home/mlennert/SRC/GRASS/grass6_devel/dist.i486-pc-linux-
 gnu/include/grass/iostream/ami_sort_impl.h:91: size_t
 makeRun_Block(AMI_STREAM<T>*, T*, unsigned int, Compare*) [with T =
 plateauType, Compare = ijCmpPlateauType]: Assertion `err ==
 AMI_ERROR_NO_ERROR || err == AMI_ERROR_END_OF_STREAM' failed.
 Aborted
 }}}

 I have over 60GB of disk space in /home (and I get the same error running
 it with the default /var/tmp). This is using Debian Lenny. The same error
 has been reported by a student running Ubuntu Intrepid.

 Moritz

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  svn-develbranch6        
Resolution:            |    Keywords:  terraflow bad address    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by glynn):

 Replying to [ticket:775 mlennert]:

 > In all three version (6.4, 6devel and 7), I get the following error
 running r.terraflow in the North Carolina demo data set:

 > file=/home/mlennert/STREAM/STREAM_lRe0NI:cannot read!: Bad address

 The error message corresponds to fread() failing with EFAULT (invalid
 buffer pointer) in either AMI_STREAM<T>::read_item() or
 AMI_STREAM<T>::read_array(). I would suspect the latter, as the former
 reads into the read_tmp member of the AMI_STREAM<T> object

 The assert() failure:
 >
 {{{
 r.terraflow: /home/mlennert/SRC/GRASS/grass6_devel/dist.i486-pc-linux-
 gnu/include/grass/iostream/ami_sort_impl.h:91: size_t
 makeRun_Block(AMI_STREAM<T>*, T*, unsigned int, Compare*) [with T =
 plateauType, Compare = ijCmpPlateauType]: Assertion `err ==
 AMI_ERROR_NO_ERROR || err == AMI_ERROR_END_OF_STREAM' failed.
 }}}

 also suggests the read_array() method, and indicates that a bogus pointer
 is passed as the "data" parameter to makeRun_Block().

 Beyond that, I can only suggest running it under gdb and printing a full
 backtrace ("bt full") when it aborts.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:1>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  svn-develbranch6        
Resolution:            |    Keywords:  terraflow bad address    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by mlennert):

 Replying to [comment:1 glynn]:
 > Beyond that, I can only suggest running it under gdb and printing a full
 backtrace ("bt full") when it aborts.

 Done.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:2>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
Andrew Danner

Re: Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
It looks like some changes in include/iostream/ami_sort_impl.h r32509
may be causing this problem.

r32509 | pkelly | 2008-08-04 08:21:11 -0400 (Mon, 04 Aug 2008) | 4 lines

Move iostream library to lib/iostream and includes to include/iostream,
and update r.terraflow to use it - in preparation for introducing
r.viewshed.

The test in question has a single small run of 38343 items. Memory can
accommodate a single run up to 13027966 items, in makeRun_Block, the
code tries to read 13+million items from a stream that only has
38+thousand items.

prior to r32509, there was a calculation that computed the current run
size and made sure you did not try to read more than was available.

#4  0x0808a72c in makeRun_Block<plateauType, ijCmpPlateauType> (
     instream=0x83d32a0, data=0xb7856014, run_size=13027966, cmp=0xbfa269b4)
     at
/home/mlennert/SRC/GRASS/grass6_devel/dist.i486-pc-linux-gnu/include/grass/iostream/ami_sort_impl.h:91
        err = AMI_ERROR_NO_ERROR
        new_run_size = 164681931030529
...

#5  0x0808b106 in runFormation<plateauType, ijCmpPlateauType> (
     instream=0x83d32a0, cmp=0xbfa269b4)
     at
/home/mlennert/SRC/GRASS/grass6_devel/dist.i486-pc-linux-gnu/include/grass/iostream/ami_sort_impl.h:213
        run_size = 13027966
        last_run_size = 38343
        crt_run_size = 38343
        nb_runs = 1

GRASS GIS wrote:

> #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
> address
> -----------------------+----------------------------------------------------
>   Reporter:  mlennert  |       Owner:  [hidden email]
>       Type:  defect    |      Status:  new                      
>   Priority:  normal    |   Milestone:  6.4.0                    
>  Component:  Raster    |     Version:  svn-develbranch6        
> Resolution:            |    Keywords:  terraflow bad address    
>   Platform:  Linux     |         Cpu:  Unspecified              
> -----------------------+----------------------------------------------------
> Comment (by mlennert):
>
>  Replying to [comment:1 glynn]:
>  > Beyond that, I can only suggest running it under gdb and printing a full
>  backtrace ("bt full") when it aborts.
>
>  Done.
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> grass-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/grass-dev

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  svn-develbranch6        
Resolution:            |    Keywords:  terraflow bad address    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by mlennert):

 Replying to [comment:1 glynn]:
 > Replying to [ticket:775 mlennert]:
 >
 > > In all three version (6.4, 6devel and 7), I get the following error
 running r.terraflow in the North Carolina demo data set:
 >
 > > file=/home/mlennert/STREAM/STREAM_lRe0NI:cannot read!: Bad address
 >
 > The error message corresponds to fread() failing with EFAULT (invalid
 buffer pointer) in either AMI_STREAM<T>::read_item() or
 AMI_STREAM<T>::read_array(). I would suspect the latter, as the former
 reads into the read_tmp member of the AMI_STREAM<T> object
 >
 > The assert() failure:
 > >
 > {{{
 > r.terraflow: /home/mlennert/SRC/GRASS/grass6_devel/dist.i486-pc-linux-
 gnu/include/grass/iostream/ami_sort_impl.h:91: size_t
 makeRun_Block(AMI_STREAM<T>*, T*, unsigned int, Compare*) [with T =
 plateauType, Compare = ijCmpPlateauType]: Assertion `err ==
 AMI_ERROR_NO_ERROR || err == AMI_ERROR_END_OF_STREAM' failed.
 > }}}
 >
 > also suggests the read_array() method, and indicates that a bogus
 pointer is passed as the "data" parameter to makeRun_Block().
 >
 > Beyond that, I can only suggest running it under gdb and printing a full
 backtrace ("bt full") when it aborts.


 Any ideas based on the backtrace ?

 Moritz

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

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  svn-develbranch6        
Resolution:            |    Keywords:  terraflow bad address    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by glynn):

 Replying to [comment:3 mlennert]:

 > Any ideas based on the backtrace ?

 The backtrace doesn't entirely make sense, e.g. frame !#4 has:
 {{{
         err = AMI_ERROR_NO_ERROR
 }}}
 so the assert() shouldn't be triggering. But that may just be an artifact
 of optimisation. Can you reproduce this if libiostream and r.terraflow are
 built without optimisation?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:4>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  svn-develbranch6        
Resolution:            |    Keywords:  terraflow bad address    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by mlennert):

 Replying to [comment:4 glynn]:
 > Replying to [comment:3 mlennert]:
 >
 > > Any ideas based on the backtrace ?
 >
 > The backtrace doesn't entirely make sense, e.g. frame !#4 has:
 > {{{
 >         err = AMI_ERROR_NO_ERROR
 > }}}
 > so the assert() shouldn't be triggering. But that may just be an
 artifact of optimisation. Can you reproduce this if libiostream and
 r.terraflow are built without optimisation?


 Now I get err = AMI_ERROR_IO_ERROR.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:5>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  svn-develbranch6        
Resolution:            |    Keywords:  terraflow bad address    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by glynn):

 Replying to [comment:5 mlennert]:

 > > so the assert() shouldn't be triggering. But that may just be an
 artifact of optimisation. Can you reproduce this if libiostream and
 r.terraflow are built without optimisation?
 >
 > Now I get err = AMI_ERROR_IO_ERROR.

 Well, the immediate issue is that fread() is returning a short count but
 not setting the end-of-file indicator.

 The short count is to be expected: it's trying to read run_size = 13027967
 items although it only expects there to be last_run_size = 38343 items in
 the file (and has only allocated enough memory for that many).

 Given the "Bad address" from perror(), my suspicion is that fread() is
 complaining that &data[len] isn't valid (i.e. the buffer isn't large
 enough to hold the requested number of items), rather than simply trying
 to read them and seeing if it hits EOF before it segfaults.

 I suggest changing runFormation() to only try to read as many items as it
 has space for, i.e. replace the existing code with the commented-out
 version in:

 {{{
   //for (size_t i=0; i< nb_runs; i++) {
   while(!instream->eof()) {
     //crt_run_size = (i == nb_runs-1) ? last_run_size: run_size;

     //SDEBUG cout << "i=" << i << ":  runsize=" << crt_run_size << ", ";

     crt_run_size = makeRun_Block(instream, data, run_size, cmp);
 /* #ifdef BLOCKED_RUN */
 /*     makeRun(instream, data, crt_run_size, cmp); */
 /* #else         */
 /*     makeRun_Block(instream, data, crt_run_size, cmp); */
 /* #endif */
 }}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:6>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  svn-develbranch6        
Resolution:            |    Keywords:  terraflow bad address    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by mlennert):

 Replying to [comment:6 glynn]:
 > I suggest changing runFormation() to only try to read as many items as
 it has space for, i.e. replace the existing code with the commented-out
 version in:
 >
 > {{{
 >   //for (size_t i=0; i< nb_runs; i++) {
 >   while(!instream->eof()) {
 >     //crt_run_size = (i == nb_runs-1) ? last_run_size: run_size;
 >
 >     //SDEBUG cout << "i=" << i << ":  runsize=" << crt_run_size << ", ";
 >
 >     crt_run_size = makeRun_Block(instream, data, run_size, cmp);
 > /* #ifdef BLOCKED_RUN */
 > /*     makeRun(instream, data, crt_run_size, cmp); */
 > /* #else         */
 > /*     makeRun_Block(instream, data, crt_run_size, cmp); */
 > /* #endif */
 > }}}

 Is this what you meant ?:


 {{{
 --- SRC/GRASS/grass_trunk/include/iostream/ami_sort_impl.h      2008-08-13
 21:36:15.000000000 +0200
 +++ SRC/GRASS/grass_trunk/dist.i486-pc-linux-
 gnu/include/grass/iostream/ami_sort_impl.h 2009-10-13 17:00:30.000000000
 +0200
 @@ -221,13 +221,13 @@
    }
    SDEBUG MM_manager.print();

 -  //for (size_t i=0; i< nb_runs; i++) {
 -  while(!instream->eof()) {
 -    //crt_run_size = (i == nb_runs-1) ? last_run_size: run_size;
 +  for (size_t i=0; i< nb_runs; i++) {
 +  //while(!instream->eof()) {
 +    crt_run_size = (i == nb_runs-1) ? last_run_size: run_size;

 -    //SDEBUG cout << "i=" << i << ":  runsize=" << crt_run_size << ", ";
 +    SDEBUG cout << "i=" << i << ":  runsize=" << crt_run_size << ", ";

 -    crt_run_size = makeRun_Block(instream, data, run_size, cmp);
 +    //crt_run_size = makeRun_Block(instream, data, run_size, cmp);
  /* #ifdef BLOCKED_RUN */
  /*     makeRun(instream, data, crt_run_size, cmp); */
  /* #else         */
 }}}


 Now I get:


 {{{
 GRASS 7.0.svn (nc_spm_06):~ > r.terraflow elevation=elevation@PERMANENT
 filled=fill direction=flow swatershed=waters accumulation=accum tci=tci
 STREAM temporary files in /var/tmp/  (THESE INTERMEDIATE STREAMS WILL NOT
 BE DELETED IN CASE OF ABNORMAL TERMINATION OF THE PROGRAM. TO SAVE SPACE
 PLEASE DELETE THESE FILES MANUALLY!)
 file stats.out exists - renaming.
 MFD flow direction
 D8CUT=999999986991104.000000
 Memory size: 300.00M (314572800) bytes
 Memory manager registering memory in MM_IGNORE_MEMORY_EXCEEDED mode.
 total elements=2025000, nodata elements=0
 largest temporary files:
 FILL: 108.15M (113400000) [2025000 elements, 56B each]
 FLOW: 154.50M (162000000) [2025000 elements, 80B each]
 Will need at least 308.99M (324000000) space available in /var/tmp/
 ------------------------------
 COMPUTING FLOW DIRECTIONS
 classifying nodata (inner & boundary)
 assigning preliminary directions
 finding flat areas (plateaus and depressions)
 EMPQUEUEADAPTIVE: starting in-memory pqueue
 EMPQUEUEADAPTIVE: available memory: 297.413MB
 EMPQUEUEADAPTIVE: desired memory: 297.413MB
 sz_stream: 270388 buf_arity: 200 mm_overhead: 8665728 mm_avail: 311859944.
 EMPQUEUEADAPTIVE: memory overhead set to 8.26428MB
 EMPQUEUEADAPTIVE: pqsize set to 37899277
 r.terraflow: plateau.cc:364: void detectPlateaus::relabelPlateaus():
 Assertion `root >= LABEL_START' failed.
 Aborted
 }}}

 backtrace of that attached. I again see

 {{{
 ae = AMI_ERROR_NO_ERROR
 }}}

 even though everything is compiled with -g -O0.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:7>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  svn-develbranch6        
Resolution:            |    Keywords:  terraflow bad address    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by glynn):

 Replying to [comment:7 mlennert]:
 > Is this what you meant ?:
 You also need to uncomment at least one of the makeRun/makeRun_Block
 calls, otherwise it isn't actually reading anything. Or just leave the
 existing makeRun_Block call uncommented.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:8>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  svn-develbranch6        
Resolution:            |    Keywords:  terraflow bad address    
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Comment (by mlennert):

 Replying to [comment:8 glynn]:
 > Replying to [comment:7 mlennert]:
 > > Is this what you meant ?:
 > You also need to uncomment at least one of the makeRun/makeRun_Block
 calls, otherwise it isn't actually reading anything. Or just leave the
 existing makeRun_Block call uncommented.

 The latter didn't work (same error message as initially, but the former
 seems to do the trick (diff attached).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:9>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  new                      
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  6.4.0 RCs                
Resolution:            |    Keywords:  terraflow aborted        
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Changes (by fram):

  * keywords:  terraflow bad address => terraflow aborted
  * version:  svn-develbranch6 => 6.4.0 RCs

Comment:

 I tried to apply the patch of r.terraflow (r.terraflow.diff).  I do not
 know if I did it fine, what I did was to change the original
 "include/iostream/ami_sort_impl.h" file with the modifications in the
 .diff file. If this was fine, below is the output of r.terraflow which to
 me seems to give a different error as before.

 ===============================================================
 GRASS 6.4.0RC5 (WGS84_UTM33):~ > r.terraflow elevation=dem_tagliato
 filled=flood direction=flow swatershed=sink accumulation=accumulation
 tci=tci d8cut=infinity memory=1600 STREAM_DIR=/tmp stats=stats.out
 STREAM temporary files in /tmp  (THESE INTERMEDIATE STREAMS WILL NOT BE
 DELETED IN CASE OF ABNORMAL TERMINATION OF THE PROGRAM. TO SAVE SPACE
 PLEASE DELETE THESE FILES MANUALLY!)
 MFD flow direction
 D8CUT=999999986991104.000000
 Memory size: 1.56G (1677721600) bytes
 Memory manager registering memory in MM_IGNORE_MEMORY_EXCEEDED mode.
 total elements=67071935, nodata elements=61864898
 largest temporary files:
 FILL: 3.50G (3756028360) [67071935 elements, 56B each]
 FLOW: 397.27M (416562960) [5207037 elements, 80B each]
 Will need at least 7.00G (7512056720) space available in /tmp
 ------------------------------
 COMPUTING FLOW DIRECTIONS
 classifying nodata (inner & boundary)
 EMPQUEUEADAPTIVE: starting in-memory pqueue
 EMPQUEUEADAPTIVE: available memory: 1597.93MB
 EMPQUEUEADAPTIVE: desired memory: 1597.93MB
 sz_stream: 270388 buf_arity: 200 mm_overhead: 8665728 mm_avail:
 1675549602.
 EMPQUEUEADAPTIVE: memory overhead set to 8.26428MB
 EMPQUEUEADAPTIVE: pqsize set to 208360484
 assigning preliminary directions
 finding flat areas (plateaus and depressions)
 EMPQUEUEADAPTIVE: starting in-memory pqueue
 EMPQUEUEADAPTIVE: available memory: 1597.41MB
 EMPQUEUEADAPTIVE: desired memory: 1597.41MB
 sz_stream: 270388 buf_arity: 200 mm_overhead: 8665728 mm_avail:
 1675008754.
 EMPQUEUEADAPTIVE: memory overhead set to 8.26428MB
 EMPQUEUEADAPTIVE: pqsize set to 208292878
 assigning directions on plateaus
 generating watersheds and watershed graph
 AMI_STREAM::write_item failed.
 /tmp/STREAM_HHSoQw: File too large
 r.terraflow: /usr/local/svn/grass/grass640_rc5/dist.i686-pc-linux-
 gnu/include/grass/iostream/ami_stream.h:560: AMI_err
 AMI_STREAM<T>::write_item(const T&) [with T = compressedWaterWindowType]:
 Assertion `0' failed.
 Abortito
 GRASS 6.4.0RC5 (WGS84_UTM33):~ >
 ===============================================================

 Francesco

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:10>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS

Re: [GRASS GIS] #775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad address

Reply Threaded More More options
Print post
Permalink
In reply to this post by GRASS GIS
#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  [hidden email]
      Type:  defect    |      Status:  closed                  
  Priority:  normal    |   Milestone:  6.4.0                    
 Component:  Raster    |     Version:  6.4.0 RCs                
Resolution:  fixed     |    Keywords:  terraflow aborted        
  Platform:  Linux     |         Cpu:  Unspecified              
-----------------------+----------------------------------------------------
Changes (by neteler):

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

Comment:

 Replying to [comment:10 fram]:
 > I tried to apply the patch of r.terraflow (r.terraflow.diff).  I do not
 know if I did it fine, what I did was to change the original
 "include/iostream/ami_sort_impl.h" file with the modifications in the
 .diff file. If this was fine, below is the output of r.terraflow which to
 me seems to give a different error as before.

 For the record: the user didn't compile with LFS support. Done that, the
 patch works.

 Fixed in 6.4 (r39700), 6.5 (r39701), 7 (r39702). Closing.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/775#comment:11>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev