Opened 10 years ago

Closed 9 years ago

#617 closed defect (fixed)

r.sim.water crashes on WinGrass

Reported by: hamish Owned by: grass-dev@…
Priority: normal Milestone: 6.4.0
Component: Raster Version: 6.4.0 RCs
Keywords: wingrass, r.sim.water Cc:
CPU: x86-32 Platform: MSWindows XP

Description

As reported on grass-user by Bernd Tyrna: (I can reproduce it on wingrass using the spearfish.sh test script in the source dir; on linux it is fine)

Hello!

Has anyone experience with using r.sim.water under Windows? I'm planning to
use it for the simulation of flash flood events.
I tried it with a DEM (1m resolution) with the following region setting:

g.region -p

rojection: 99 (Transverse Mercator)
zone:       0
datum:      potsdam
ellipsoid:  bessel
north:      5377000.5
south:      5375999.5
west:       3502999.5
east:       3504000.5
nsres:      1
ewres:      1
rows:       1001
cols:       1001
cells:      1002001

I calculated the first order partial derivative dx and dy with
r.slope.aspect
(Do I have to use degrees in the settings?)

Leaving everything else unchanged for a testrun, I get the following message
and r.sim.water crashes:

"r.sim.water.exe hat ein Problem festgestellt und muss beendet werden."
("r.sim.water.exe has detected a problem and has to be closed")

Can anyone tell me what's going wrong? Would it be better to use GRASS under
Linux for this purpose?

Thanks for your help,

Bernd

with "g.gisenv set="DEBUG=3" set I can see that it happens after "Running MAY 10 version," text. Next step in the program after that is to allocate memory...... so I'm guessing it's a malloc problem that is only triggered on windows, much like we saw in r.los in bug #111 (and I expect we'll see a lot more of these).

valgrind running now (slow),

Hamish

Change History (14)

comment:1 Changed 10 years ago by hamish

==17249== ERROR SUMMARY: 100051 errors from 16 contexts (suppressed: 129 from 1)
==17249== malloc/free: in use at exit: 20,153,050 bytes in 5,227 blocks.
==17249== malloc/free: 23,104 allocs, 17,877 frees, 421,163,496 bytes allocated.

...

G65> CMD="r.sim.water --o elevin=${dem} dxin=${dem}_dx dyin=${dem}_dy \
          rain=${dem}_rain manin=${dem}_manin infil=${dem}_infil \
          depth=${dem}_depth disch=${dem}_disch err=${dem}_err"
G65> g.gisenv set=DEBUG=3
G65> valgrind --tool=memcheck --leak-check=yes --show-reachable=yes  $CMD
==17249== Memcheck, a memory error detector.
==17249== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==17249== Using LibVEX rev 1658, a library for dynamic binary translation.
==17249== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==17249== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation framework.
==17249== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==17249== For more details, rerun with: -v
==17249== 
==17249== Warning: set address range perms: large range 308011008 (defined)
==17249== Warning: set address range perms: large range 308051968 (defined)
==17249== Warning: set address range perms: large range 308002816 (defined)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj:       1
D3/3: region item: zone:       13
D3/3: region item: north:      4928000
D3/3: region item: south:      4914020
D3/3: region item: east:       609000
D3/3: region item: west:       590010
D3/3: region item: cols:       633
D3/3: region item: rows:       466
D3/3: region item: e-w resol:  30
D3/3: region item: n-s resol:  30
D3/3: region item: top:        1
D3/3: region item: bottom:     0
D3/3: region item: cols3:      633
D3/3: region item: rows3:      466
D3/3: region item: depths:     1
D3/3: region item: e-w resol3: 30
D3/3: region item: n-s resol3: 30
D3/3: region item: t-b resol:  1
D3/3: rain_val is set to: -999.990000

D3/3: manin_val is set to: -999.990000

D3/3: infil_val is set to: -999.990000

default nwalk=589956, rwalk=589956.000000
D3/3: Running MAY 10 version, started modifications on 20080211
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj:       1
D3/3: region item: zone:       13
D3/3: region item: north:      4928000
D3/3: region item: south:      4914020
D3/3: region item: east:       609000
D3/3: region item: west:       590010
D3/3: region item: cols:       633
D3/3: region item: rows:       466
D3/3: region item: e-w resol:  30
D3/3: region item: n-s resol:  30
D3/3: region item: format:     1
D3/3: region item: compressed: 1
D3/3: create window mapping (633 columns)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj:       1
D3/3: region item: zone:       13
D3/3: region item: north:      4928000
D3/3: region item: south:      4914020
D3/3: region item: east:       609000
D3/3: region item: west:       590010
D3/3: region item: cols:       633
D3/3: region item: rows:       466
D3/3: region item: e-w resol:  30
D3/3: region item: n-s resol:  30
D3/3: region item: format:     -1
D3/3: region item: compressed: 1
D3/3: create window mapping (633 columns)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj:       1
D3/3: region item: zone:       13
D3/3: region item: north:      4928000
D3/3: region item: south:      4914020
D3/3: region item: east:       609000
D3/3: region item: west:       590010
D3/3: region item: cols:       633
D3/3: region item: rows:       466
D3/3: region item: e-w resol:  30
D3/3: region item: n-s resol:  30
D3/3: region item: format:     -1
D3/3: region item: compressed: 1
D3/3: create window mapping (633 columns)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj:       1
D3/3: region item: zone:       13
D3/3: region item: north:      4928000
D3/3: region item: south:      4914020
D3/3: region item: east:       609000
D3/3: region item: west:       590010
D3/3: region item: cols:       633
D3/3: region item: rows:       466
D3/3: region item: e-w resol:  30
D3/3: region item: n-s resol:  30
D3/3: region item: format:     -1
D3/3: region item: compressed: 1
D3/3: create window mapping (633 columns)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj:       1
D3/3: region item: zone:       13
D3/3: region item: north:      4928000
D3/3: region item: south:      4914020
D3/3: region item: east:       609000
D3/3: region item: west:       590010
D3/3: region item: cols:       633
D3/3: region item: rows:       466
D3/3: region item: e-w resol:  30
D3/3: region item: n-s resol:  30
D3/3: region item: format:     0
D3/3: region item: compressed: 1
D3/3: create window mapping (633 columns)
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj:       1
D3/3: region item: zone:       13
D3/3: region item: north:      4928000
D3/3: region item: south:      4914020
D3/3: region item: east:       609000
D3/3: region item: west:       590010
D3/3: region item: cols:       633
D3/3: region item: rows:       466
D3/3: region item: e-w resol:  30
D3/3: region item: n-s resol:  30
D3/3: region item: format:     -1
D3/3: region item: compressed: 1
D3/3: create window mapping (633 columns)
D0/3: beginning memory allocation for output grids
D0/3: after gama
D0/3: after gammaS
D0/3: seeding randoms

