[winGRASS] r.mapcalc Segmentation Faults

Glynn Clements glynn.clements at virgin.net
Fri Jun 13 00:57:37 EDT 2003


David Finlayson wrote:

> I recently upgraded to WinGrass 5.0.2 on WinXP
> 
> I get a segfault when I run the command:
> 
> r.mapcalc 'water = if(dem90 < 0, dem90, null())'
> 
> dem90 contains negative and positive elevations where negative elevations 
> are water and zero is a valid elevation.
> 
> I don't recall having trouble with this in the previous release.

There is a known bug in 5.0.2's r.mapcalc which could result in a
segfault while writing the history (i.e. after the computation has
reached 100%).

If you built from source, you can use the attached patch to fix that
bug. If you obtained pre-compiled binaries ... hopefully someone will
produce an updated r.mapcalc binary; a bug in r.mapcalc is a major
problem.

-- 
Glynn Clements <glynn.clements at virgin.net>

-------------- next part --------------
--- src/raster/r.mapcalc3/expression.c~	Sun Nov 17 09:18:01 2002
+++ src/raster/r.mapcalc3/expression.c	Thu Apr 24 19:09:08 2003
@@ -56,6 +56,7 @@
 	argt[1] = e1->res_type;
 
 	e->data.func.name = "";
+	e->data.func.oper = NULL;
 	e->data.func.func = f_int;
 	e->data.func.argc = 1;
 	e->data.func.args = args;
@@ -77,6 +78,7 @@
 	argt[1] = e1->res_type;
 
 	e->data.func.name = "";
+	e->data.func.oper = NULL;
 	e->data.func.func = f_float;
 	e->data.func.argc = 1;
 	e->data.func.args = args;
@@ -98,6 +100,7 @@
 	argt[1] = e1->res_type;
 
 	e->data.func.name = "";
+	e->data.func.oper = NULL;
 	e->data.func.func = f_double;
 	e->data.func.argc = 1;
 	e->data.func.args = args;


More information about the grass-windows mailing list