View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] ::xotcl::object autoname crashes in Tcl 8.5

From: Mark Janssen <mpc.janssen_at_gmail.com>
Date: Mon, 18 Sep 2006 23:26:52 +0200

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_at_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
>
>
>