Hi,
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.
I know env is in the manual page therefore I assume it is available in
my Linux box. I can't figure out what causes the segmentation fault.
Any suggestion?
Thank you.
Changyong Cao
changyoc@daisy.siue.edu
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@henson.cc.wwu.edu
Bellingham, WA 98227-0296
--------------------------------------------------------------------
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.
I was able to avoid the segmentation fault core dumps by compiling
tcltkgrass using the gcc option -fwritable-strings. I now have Gilles'
tcltkgrass up and running on my Linux system. There are some problems here
and there, but my guess is that tcltkgrass isn't actually finished yet. 
-- Mark
--------------------------------------------------------------------
Mark P. Line Phone: +1-206-733-6040
Open Pathways Fax: +1-206-733-6040
P.O. Box F Email: markline@henson.cc.wwu.edu
Bellingham, WA 98227-0296
--------------------------------------------------------------------
Sorry for being incommunicado for the last couple of weeks.
I was busy organizing and running a Tcl/Tk - GRASS workshop!
We had about 35 people together for the workshop, complete
with a room full of workstations. It really worked well.
The participants were all people involved in developing
forest management decision support systems for Canada's
Green Plan and Model Forest program. The feedback from the
workshop was very positive. Most people seemed very excited
by the possibilities that these tools bring.
In mailgate.grass.user you write:
"Mark" == markline@henson.cc.wwu.edu (Mark P. Line) writes:
Mark> I was able to avoid the segmentation fault core dumps by
Mark> compiling tcltkgrass using the gcc option
Mark> -fwritable-strings. I now have Gilles' tcltkgrass up and
Mark> running on my Linux system. There are some problems here and
Mark> there, but my guess is that tcltkgrass isn't actually
Mark> finished yet. 
The current version of tcltkgrass is definitely early-alpha release
quality. As you may have noticed, there are a few noticable bugs,
probably a number of hidden gotcha's, and no documentation.
There isn't even a README file, and the makefile requires
editting. Hopefully, these inadequcies will be addressed over
the next month.
Gilles will be doing some more work to fix up the widget. He
mentioned some of the things he is planning and they sound
impressive, including surface modelling.
I think that it would help development if people could forward
bug reports to myself (tmoore@pnfi.forestry.ca) or to Gilles
(gc@copernic.lasinc.qc.ca). If you send them to me, I will
make sure that they are forwarded on to Gilles.
Tom--
Tom Moore tmoore@pnfi.forestry.ca
Petawawa National Forestry Institute
Canadian Forest Service, Box 2000, Chalk River +1 (613) 589-3048
ONT K0J 1J0 CANADA +1 (613) 589-2275 telefax