[GRASSLIST:5834] Segmentation Error with shell script Automation of grass

Robin Schroeder Robin.Schroeder at asu.edu
Thu Feb 17 18:08:56 EST 2005


Hi GRASSLIST, 

I am running the binary distribution of the 2/5/2005 grass60 snapshot on a redhat EL server.

I am trying to execute the following shell script outside of grass:
-------------------------------------------------------------------------
# Batch file for executing a grass workflow
# This program was created by: R. Schroeder and is adapted from
# pg 280-281 of Open Source GIS: A GRASS GIS Approach, 2nd ed.

# for new grass60
GISBASE=/usr/local/grass60
GISDBASE=/root/GRASSDATA
LOCATION=spearfish
MAPSET=user1
LOCATION_NAME=spearfish
GISRC=$HOME/.grassrc6

#grass related env variables
export GISBASE=$GISBASE
export GISRC=$GISRC
export GISDBASE=$GISDBASE
export LOCATION=$LOCATION
export MAPSET=$MAPSET
export LOCATION_NAME=$LOCATION_NAME
export PATH=$GISBASE/bin:$GISBASE/scripts:$PATH

echo "GISBASE: $GISBASE"
echo "GISRC: $GISRC"
echo "HOME: $HOME"
echo "GISDBASE: $GISDBASE"
echo "LOCATION: $LOCATION"
echo "MAPSET: $MAPSET"
echo "PATH: $PATH"
echo "LOCATION_NAME: $LOCATION_NAME"

echo "Run: g.version"
g.version

echo "Run: r.info soils"
r.info soils

echo "Run: g.copy vect=railroads at PERMANENT,myrailroads4"
g.copy vect=railroads at PERMANENT,myrailroads4
---------------------------------------------------------------

All of the variables look good and the g.version command works great.

The other two commands (r.info and g.copy) are causing a 'Segmentation Fault'.
Both of these commands run perfectly if I run them inside grass. 

I noticed a fair number of Segmentation faults reported in the grass list archives, but couldn't really find a problem that related to mine. Apparently, a segmentation fault occurs in unix when a program tries to access memory locations that haven't been allocated for the program's use. Any ideas?

Robin Schroeder
 

> Robin Tori Schroeder (formerly Schoeninger)
> International Institute for Sustainability 
> P.O. Box 873211
> Arizona State University
> Tempe, Arizona 85287-3211
> Phone: (480) 727-7290
> 
> 
> 




More information about the grass-user mailing list