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

GRASS GIS trac at osgeo.org
Thu Oct 15 08:03:54 EDT 2009


#775: r.terraflow: file=/home/mlennert/STREAM/STREAM_tQhXkQ:cannot read!: Bad
address
-----------------------+----------------------------------------------------
  Reporter:  mlennert  |       Owner:  grass-dev at lists.osgeo.org
      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 at 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>


More information about the grass-dev mailing list