Skip to content
Tcl Source Code View Ticket
Login

View Ticket

invalid encoding caching

Open1972867fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 18 years ago
Descriptionplain2008-05-26 13:08:43
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).
msoferplain2008-05-26 20:08:44
File Added - 279075: uplevel.patch
msoferplain2008-05-26 20:09:41
File Added - 279076: [email protected]

Logged In: YES 
user_id=148712
Originator: YES

File Added: [email protected]
dkfplain2008-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?
msoferplain2008-06-09 20:46:37
Logged In: YES 
user_id=148712
Originator: YES

That patch has been committed to HEAD now
dgp Ticket [1972867fff]: 1 change [History diff]2008-06-17 03:10:49
dgpplain2008-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.
dgpplain2008-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.
Log in (anonymous is fine) to add a comment.

Attachments: