Opened 11 years ago

Last modified 8 years ago

#1903 new defect

r.watershed fails with "Subprocess failed with exit code 6"

Reported by: marcosc Owned by: grass-dev@…
Priority: normal Milestone: 6.4.6
Component: Raster Version: svn-releasebranch64
Keywords: r.watershed, LFS Cc:
CPU: Unspecified Platform: Linux

Description

Some Information about the raster:

rows: 38728 cols: 55611 cells: 2153702808

r.watershed was used with the flags -f and -m.

Using openSuse as Platform.

The error-messages, which are repeated very often:

WARNING: segment_pagein: read EOF
WARNING: seg_put(): could not write segment file
&
WARNING: segment_pagein: read EOF
WARNING: bseg_put(): could not read segment file
&
WARNING: segment_seek: Invalid argument
&
WARNING: Subprocess failed with exit code 6
WARNING: category information for [flow_accumulation] in
[r.watershed]

missing or invalid

WARNING: category information for [drainage_direction] in
[r.watershed]

missing or invalid

WARNING: category information for [basins] in [r.watershed] missing or

invalid

WARNING: category information for [streams] in [r.watershed]
missing or

invalid

Change History (8)

comment:1 by neteler, 11 years ago

Component: DefaultRaster
Keywords: r.watershed added
Version: svn-releasebranch64

You went over the file limit of 32bit (is your installation LFS = large file enabled?)

Your size: 2153702808
     2^31: 2147483648

See also

comment:2 by marcosc, 11 years ago

LFS is enabled, but we are working on a 64-bit platform anyway.

The command:

r.watershed -fm elevation=... accumulation=... drainage=... basin=basins stream=... threshold=10000 memory=25000 --overwrite --verbose

... with:

g.region -p

rows:       38728
cols:       55611
cells:      2153702808

...results in:

ERROR: G_malloc: unable to allocate 596992000 bytes at setup.c:64
WARNING: Subprocess failed with exit code 256
WARNING: category information for [flow_accumulation] in [r.watershed]
         missing or invalid
WARNING: category information for [drainage_direction] in [r.watershed]
         missing or invalid
WARNING: category information for [basins] in [r.watershed] missing or
         invalid
WARNING: category information for [streams] in [r.watershed] missing or
         invalid
Removing raster <MASK>
[H[2JClosing monitors ...
Cleaning up temporary files ...
Done.

The system runs with 32 gb of RAM, so ~600 MB shouldn't be a problem.

We checked the setup.c in /lib/segment/setup.c but could not locate the problem.

in reply to:  2 comment:3 by mmetz, 11 years ago

Replying to marcosc:

LFS is enabled, but we are working on a 64-bit platform anyway.

The command:

 r.watershed -fm elevation=... accumulation=... drainage=... basin=basins stream=... threshold=10000 memory=25000 --overwrite --verbose

... with:

 g.region -p
 
 rows:       38728
 cols:       55611
 cells:      2153702808

The number of cells can cause integer overflow because the largest 32bit integer is 2147483647 < 2153702808. This limit has been removed in GRASS 7.

Markus M

in reply to:  2 comment:4 by neteler, 11 years ago

Replying to marcosc:

LFS is enabled, but we are working on a 64-bit platform anyway.

Please post here the output of

uname -a

comment:5 by marcosc, 11 years ago

uname -a
Linux voss-mod02 2.6.32.59-0.7-xen #1 SMP 2012-07-13 15:50:56 +0200 x86_64 x86_64 x86_64 GNU/Linux

in reply to:  2 comment:6 by glynn, 11 years ago

Replying to marcosc:

LFS is enabled, but we are working on a 64-bit platform anyway.

That doesn't necessarily help. There are lots of places where sizes are stored or calculated using "int", which is still only 32-bit on most 64-bit platforms. Many such issues have been fixed in 7.0, but I wouldn't assume that we have found all of them.

comment:7 by neteler, 11 years ago

Keywords: LFS added

see also ticket #2036

comment:8 by neteler, 8 years ago

Milestone: 6.4.36.4.6
Note: See TracTickets for help on using tickets.