#2278: G__tempfile() lacks perror support
-------------------------+--------------------------------------------------
Reporter: neteler | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: LibGIS | Version: svn-releasebranch70
Keywords: r.hants | Platform: Unspecified
Cpu: Unspecified |
-------------------------+--------------------------------------------------
(The problem arises from r.hants Addon use, reported on grass-user)
Using r.hants (derived from r.series) on almost 600 raster
maps generates an "ERROR: no temp files available" on
Linux 64bit. The input maps have been registered with
r.external:
> For a better error message, perror() should be used:
Ideally, strerror() (or similar) should be used, and the string included
in the error message. Otherwise, the additional details will be omitted
from any logfile ($GIS_ERROR_LOG) or email message ($GRASS_ERROR_MAIL).
Except, strerror() isn't thread-safe (it returns a pointer to a static
buffer). POSIX.1-2001 specifies strerror_r(), which requires the caller to
supply a buffer. Windows doesn't have that, but it has strerror_s (same
functionality, different argument order). So we'd need configure checks.
Replying to [ticket:2278 neteler]:
> (The problem arises from r.hants Addon use, reported on grass-user)
>
> Using r.hants (derived from r.series) on almost 600 raster
> maps generates an "ERROR: no temp files available" on
> Linux 64bit.
r.series with the same number of input maps should fail with the same
error. r.hants has been derived from r.series, and both modules have the
-z flag (Don't keep files open) which should avoid this problem.
Replying to [comment:2 mmetz]:
> Replying to [ticket:2278 neteler]:
> > (The problem arises from r.hants Addon use, reported on grass-user)
> >
> > Using r.hants (derived from r.series) on almost 600 raster
> > maps generates an "ERROR: no temp files available" on
> > Linux 64bit.
>
> r.series with the same number of input maps should fail with the same
error. r.hants has been derived from r.series, and both modules have the
-z flag (Don't keep files open) which should avoid this problem.
Sorry, the -z flag does not help here because r.hants creates a new output
map for each input map, and these need to be kept open. For 600 input
maps, the hard limit of the number of open files is usually exceeded.
Replying to [comment:1 glynn]:
> Replying to [ticket:2278 neteler]:
>
> > For a better error message, perror() should be used:
>
> Ideally, strerror() (or similar) should be used, and the string included
in
> the error message.