[GRASS-user] r.patch: GRASS-6.5svn

Glynn Clements glynn at gclements.plus.com
Wed Jan 20 23:28:36 EST 2010


Rich Shepard wrote:

> >  I need ideas on how to find the source of the problem. What might cause
> > such an error?
> 
>    Does anyone know why r.patch and/or r.series would generate an error about
> not being able to write a row when maps are concatenated? It seems to me
> that if the data are good (which they seem to be), and I can combine the two
> suspect maps (of the 9 total) with surrounding ones one at a time until a
> threshold is reached, it must be something with the two modules that's
> failing.

The error "map [%s] - unable to write row %d" doesn't originate in a
module, it originates in the library, and invariably indicates that
write() failed.

[If you're getting a different error, please post the *exact* error
message, not a paraphrase.]

This can be caused by many things, including (but not limited to):

* Exceeding the 2GiB limit on a build without LFS.
* Exceeding the 4GiB limit of a FAT filesystem.
* Exceeding "ulimit -f".
* Exceeding quota.
* Disk full.
* Hardware error

If you built GRASS from source, apply the attached patch with:

	patch -p0 < write_errno.patch

from the top-level directory of the GRASS source tree, then
re-compile.

This will cause the underlying OS error to be included in the error
message.

The issue isn't limited to a specific module. I would expect to see
the same issue with almost any raster command run with the same
region, e.g.:

	r.mapcalc 'test = rand(-1.0,1.0)'

Note: I wouldn't expect to see the issue with a trivial test case such
as:

	r.mapcalc 'test = 0'

because such a map will compress very well, and it's the size of the
compressed data which matters.

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

-------------- next part --------------
Index: lib/gis/put_row.c
===================================================================
--- lib/gis/put_row.c	(revision 40542)
+++ lib/gis/put_row.c	(working copy)
@@ -122,6 +122,7 @@
  **********************************************************************/
 
 #include <string.h>
+#include <errno.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -307,7 +308,8 @@
     if (fcb->io_error)
 	return;
 
-    G_warning(_("map [%s] - unable to write row %d"), fcb->name, row);
+    G_warning(_("map [%s] - unable to write row %d (%s)"), fcb->name, row,
+	      strerror(errno));
 
     fcb->io_error = 1;
 


More information about the grass-user mailing list