#4534 Wrong frame in bytecode

obsolete: 8.5.5
closed-duplicate
5
2010-02-06
2010-02-04
No

Tcl version: 8.5.5.
OS: Linux RedHat 5 & Solaris 10

Compilation of a script with active Async handler and non-trivial script executed by Async handler may cause generating bytecode with wrong variable frame. In attached example, compilation of "if" statement with constants in a regular procedure will call Tcl_AsyncInvoke. Then compilation of subsequent procedures called by Async will be in unpredictable frame: main body will be compiled in right frame but body of switch will be compiled in the frame of original synchronous procedure. You will see an error:
can't read "abc(xyz)": variable isn't array.

Discussion

  • Yevgen Ryazanov

    Yevgen Ryazanov - 2010-02-04

    shared lib and script for tclsh

     
  • Yevgen Ryazanov

    Yevgen Ryazanov - 2010-02-04

    Added a testcase. To reproduce:
    - modify paths in ./build
    - ./build
    - tclsh byte.tcl
    You will see "variable isn't array" error.

     
  • miguel sofer

    miguel sofer - 2010-02-05
    • status: open --> closed-invalid
     
  • miguel sofer

    miguel sofer - 2010-02-05

    Several remarks:

    1. please test with a current release (8.5.8)

    2. this has most probably nothing to do with the BC compiler, it would rather be a problem with the current CallFrame

    3. the comments seem not to refer to the attached files:
    - original comment talks about variable abc(xyz): no such thing in the attachment
    - second comment suggests running this in tclsh; the code does not package require Tk and uses [pack]

    Please resubmit with an accurate description of the problem. It would also help if there is a description of what is supposed to be happening with this code, both the .c and .tcl parts

     
  • miguel sofer

    miguel sofer - 2010-02-05
    • status: closed-invalid --> pending-invalid
     
  • Yevgen Ryazanov

    Yevgen Ryazanov - 2010-02-05
    • status: pending-invalid --> open-invalid
     
  • Yevgen Ryazanov

    Yevgen Ryazanov - 2010-02-05

    I tested it with Tcl 8.5.8. It works fine. It also work with Tcl 8.4. We cannot switch to another Tcl version because of release schedule. We need to patch current version of Tcl, 8.5.8.
    Original testcase may be simplified by replacing pack with puts to not confuse people. It does not reach to the execution of pack if there is a bug in byte compilation. Sorry for confusion.

     
  • miguel sofer

    miguel sofer - 2010-02-05
    • status: open-invalid --> pending-out-of-date
     
  • miguel sofer

    miguel sofer - 2010-02-05

    Whatever the bug, it is already fixed in the current bugfix release.

    I strongly recommend using the current bugfix release instead. Maintaining you own patched version of an older version sounds suboptimal.

    In order to prepare a custom patch you will need to hunt down the fix in the Changelog and cvs entries.

     
  • miguel sofer

    miguel sofer - 2010-02-06

    Turns out this was a different symptom of [Bug 2802881]

     
  • miguel sofer

    miguel sofer - 2010-02-06
    • status: pending-out-of-date --> closed-duplicate
     

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks