Getting segfaults when calling Tcl_EvalFile from C.
Hi there!
Id just a look to tuxracers source because I want to add some
features.
Of course, I tried to build it on my gcc-3.3 machine (SuSE9) and it
failed.
Now, after fixing the problems, I get a segfault when starting up my
created executable.
I was able to find the like which causes the segfault:
Tcl_EvalFile( g_game.tcl_interp, GAME_INIT_SCRIPT);
Its a little bit strange, because my TCL-Settup works for the
precompilied tuxracer shipped with my distro without any problems.
Also, the initialisation should work in the right way:
g_game.tcl_interp = NULL;
g_game.tcl_interp = Tcl_CreateInterp();
if ( g_game.tcl_interp == NULL )
{
handle_error( 1, "cannot create Tcl interpreter" );
}
Here is what HDB told me after creating a stack-backtrace:
#0 0x404ffdd7 in __strtod_internal () from /lib/i686/libc.so.6
#1 0x080aaf96 in text_colour ()
#2 0xbfffe588 in ?? ()
#3 0x40231b5e in TclGetNamespaceForQualName () from
/usr/lib/libtcl8.4.so
Previous frame inner to this frame (corrupt stack?)
Any ideas? Im really a TCL-n00b, so maybe this is a stupid question
at all, but I cant help myself :-(
I use SuSE9.0 with TCL 8.4 and GCC 3.3.
lg Clemens