Min elevation = 1066.00 m
Max elevation = 1840.00 m
Mean Source Rate (rainf. excess or sediment) = 0.000001 m/s or kg/m2s
Mean flow velocity = 8.428620 m/s
Mean Mannings = 0.050837
Number of iterations = 168 cells
Time step = 0.89 s
D2/3:  maxwa, nblock 589956 1
D2/3:  barea,sarea,rwalk,sisum: 900.000000 0.000000 589956.000000 0.290123
D2/3:  number of written walkers: 0
D2/3:  nwalk, maxw 870369 7000000
D2/3:  walkwe (walk weight),frac 589956.000000 0.800000
D2/3:  deldif,factor 0.754644 4.375899e-07
D2/3: main loop over the projection time... 
D2/3: iblock=1 i=33 miter=168 nwalk=870369 nwalka=856968
D2/3: iblock=1 i=66 miter=168 nwalk=870369 nwalka=849676
D2/3: iblock=1 i=99 miter=168 nwalk=870369 nwalka=844371
D2/3: iblock=1 i=132 miter=168 nwalk=870369 nwalka=839828
D2/3: iblock=1 i=165 miter=168 nwalk=870369 nwalka=836022
 100%
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0B34: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0B4C: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0B64: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0AB0: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0ACC: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0AE8: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0B04: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0B1C: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0A67: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0A71: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x40A0A87: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A17C7: (within /usr/lib/libz.so.1.2.3)
==17249==    by 0x40A1F3F: deflate (in /usr/lib/libz.so.1.2.3)
==17249==    by 0x403F615: G_zlib_compress (flate.c:339)
==17249==    by 0x403F2E1: G_zlib_write (flate.c:213)
==17249==    by 0x405AA3F: G__write_data_compressed (put_row.c:337)
==17249==    by 0x405AED4: put_fp_data (put_row.c:468)
==17249==    by 0x405B67B: put_raster_data (put_row.c:695)
==17249==    by 0x405BE69: put_raster_row (put_row.c:909)
==17249==    by 0x405A6C3: G_put_raster_row (put_row.c:225)
==17249==    by 0x405A723: G_put_f_raster_row (put_row.c:235)
==17249==    by 0x1AE12469: output_data (output.c:197)
D1/3: close elevation.dem_depth compressed
==17249== 
==17249== Invalid read of size 4
==17249==    at 0x4010DE9: (within /lib/ld-2.3.6.so)
==17249==    by 0x4004B78: (within /lib/ld-2.3.6.so)
==17249==    by 0x4006792: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F946F: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F8EDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47FB6FC: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47FB75D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D57CF: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D58BF: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D74E5: __nss_passwd_lookup (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==  Address 0x6F6C624 is 36 bytes inside a block of size 38 alloc'd
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x4006B83: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F946F: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F8EDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47FB6FC: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47FB75D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D57CF: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D58BF: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D74E5: __nss_passwd_lookup (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785B6E: getpwuid_r (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x4008ED5: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F98C4: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F8EDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47FB6FC: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47FB75D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D57CF: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D58BF: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D74E5: __nss_passwd_lookup (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785B6E: getpwuid_r (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785499: getpwuid (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249== 
==17249== Conditional jump or move depends on uninitialised value(s)
==17249==    at 0x4008B2E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F98C4: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F8EDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47FB6FC: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47FB75D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D57CF: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D58BF: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D74E5: __nss_passwd_lookup (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785B6E: getpwuid_r (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785499: getpwuid (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249== 
==17249== Invalid read of size 4
==17249==    at 0x4010DD3: (within /lib/ld-2.3.6.so)
==17249==    by 0x4004B78: (within /lib/ld-2.3.6.so)
==17249==    by 0x4006792: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F946F: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F8EDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47FB6FC: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47FB75D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D57CF: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x7EE0169: (within /lib/tls/i686/cmov/libnss_compat-2.3.6.so)
==17249==    by 0x7EE128C: _nss_compat_getpwuid_r (in /lib/tls/i686/cmov/libnss_compat-2.3.6.so)
==17249==  Address 0x72497D8 is 32 bytes inside a block of size 35 alloc'd
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x4006B83: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F946F: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F8EDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47FB6FC: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47FB75D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D57CF: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x7EE0169: (within /lib/tls/i686/cmov/libnss_compat-2.3.6.so)
==17249==    by 0x7EE128C: _nss_compat_getpwuid_r (in /lib/tls/i686/cmov/libnss_compat-2.3.6.so)
==17249==    by 0x4785A94: getpwuid_r (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249== 
==17249== Invalid read of size 4
==17249==    at 0x4010DE9: (within /lib/ld-2.3.6.so)
==17249==    by 0x4004B78: (within /lib/ld-2.3.6.so)
==17249==    by 0x4006792: (within /lib/ld-2.3.6.so)
==17249==    by 0x400A1F6: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x400A3CA: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F94D4: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F8EDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47FB6FC: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47FB75D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==  Address 0x7338C84 is 36 bytes inside a block of size 37 alloc'd
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x4006B83: (within /lib/ld-2.3.6.so)
==17249==    by 0x400A1F6: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x400A3CA: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F94D4: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47F8EDE: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47FB6FC: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x400B44E: (within /lib/ld-2.3.6.so)
==17249==    by 0x47FB75D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D57CF: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
D1/3: close elevation.dem_disch compressed
D1/3: close elevation.dem_err compressed
D3/3: G_recreate_command()
D3/3: G_recreate_command()
==17249== 
==17249== ERROR SUMMARY: 100051 errors from 16 contexts (suppressed: 129 from 1)
==17249== malloc/free: in use at exit: 20,153,050 bytes in 5,227 blocks.
==17249== malloc/free: 23,104 allocs, 17,877 frees, 421,163,496 bytes allocated.
==17249== For counts of detected errors, rerun with: -v
==17249== searching for pointers to 5,227 not-freed blocks.
==17249== checked 638,301,564 bytes.
==17249== 
==17249== 
==17249== 1 bytes in 1 blocks are still reachable in loss record 1 of 22
==17249==    at 0x401DB31: operator new(unsigned) (vg_replace_malloc.c:163)
==17249==    by 0x579926F: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x57E8F04: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x575E938: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x400B7F4: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B920: (within /lib/ld-2.3.6.so)
==17249==    by 0x40007EE: (within /lib/ld-2.3.6.so)
==17249== 
==17249== 
==17249== 1 bytes in 1 blocks are still reachable in loss record 2 of 22
==17249==    at 0x401DB31: operator new(unsigned) (vg_replace_malloc.c:163)
==17249==    by 0x57B91DF: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x57E8F04: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x575E938: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x400B7F4: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B920: (within /lib/ld-2.3.6.so)
==17249==    by 0x40007EE: (within /lib/ld-2.3.6.so)
==17249== 
==17249== 
==17249== 8 bytes in 1 blocks are still reachable in loss record 3 of 22
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x47D55CD: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x7EE01E1: ???
==17249==    by 0x7EE128C: ???
==17249==    by 0x4785A94: getpwuid_r (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785499: getpwuid (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4069C40: G_whoami (whoami.c:70)
==17249==    by 0x4047B78: G_short_history (history.c:207)
==17249==    by 0x403448C: close_new (closecell.c:311)
==17249==    by 0x4033BD7: G_close_cell (closecell.c:81)
==17249==    by 0x1AE12B12: output_data (output.c:271)
==17249==    by 0x804A959: main (main.c:525)
==17249== 
==17249== 
==17249== 8 bytes in 1 blocks are still reachable in loss record 4 of 22
==17249==    at 0x401DB31: operator new(unsigned) (vg_replace_malloc.c:163)
==17249==    by 0x57CDC5D: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x57E8F04: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x575E938: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x400B7F4: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B920: (within /lib/ld-2.3.6.so)
==17249==    by 0x40007EE: (within /lib/ld-2.3.6.so)
==17249== 
==17249== 
==17249== 16 bytes in 1 blocks are possibly lost in loss record 5 of 22
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x47C284B: tsearch (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D558E: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x7EE01E1: ???
==17249==    by 0x7EE128C: ???
==17249==    by 0x4785A94: getpwuid_r (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785499: getpwuid (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4069C40: G_whoami (whoami.c:70)
==17249==    by 0x4047B78: G_short_history (history.c:207)
==17249==    by 0x403448C: close_new (closecell.c:311)
==17249==    by 0x4033BD7: G_close_cell (closecell.c:81)
==17249==    by 0x1AE12B12: output_data (output.c:271)
==17249== 
==17249== 
==17249== 16 bytes in 1 blocks are still reachable in loss record 6 of 22
==17249==    at 0x401DB31: operator new(unsigned) (vg_replace_malloc.c:163)
==17249==    by 0x5770523: geos::GeometryFactory::GeometryFactory() (in /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x576B25A: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x57E8F04: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x575E938: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x400B7F4: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B920: (within /lib/ld-2.3.6.so)
==17249==    by 0x40007EE: (within /lib/ld-2.3.6.so)
==17249== 
==17249== 
==17249== 16 bytes in 1 blocks are still reachable in loss record 7 of 22
==17249==    at 0x401DB31: operator new(unsigned) (vg_replace_malloc.c:163)
==17249==    by 0x576B250: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x57E8F04: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x575E938: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x400B7F4: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B920: (within /lib/ld-2.3.6.so)
==17249==    by 0x40007EE: (within /lib/ld-2.3.6.so)
==17249== 
==17249== 
==17249== 24 bytes in 1 blocks are still reachable in loss record 8 of 22
==17249==    at 0x401DB31: operator new(unsigned) (vg_replace_malloc.c:163)
==17249==    by 0x57E7DEF: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x57E8F04: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x575E938: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x400B7F4: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B920: (within /lib/ld-2.3.6.so)
==17249==    by 0x40007EE: (within /lib/ld-2.3.6.so)
==17249== 
==17249== 
==17249== 28 bytes in 1 blocks are still reachable in loss record 9 of 22
==17249==    at 0x401DB31: operator new(unsigned) (vg_replace_malloc.c:163)
==17249==    by 0x57A701F: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x57E8F04: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x575E938: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x400B7F4: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B920: (within /lib/ld-2.3.6.so)
==17249==    by 0x40007EE: (within /lib/ld-2.3.6.so)
==17249== 
==17249== 
==17249== 32 bytes in 4 blocks are indirectly lost in loss record 10 of 22
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x47D55CD: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x7EE0187: ???
==17249==    by 0x7EE128C: ???
==17249==    by 0x4785A94: getpwuid_r (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785499: getpwuid (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4069C40: G_whoami (whoami.c:70)
==17249==    by 0x4047B78: G_short_history (history.c:207)
==17249==    by 0x403448C: close_new (closecell.c:311)
==17249==    by 0x4033BD7: G_close_cell (closecell.c:81)
==17249==    by 0x1AE12B12: output_data (output.c:271)
==17249==    by 0x804A959: main (main.c:525)
==17249== 
==17249== 
==17249== 64 bytes in 4 blocks are indirectly lost in loss record 11 of 22
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x47C284B: tsearch (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D558E: __nss_lookup_function (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x7EE01C3: ???
==17249==    by 0x7EE128C: ???
==17249==    by 0x4785A94: getpwuid_r (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785499: getpwuid (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4069C40: G_whoami (whoami.c:70)
==17249==    by 0x4047B78: G_short_history (history.c:207)
==17249==    by 0x403448C: close_new (closecell.c:311)
==17249==    by 0x4033BD7: G_close_cell (closecell.c:81)
==17249==    by 0x1AE12B12: output_data (output.c:271)
==17249== 
==17249== 
==17249== 132 (36 direct, 96 indirect) bytes in 1 blocks are definitely lost in loss record 12 of 22
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x47D5A09: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x47D60F6: __nss_database_lookup (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x7EE0149: ???
==17249==    by 0x7EE128C: ???
==17249==    by 0x4785A94: getpwuid_r (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4785499: getpwuid (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17249==    by 0x4069C40: G_whoami (whoami.c:70)
==17249==    by 0x4047B78: G_short_history (history.c:207)
==17249==    by 0x403448C: close_new (closecell.c:311)
==17249==    by 0x4033BD7: G_close_cell (closecell.c:81)
==17249==    by 0x1AE12B12: output_data (output.c:271)
==17249== 
==17249== 
==17249== 256 bytes in 1 blocks are still reachable in loss record 13 of 22
==17249==    at 0x401DB31: operator new(unsigned) (vg_replace_malloc.c:163)
==17249==    by 0x57B91F3: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x57E8F04: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x575E938: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x400B7F4: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B920: (within /lib/ld-2.3.6.so)
==17249==    by 0x40007EE: (within /lib/ld-2.3.6.so)
==17249== 
==17249== 
==17249== 256 bytes in 1 blocks are still reachable in loss record 14 of 22
==17249==    at 0x401DB31: operator new(unsigned) (vg_replace_malloc.c:163)
==17249==    by 0x57CDC3F: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x57E8F04: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x575E938: (within /usr/lib/libgeos.so.2.2.3)
==17249==    by 0x400B7F4: (within /lib/ld-2.3.6.so)
==17249==    by 0x400B920: (within /lib/ld-2.3.6.so)
==17249==    by 0x40007EE: (within /lib/ld-2.3.6.so)
==17249== 
==17249== 
==17249== 1,200 bytes in 1 blocks are possibly lost in loss record 15 of 22
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x402EB8D: G__malloc (alloc.c:41)
==17249==    by 0x405CC4B: quant_table_increase (quant.c:582)
==17249==    by 0x405CE52: G_quant_add_rule (quant.c:661)
==17249==    by 0x405E313: G_quantize_fp_map_range (quant_rw.c:166)
==17249==    by 0x1AE12EFF: output_data (output.c:320)
==17249==    by 0x804A959: main (main.c:525)
==17249== 
==17249== 
==17249== 3,925 bytes in 409 blocks are definitely lost in loss record 16 of 22
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x402EB8D: G__malloc (alloc.c:41)
==17249==    by 0x40650B8: G_store (store.c:36)
==17249==    by 0x403EEAB: find_file (find_file.c:101)
==17249==    by 0x403EF4B: find_file1 (find_file.c:126)
==17249==    by 0x403EFD9: G_find_file_misc (find_file.c:167)
==17249==    by 0x40454E3: open_null_read (get_row.c:995)
==17249==    by 0x4045711: get_null_value_row_nomask (get_row.c:1063)
==17249==    by 0x4045C21: get_null_value_row (get_row.c:1186)
==17249==    by 0x4045CC7: embed_nulls (get_row.c:1204)
==17249==    by 0x4045086: get_map_row_no_reclass (get_row.c:650)
==17249==    by 0x4045140: get_map_row (get_row.c:678)
==17249== 
==17249== 
==17249== 6,628 bytes in 4 blocks are still reachable in loss record 17 of 22
==17249==    at 0x401C6CA: calloc (vg_replace_malloc.c:279)
==17249==    by 0x402EC00: G__calloc (alloc.c:74)
==17249==    by 0x4057090: G_recreate_command (parser.c:2805)
==17249==    by 0x4047C20: G_command_history (history.c:259)
==17249==    by 0x1AE14021: output_data (output.c:552)
==17249==    by 0x804A959: main (main.c:525)
==17249== 
==17249== 
==17249== 8,338 bytes in 4 blocks are still reachable in loss record 18 of 22
==17249==    at 0x401D487: realloc (vg_replace_malloc.c:306)
==17249==    by 0x402EC83: G__realloc (alloc.c:111)
==17249==    by 0x403D108: set_env (env.c:156)
==17249==    by 0x403CEA9: read_env (env.c:104)
==17249==    by 0x403D6F0: G__getenv (env.c:317)
==17249==    by 0x403D627: G_getenv (env.c:271)
==17249==    by 0x404B0E4: G_location (location.c:63)
==17249==    by 0x404B109: G__location_path (location.c:78)
==17249==    by 0x404B07E: G_location_path (location.c:41)
==17249==    by 0x40467C4: G__gisinit (gisinit.c:58)
==17249==    by 0x8049A6C: main (main.c:115)
==17249== 
==17249== 
==17249== 11,776 bytes in 1 blocks are still reachable in loss record 19 of 22
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x402EC6C: G__realloc (alloc.c:109)
==17249==    by 0x404E644: new_fileinfo (opencell.c:42)
==17249==    by 0x404EAEE: G__open_cell_old (opencell.c:274)
==17249==    by 0x404E704: G_open_cell_old (opencell.c:104)
==17249==    by 0x1AE0F794: input_data (input.c:180)
==17249==    by 0x804A66D: main (main.c:478)
==17249== 
==17249== 
==17249== 13,704 bytes in 5 blocks are definitely lost in loss record 20 of 22
==17249==    at 0x401C6CA: calloc (vg_replace_malloc.c:279)
==17249==    by 0x402EC00: G__calloc (alloc.c:74)
==17249==    by 0x402EE30: G_allocate_f_raster_buf (alloc_cell.c:113)
==17249==    by 0x1AE0F0CB: input_data (input.c:89)
==17249==    by 0x804A66D: main (main.c:478)
==17249== 
==17249== 
==17249== 20,288 bytes in 5 blocks are possibly lost in loss record 21 of 22
==17249==    at 0x401C6CA: calloc (vg_replace_malloc.c:279)
==17249==    by 0x402EC00: G__calloc (alloc.c:74)
==17249==    by 0x402EE72: G_allocate_d_raster_buf (alloc_cell.c:128)
==17249==    by 0x1AE0F0D3: input_data (input.c:90)
==17249==    by 0x804A66D: main (main.c:478)
==17249== 
==17249== 
==17249== 20,086,429 bytes in 4,778 blocks are still reachable in loss record 22 of 22
==17249==    at 0x401D38B: malloc (vg_replace_malloc.c:149)
==17249==    by 0x402EB8D: G__malloc (alloc.c:41)
==17249==    by 0x40650B8: G_store (store.c:36)
==17249==    by 0x4059CD0: G_set_program_name (progrm_nme.c:52)
==17249==    by 0x404677C: G__gisinit (gisinit.c:51)
==17249==    by 0x8049A6C: main (main.c:115)
==17249== 
==17249== LEAK SUMMARY:
==17249==    definitely lost: 17,665 bytes in 415 blocks.
==17249==    indirectly lost: 96 bytes in 8 blocks.
==17249==      possibly lost: 21,504 bytes in 7 blocks.
==17249==    still reachable: 20,113,785 bytes in 4,797 blocks.
==17249==         suppressed: 0 bytes in 0 blocks.

comment:2 Changed 10 years ago by helena

I can only confirm that it crashes on both Windows and Mac but not on linux. It indeed looks like malloc problem - it crashes in input.c after running G_malloc for all rasters it uses. I looked at r.los bug discussion https://trac.osgeo.org/grass/ticket/111, but I could not figure out from it what the fix is. If there is an example in other modules on how this should be handled so that it can run on windows that would help.

143             for (l = 0; l < my; l++) {
144             /*for each my, allocate a second dimension in array
145              * for each input with length of matrix X*/
146             zz[l] = (float *)G_malloc(sizeof(float) * (mx));
147             v1[l] = (double *)G_malloc(sizeof(double) * (mx));
148             v2[l] = (double *)G_malloc(sizeof(double) * (mx));
149
150             if (rain != NULL || rain_val >= 0.0)
151                 si[l] = (double *)G_malloc(sizeof(double) * (mx));
152             ......
168
169             if (wdepth != NULL)
170                 gama[l] = (double *)G_malloc(sizeof(double) * (mx));
171         }
172
173         G_debug(3, "Running MAY 10 version, started modifications on 20080211");
174
175         /* Check if data available in mapsets
176          * if found, then open the files */
177         if ((mapset = G_find_cell(elevin, "")) == NULL)
178             G_fatal_error(_("Raster map <%s> not found"), elevin);

comment:3 Changed 10 years ago by neteler

Helena: please create a debug backtrace on Mac (or ideally on Windows). I guess that a wrong allocation or free function is used which causes problems on Windows.

Markus

comment:4 Changed 10 years ago by helena

I looked at this again and on Mac it crashes with segmentation fault after all allocations are done
when it tries to find the cell file. This is in 6.4. It runs on linux, no problems.
I am wondering whether the port to grass7 (thanks Soeren, it is greatly appreciated)
could have fixed it for Mac and windows. Below is more info,

Helena

GRASS 6.4.0RC5 (nc_spm_08):~ > r.sim.water -t elevin=elev_lid792_2m dxin=dx_2m dyin=dy_2m \
rain=rain50mmhr infil=infil0 manin=man05  depth=wdp_2m disch=disch_2m nwalk=400000 \ 
niter=500 outit=20 hmax=0.2 halpha=8.0 hbeta=1.0
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:      220750
D3/3: region item: south:      220000
D3/3: region item: east:       639000
D3/3: region item: west:       638300
D3/3: region item: cols:       350
D3/3: region item: rows:       375
D3/3: region item: e-w resol:  2
D3/3: region item: n-s resol:  2
D3/3: region item: top:        1
D3/3: region item: bottom:     0
D3/3: region item: cols3:      700
D3/3: region item: rows3:      750
D3/3: region item: depths:     1
D3/3: region item: e-w resol3: 1
D3/3: region item: n-s resol3: 1
D3/3: region item: t-b resol:  1
D3/3: rain_val is set to: -999.990000

D3/3: manin_val is set to: -999.990000

D3/3: infil_val is set to: -999.990000

D3/3: Running MAY 10 version, started modifications on 20080211
Segmentation fault

2ss:         r.sim.water [2918]
Path:            /Applications/GRASS-6.4.app/Contents/MacOS/bin/r.sim.water
Identifier:      r.sim.water
Version:         ??? (???)
Code Type:       X86-64 (Native)
Parent Process:  bash [2854]

Interval Since Last Report:          988538 sec
Crashes Since Last Report:           13
Per-App Interval Since Last Report:  0 sec
Per-App Crashes Since Last Report:   1

Date/Time:       2010-01-26 22:49:18.534 -0500
OS Version:      Mac OS X 10.5.7 (9J61)
Report Version:  6
Anonymous UUID:  B013BEBF-D492-49C8-8BC0-DE006ADDF1AF

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread:  0

Thread 0 Crashed:
0   libgrass_gis.dylib            	0x0000000124b9f70e G__name_is_fully_qualified + 22
1   libgrass_gis.dylib            	0x0000000124b960f3 find_file1 + 88
2   libgrass_sim.dylib            	0x00000001125c5a6b input_data + 1422
3   r.sim.water                   	0x000000010000253f main + 3153
4   r.sim.water                   	0x00000001000018cc start + 52

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000001  rbx: 0x00007fff5fbfe7a0  rcx: 0x0000000000000000  rdx: 0x00007fff5fbfe6a0
  rdi: 0x0000000000000000  rsi: 0x00007fff5fbfe7a0  rbp: 0x00007fff5fbfe670  rsp: 0x00007fff5fbfe670
   r8: 0x00000001125c9a64   r9: 0x0000000000000001  r10: 0x0000000124b87f30  r11: 0x0000000124b95d51
  r12: 0x00007fff5fbfe6a0  r13: 0x0000000000000000  r14: 0x00007fff5fbfe7a0  r15: 0x00000001125c9a64
  rip: 0x0000000124b9f70e  rfl: 0x0000000000010202  cr2: 0x0000000000000000

comment:5 Changed 10 years ago by huhabla

I have hardly tried to find the error using valgrind, but was unsuccessful. Neither the grass6.4 version nor the grass7 version showing any suspicious behavior on 32bit Linux. So i don't know if my changes may have solved the problem, but it would be great, if anybody may compile the latest grass7 version on MacOS or Windows for testing, running the speafish60 example.

Helena can you please provide a simple spearfish example for r.sim.sediment, so i can test my changes with this module?

BTW: Is it possible to add the water depth in every step to the elevation map and additionally computing the direction derivatives dx and dy to avoid infinite water accumulation in sinks and pits? I suggest this will make the solution of the partial differential equation non linear, but maybe the time steps are already small enough to implement this as an explicit step?

Soeren

comment:6 in reply to:  5 Changed 10 years ago by neteler

Replying to huhabla:

Helena can you please provide a simple spearfish example for r.sim.sediment, so i can test my changes with this module?

Examples are here:

http://courses.ncsu.edu/mea582/lec/001/GIS_anal_grass/GIS_Anal_grsimwe.html

Markus

comment:7 Changed 10 years ago by neteler

Here a test for the NC dataset (from the ML):

g.region rural_1m res=2 -p
r.mapcalc "man05 = 0.05"
r.mapcalc "infil0 = 0.0"
r.mapcalc "rain50mmhr = 50"
v.surf.rst -d input=elev_lid792_bepts layer=0 elev=elev_lid792_2m slope=dx_2m \
     aspect=dy_2m ten=15 smooth=1.5 segmax=25 npmin=100
r.sim.water -t elevin=elev_lid792_2m dxin=dx_2m dyin=dy_2m rain=rain50mmhr \
     infil=infil0 manin=man05 depth=wdp_2m disch=disch_2m nwalk=400000 \
     niter=500 outit=20 hmax=0.2 halpha=8.0 hbeta=1.0

comment:8 in reply to:  5 ; Changed 10 years ago by hellik

Replying to huhabla: [...]

So i don't know if my changes may have solved the problem, but it would be great, if anybody may compile the latest grass7 version on MacOS or Windows for testing, running the speafish60 example.

tested with the latest WinGrass7-nightly-build:

C:\Program Files\GRASS-70-SVN>r.sim.water elevin=elevation.10m dx_input=elev_dx dy_input=elev_dy rain_input=rain man_input=manning infil_input=infilt nwalk=500
0000 depth=depth
D2/3: G__read_Cell_head
D2/3: G__read_Cell_head_array
D3/3: region item: proj:       1
D3/3: region item: zone:       13
D3/3: region item: north:      4928000
D3/3: region item: south:      4914020
D3/3: region item: east:       609000
D3/3: region item: west:       590010
D3/3: region item: cols:       1899
D3/3: region item: rows:       1398
D3/3: region item: e-w resol:  10
D3/3: region item: n-s resol:  10
D3/3: region item: top:        1
D3/3: region item: bottom:     0
D3/3: region item: cols3:      1899
D3/3: region item: rows3:      1398
D3/3: region item: depths:     1
D3/3: region item: e-w resol3: 10
D3/3: region item: n-s resol3: 10
D3/3: region item: t-b resol:  1
D3/3: rain_val is set to: -999.990000

D3/3: manin_val is set to: -999.990000

D3/3: infil_val is set to: -999.990000

D3/3: Running JAN 2010 version, started modifications on 20080211

Helmut

comment:9 in reply to:  8 Changed 10 years ago by hellik

Replying to hellik:

tested with the latest WinGrass7-nightly-build:

sorry forgotten to note, also a crash in WinGrass7 with r.sim.water

Helmut

comment:10 in reply to:  7 Changed 9 years ago by hellik

Replying to neteler:

Here a test for the NC dataset (from the ML):

g.region rural_1m res=2 -p
r.mapcalc "man05 = 0.05"
r.mapcalc "infil0 = 0.0"
r.mapcalc "rain50mmhr = 50"
v.surf.rst -d input=elev_lid792_bepts layer=0 elev=elev_lid792_2m slope=dx_2m \
     aspect=dy_2m ten=15 smooth=1.5 segmax=25 npmin=100
r.sim.water -t elevin=elev_lid792_2m dxin=dx_2m dyin=dy_2m rain=rain50mmhr \
     infil=infil0 manin=man05 depth=wdp_2m disch=disch_2m nwalk=400000 \
     niter=500 outit=20 hmax=0.2 halpha=8.0 hbeta=1.0

tested with WinGRASS-6.4.SVN-r42833-1-Setup.exe on a WinVista32, r.sim.water still fails.

r.sim.water -t elevin=elev_lid792_2m dxin=dx_2m dyin=dy_2m rain=rain50mmhr infil=infil0 manin=man05 depth=wdp_2m disch=disch_2m nwalk=400000 niter=500 outit=20 hmax=0.2 halpha=8.0 hbeta=1.0
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:      220750
D3/3: region item: south:      220000
D3/3: region item: east:       639000
D3/3: region item: west:       638300
D3/3: region item: cols:       350
D3/3: region item: rows:       375
D3/3: region item: e-w resol:  2
D3/3: region item: n-s resol:  2
D3/3: region item: top:        1
D3/3: region item: bottom:     0
D3/3: region item: cols3:      700
D3/3: region item: rows3:      750
D3/3: region item: depths:     1
D3/3: region item: e-w resol3: 1
D3/3: region item: n-s resol3: 1
D3/3: region item: t-b resol:  1
D3/3: rain_val is set to: -999.990000
D3/3: manin_val is set to: -999.990000
D3/3: infil_val is set to: -999.990000
D3/3: Running MAY 10 version, started modifications on
20080211

comment:11 Changed 9 years ago by helena

this has been fixed in grass7 and perhaps in grass65 too (I will need to check at home on the Mac). I think the fix should work for windows - it works for me on mac - I think Glynn submitted it.I am not sure it could be ported to 64 - perhaps Glynn has a suggestion? (sorry for the vague response I am away and just guessing)

Helena

comment:12 in reply to:  11 ; Changed 9 years ago by glynn

Replying to helena:

this has been fixed in grass7 and perhaps in grass65 too (I will need to check at home on the Mac). I think the fix should work for windows - it works for me on mac - I think Glynn submitted it.I am not sure it could be ported to 64 - perhaps Glynn has a suggestion? (sorry for the vague response I am away and just guessing)

I think that you're referring to r42402. That hasn't been back-ported to either 6.x branch, although it shouldn't be hard to do so.

comment:13 in reply to:  12 Changed 9 years ago by hellik

Replying to glynn:

Replying to helena:

this has been fixed in grass7 and perhaps in grass65 too (I will need to check at home on the Mac). I think the fix should work for windows - it works for me on mac - I think Glynn submitted it.I am not sure it could be ported to 64 - perhaps Glynn has a suggestion? (sorry for the vague response I am away and just guessing)

I think that you're referring to r42402. That hasn't been back-ported to either 6.x branch, although it shouldn't be hard to do so.

I've tried with a self compiled WinGrass7 (r42884) and the example from the man-page with the spearfish-dataset:

r.sim.water finishes:

r.sim.water --verbose elevation=elevation.10m@PERMANENT dx=elev_dx@g7 dy=elev_dy@g7 rain=rain@g7 infil=infilt@g7 man=manning@g7 depth=depthrm disch=disrm err=simrm nwalk=5000000 niter=10
Min elevation 	= 1061.09 m
Max elevation 	= 1846.74 m
Mean Source Rate (rainf. excess or sediment) 	= 0.000001 m/s or kg/m2s
Mean flow velocity 	= 8.722405 m/s
Mean Mannings 	= 0.050124
Number of iterations 	= 523 cells
Time step 	= 0.29 s
(Fri Jul 23 23:22:12 2010) Command finished (4062 sec)                    

so backporting to the grass6-branches?

best regards Helmut

comment:14 Changed 9 years ago by neteler

Resolution: fixed
Status: newclosed

Fixed in r44518. Helena reported that the modules work now on winGRASS. Closing.

Note: See TracTickets for help on using tickets.