GRASS for RS6000

a907hart at a907hart at
Tue Mar 24 05:21:58 EST 1992

Working with GRASS on an RS6000 we encountered three problems that
cost us a lot of time to solve. Here they are. Any remarks from the
people at CERL or other RS programmers?

Jan Hartmann
Faculty of Environmental Sciences
University of Amsterdam

On the RS6000 a call to malloc with 0 elements returns a NULL pointer.
This causes a tricky bug in v.digit, which regularly crashes
with "Out of Memory". The bug is to found in mapdev/diglib/allocation.c,
function dig_falloc. Every malloc returning a NULL-pointer exits the
program; such events arise e.g. when creating areas without islands.
Same problem in libes/gislib/allocation.c. I remember having seen
something like that in the X-Windows distribution: a macro called
ZERO_MALLOC_RETURNS_0 (or something like that).

In r.watershed: ram/ramseg.h: macro SEG_INDEX has to be rewritten as function
This macro seems to have side-effects I still don't understand.

Matrix inversion sometimes fails because of underflow.
Invert function in lib.ortho has to be rewritten; see e.g.
W.H. Press, Numerical Recipes.
I read a message on comp.infosystems.gis that the same problem arose
in i.pca; however we never had any problems with that one

More information about the grass-dev mailing list