#60 expectk problem


I'm using the cvs head of tcl/tk 8.6 and the cvs head of expect.

After building expect against tcl/tk 8.6, I see

$ ./expectk
Application initialization failed: version conflict for package "Tcl": have 8.6b1.1, need exactly 8.6


  • Rick Richardson

    Rick Richardson - 2009-08-25

    There is a workround. Change:

    #!/usr/bin/expectk -f


    #!/usr/bin/wish -f

    package require Expect

  • Sergei Golovan

    Sergei Golovan - 2009-10-17

    It looks like Tk initialization in exp_main_tk.c is copy&pasted from some older Tk version and modified a bit to process additional expectk command line options. In Tk 8.5 procedure Tk_Init() has been changed, so this older procedure (Tk_Inint2()) doesn't work properly anymore.

    I'd propose the following solution:
    1) Process expectk specific command line options
    2) Call Tk_Init with the rest of the options to initialize Tk correctly.

    The only complication I see is that one has to readd "--" option back to argv because itis removed by Tk_ProcessArgv().

    I can't attach the patch for some reason, so here's the link: http://sgolovan.nes.ru/download/tk-init.patch

  • Don Porter

    Don Porter - 2009-10-19

    The expectk executable is no longer maintained.
    Use wish with a suitable [package require Expect]
    in your script.

    I would close this "Won't Fix", but I'm not a dev
    on this project.

  • Don Porter

    Don Porter - 2009-10-19

    I suppose the bug to be fixed is to remove any build
    machinery and source files still devoted to creation
    of the expectk executable.

  • Andreas Kupries

    Andreas Kupries - 2009-10-19

    Removal of the whole expectk/expectcl build machinery is not possible. There are people which are getting them build and distributed. The build never failed because it was against 8.4 not 8.6, but a build was done.

  • Andreas Kupries

    Andreas Kupries - 2009-10-19

    Teopetuk's solution sounds to be ok for this type of thing, in principle, i.e. process our special stuff, then call on the regular Tk_Init for all the common things.
    I am currently looking through the concrete patch.

    I believe I have found one bug in it already.
    It defines a new variable 'rest' and initializes to -1 (line 239).
    This variable is later queried for >= 0, to restore '--' (line 268).
    The problem I have is there is _no_place_ where this variable is written to between these two lines, i.e. it is never >=0, always -1.

    I expected things somewhere around TK_ParseArgv, but there is nothing there.
    I wonder if that is something which should be done always, i.e. unconditionally.

    Teoptetuk, do you have example code traces which show the new code behaves when called with various sets of arguments ? Maybe it will help me to understand it better.

  • Andreas Kupries

    Andreas Kupries - 2009-10-19
    • assigned_to: nobody --> andreas_kupries
  • Sergei Golovan

    Sergei Golovan - 2009-10-20

    The variable rest is set in Tk_ParseArgv(). The following excerpt from argTable[] is responsible for it:

    {"--", TK_ARGV_REST, (char *) 1, (char *) &rest,
    "Pass all remaining arguments through to script"},

    Manpage of Tk_ParseArgv() says that rest is set to the index of option "--" in the returned argv, where "--" is restored after that.

  • Andreas Kupries

    Andreas Kupries - 2009-10-20

    Ah, no bug then, just me having trouble reading the code. Thanks for the explanation. I completely read over the shortened Tk_ArgvInfo structure and array. I believe that we should add comments in the code refering to the array, to keep maintainers aware of this nearly invisible write and access.

  • Larry W. Virden

    Larry W. Virden - 2010-02-04

    Note that the expectk build from the expect cvs update as of Nov 3, 2009 continues to exhibit this bug.

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2010-08-28

    expectk has been removed in 5.45. Use package require Expect & Tk in tclsh instead.

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2010-08-28
    • status: open --> closed-out-of-date

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks