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

Robin Schroeder Robin.Schroeder at asu.edu
Wed Feb 23 15:34:58 EST 2005


Hi GRASSLIST,

I wanted to follow-up on this post from last week, just in case someone has the same problem I encountered. I had three installations of grass in my /usr/local directory (grass 54, grass57 and a grass60 snapshot). Obviously, this isn't a big deal when you are running grass from a command prompt (although, I admit, it is ugly). However, multiple installations cause something to get confused when one is trying run grass commands from a shell script outside grass. As soon as I deleted the old installation directories, my segmentation errors disappeared. I probably should have used the uninstall script, in retrospect.

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
> 
> 


-----Original Message-----
From: owner-GRASSLIST at baylor.edu [mailto:owner-GRASSLIST at baylor.edu]On
Behalf Of Robin Schroeder
Sent: Thursday, February 17, 2005 4:09 PM
To: GRASSLIST at baylor.edu
Cc: Peter McCartney; Wayne E. Porter
Subject: [GRASSLIST:5834] Segmentation Error with shell script
Automation of grass


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