Tcl Source Code

View Ticket
Login
Ticket UUID: 1972867
Title: invalid encoding caching
Type: Bug Version: obsolete: 8.6a0
Submitter: msofer Created on: 2008-05-26 13:08:43
Subsystem: 10. Objects Assigned To: dgp
Priority: 2 Severity:
Status: Open Last Modified: 2008-07-22 10:35:20
Resolution: None Closed By:
    Closed on:
Description:
Bytecompiling [uplevel]ed scripts (see uplevel.patch below) causes two failures in encoding.test: 2.2 and 11.1. Only the first is of concern, the second failure can be shown to be an artifact of the first.

The problem seems to be that when the string "shiftjis" is stored as a shared literal, its intRep is not spoiled at the appropriate time.

Please see http://paste.tclers.tk/952 for a demo of the bug in a standard tclsh, and the attached analysis (kbk at the chat).
User Comments: dgp added on 2008-07-22 10:35:20:
Logged In: YES 
user_id=80530
Originator: NO


Backported same workaround to 8.5 branch
where those tests have also recently started
to fail.

dgp added on 2008-06-20 23:18:12:
Logged In: YES 
user_id=80530
Originator: NO


Added shimmer-inducing commands to the tests
so they will stop failing.

Better would be to more fully determine
what's really being tested; whether the
test is even still valid; and if so, construct
a more robust direct test, perhaps even with
a custom Tcltest command for that purpose.

msofer added on 2008-06-09 20:46:37:
Logged In: YES 
user_id=148712
Originator: YES

That patch has been committed to HEAD now

dkf added on 2008-05-26 23:52:51:
Logged In: YES 
user_id=79902
Originator: NO

TclOO used to hit a lot of this general sort of problem. I dealt with them by giving each object its own unique sequence number; maybe sequence/epoch numbers are the easiest way for checking whether the internal rep is valid here too?

msofer added on 2008-05-26 20:09:41:

File Added - 279076: [email protected]

Logged In: YES 
user_id=148712
Originator: YES

File Added: [email protected]

msofer added on 2008-05-26 20:08:44:

File Added - 279075: uplevel.patch

Attachments: