Re: [tcltk-perl] Code for Tcl mainloop routines
Brought to you by:
hobbs
From: Stephane C. <ch...@in...> - 2005-05-20 17:51:20
|
>> And we discovered that perl-Tk and Tcl *cannot* be used at >> the same time: they >> implement functions with the same name that do different >> things. Consequently, > Please provide more details here. > Probably you mean that you cound not link both perl/Tk and Tcl/tk > into one single binary file (either DLL or exe or somesuch) Basically that's what I meant, yes. And that's what I think happens dynamically when I do the following on my Linux box: ------------ use Tcl; # leads libtcl8.4.so to be loaded use Tk; # leads misc .so files from perl-Tk to be loaded $mw = new MainWindow; Tk::MainLoop; --------------- and the result is Segmentation fault (core dumped) When I investigated that and looked at the core file with gdb, I found that the segfault occurs in perl-Tk's CreateFrame just after calling Tcl_GetStringFromObj. This function exists in both perl-Tk (in one of its .so file, in Linux) and in libtcl8.4.so. Apparently, the dynamic loader chooses the latter whereas perl-Tk expected the former to be called. This results in an invalid char* pointer being returned; when it is dereferenced, the program crashes.. St. |