tcltkgrass/Linux Problem

Mark P. Line markline at henson.cc.wwu.edu
Sat Apr 2 16:45:21 EST 1994


On Sat, 2 Apr 1994, Cao Changyong wrote:

>     Although I have got the tcltkgrass package running on my Linux Box by 
> modifying some codes in the TclTkInit.c to avoid a segmenation fault,
> I can't help thinking about the problem I avoided.  The problem was, in the 
> TclTkInit.c program, there is a line like this:
> 
>       tcltkgrass = Tcl_GetVar(interp, "env(TCLTKGRASSBASE)", GLOBAL_ONLY);
> 
>     The "env(TCLTKGRASSBASE)" causes a segmentation fault at run time.  I
> thought that "env" belongs to the ksh, therefore, I invoked the ksh.  Then 
> I got a memory fault.

The "env" in the call you quote above is an array variable, built into
Tcl, containing current values of the environment variables of the
process. It is not dependent on the KornShell. A given variable can be
read by accessing the appropriate element of the env array, i.e.
env(TCLTKGRASSBASE). With what little knowledge of embedded Tcl I have,
the only thing I can think of that might be causing a segmentation default
here would be if the variable TCLTKGRASSBASE did not actually exist in the
environment *and* the C function Tcl_GetVar() handled that particular
situation rather ungracefully. Given the state of flux Tcl is in, I
wouldn't discount that possibility out of hand. In any case, be sure that
you've set TCLTKGRASSBASE to point to the proper directory containing the
tcltkgrass src and script directories before running it. This should be
done for you in the tcltkgrass startup script, but there seems to be some
indecision about how exactly the system is supposed to be started up.

Also, the variable on the left-hand side of the call you quote above
should be 'tcltkgrassbase', of course, and not 'tcltkgrass'; I assume you
simply misquoted this when writing your message. If this is what your
source really says, and if your version is the same as mine, then you need
to change it (though I don't know why it should differ from mine in that
case).

-- Mark

--------------------------------------------------------------------
Mark P. Line                       Phone: +1-206-733-6040
Open Pathways                        Fax: +1-206-733-6040
P.O. Box F                         Email: markline at henson.cc.wwu.edu
Bellingham, WA 98227-0296
--------------------------------------------------------------------




More information about the grass-user mailing list