[GRASS-dev] r.series map names buffer overflow

Glynn Clements glynn at gclements.plus.com
Fri Nov 14 07:25:43 EST 2008


Markus Neteler wrote:

> we try to calculate the average of 1460 maps (4 observations per day) from MODIS
> but r.series seems to overflow somewhere:
> 
> YEAR=2002
> LIST=`g.mlist type=rast pat="*_lst1km${YEAR}*"
> mapset="modisLSTinterpolationPAT" sep=","`
> r.series -n $LIST out=lst_${YEAR}_avg method=average --o
> ...
> Reading raster map <terra_lst1km20021215.LST_Night_1km.rst>...
> Reading raster map <terra_lst1km20021216.LST_Day_1km.rst>...
> Reading raster map <terra_lst1km20021216.LST_Night_1km.rst>...
> Reading raster map <terra_lst1km20021217.LST_Day_1km.rst>...
> Reading raster map <terra_lst1km20021217.LST_Night_1km.rst>...
> Reading raster map <terra_lst1km20021218.LST_Day_1km.rst>...
> Reading raster map <terra_lst1km20021218.LST_Night_1km.rst>...
> Reading raster map <terra_lst1km20021219.LST_Day_1km.rst>...
> Reading raster map <terra_lst1km20021219.LST_Night_1km.rst>...
> Reading raster map <terra_lst1km20021220.LST_Day_1km.rst>...
> WARNING: Unable to open
>          '/hardmnt/eden0/castellani/grassdata/patGB1/modisLSTinterpolationPAT/cell_misc/terra_lst1km20021220.LST_Day_1km.rst/f_format'
> WARNING: quantization file [terra_lst1km20021220.LST_Day_1km.rst] in mapset
>          [modisLSTinterpolationPAT] missing
> Reading raster map <terra_lst1km20021220.LST_Night_1km.rst>...
> WARNING: Unable to open raster map
>          <terra_lst1km20021220.LST_Night_1km.rst at modisLSTinterpolationPAT>
> ERROR: Unable to open raster map <terra_lst1km20021220.LST_Night_1km.rst>
>        in mapset <modisLSTinterpolationPAT>
> 
> The map is there and ok.
> 
> I am unsure how to track this down (maybe there is a fixed buffer in libgis?).

What does "ulimit -n" say? That's the OS-imposed limit on the number
of open file descriptors per process.

On my system, both the hard and soft limits are 1024. The soft limit
can be changed with e.g. "ulimit -n 1500", but only up to the hard
limit. The hard limit can only be changed by root.

Limits are typically set at login by the pam_limits.so module, which
is configured via /etc/security/limits.conf. Limits are inherited by
child processes; any changes to limits.conf won't take effect until
you to log in again.

If you have root access via sudo, you can spawn a root shell, increase
the hard limit, then spawn a child shell under your normal account
which will inherit the increased limit. E.g.:

	$ sudo bash
	# ulimit -Hn 1500
	# sudo -u markus bash
	$ ulimit -n 1500
	$ 

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list