Re: [tcltk-perl] Code for Tcl mainloop routines
Brought to you by:
hobbs
From: Vadim K. <va...@vk...> - 2005-05-21 14:34:43
|
> 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) > > Well, this very small code does not do segmentation fault on Windows, and indeed does segmentation fault on Linux. > >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.. > > Well, thank you a lot for providing analyzis. Actually I tried my code long time ago both on Windows and Linux, and it did not crashed. Now I think this is due to perl/Tk version, which probably was 800.024, that one without Unicode support. In my opinion, this is perl/Tk's fault in a name clash. I wonder, will static building of perlTk help to avoid segmentation fault? I did different rebuilds of Perl, Tcl/Tk on Windows and very little on Linux. I succeeded statically building into perl DLL entire Tcl/Tk. I'll try moving my previous experience to Linux and will see what combination will work. Best regards, Vadim. |