When using XOTcl 1.4 or 1.5 on Tcl 8.5 creating an instance with an autoname crashes the Tcl process. On 8.4.13 it works:
XOTcl 1.4
tclsh
% set tcl_patchLevel 8.4.13 % package require XOTcl 1.4.0 % ::xotcl::Object autoname a a0 %
tclsh
% package require XOTcl 1.4.0 % set tcl_patchLevel 8.5a5 % ::xotcl::Object autoname a # crash with access violation
XOTcl 1.5
tclsh
% package require XOTcl 1.5.0 % set tcl_patchLevel 8.4.13 % ::xotcl::Object autoname a a1 %
tclsh
% package require XOTcl 1.5.0 % set tcl_patchLevel 8.5a5 % ::xotcl::Object autoname a # crashed with access violation
% parray tcl_platform tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = intel tcl_platform(os) = Windows NT tcl_platform(osVersion) = 5.1 tcl_platform(platform) = windows tcl_platform(threaded) = 1 tcl_platform(user) = mjanssen tcl_platform(wordSize) = 4
Is this a known problem? I am able to work around it by only using new and create.
Regards, Mark
Dear Mark,
where did you get tcl 8.5a5 from? From CVS? The website http://www.tcl.tk/software/tcltk/downloadnow85.html lists still 8.5a4.
i have tested 8.5a4 with Mac Os X and Linux without these problems. Can you determine from the debugger, where the crash happens?
-gustaf neumann
After having some of list discussion with Gustaf Neumann [GN] a solution has been found which will be part of the 1.5.1 release. Below a summary of the discussion.
MJ:
I have had the same problem witch Tcl 8.5a4 so I don't think it is specific to a5. I have downloaded 8.5a5 from tcl.sourceforge.net CVS. It does seem to be a windows only problem.
I have done some more investigation and tried to compile XOTcl for myself. Linking fails on TclIncrObjVar2 that is being used by AutonameIncr. TclIncrObjVar2 is part of the private Tcl API and therefore not included in the stubs dll. Same goes for TclIncrVar2 for the <8.5 builds
This means that AutonameIncr will call a function that is not enabled in the stubs table and that is probably why it crashes with 8.5a4/5. Using the code below, I can compile XOTcl on windows against Tcl85a5 and autoname seems to work as it should.
#ifdef PRE85 valueObject = TclIncrVar2(in, XOTclGlobalObjects[XOTE_AUTONAMES], name, 1, flgs); #else valueObject = Tcl_ObjGetVar2(in, XOTclGlobalObjects[XOTE_AUTONAMES],name, flgs); if (valueObject != NULL ) { Tcl_GetLongFromObj(in, valueObject,&autoname_counter); autoname_counter++; if (Tcl_IsShared(valueObject)) { valueObject = Tcl_DuplicateObj(valueObject); } Tcl_SetLongObj(valueObject,autoname_counter); } #endif
GN:
many thanks! looks good ... i've as well removed the PRE85 case, use this code always...
Regards, Mark
On 9/18/06, Gustaf Neumann neumann@wu-wien.ac.at wrote:
Dear Mark,
where did you get tcl 8.5a5 from? From CVS? The website http://www.tcl.tk/software/tcltk/downloadnow85.html lists still 8.5a4.
i have tested 8.5a4 with Mac Os X and Linux without these problems. Can you determine from the debugger, where the crash happens?
-gustaf neumann