Skip to content
Tcl Source Code View Ticket
Login

View Ticket

interp crashes on name conflict

Closed / Fixed641195ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-11-20 12:23:30
[Richard Suchenwirth] - Reassigning the name of a child 
interpreter as alias causes tclsh 8.4.1 to crash both on 
Windows 2000 and Solaris:
 X:\tcl>tclsh
% info pa
8.4.1
% interp create foo
foo
% interp alias {} foo foo eval
called Tcl_FindHashEntry on deleted table
abnormal program termination
suchenwi@jaguar%tclsh               
% info pa
8.4.1
% interp create foo
foo
% interp alias {} foo foo eval
called Tcl_FindHashEntry on deleted table
zsh: 1456 IOT instruction  tclsh

Expected behavior: error message, e.g. "interp name foo 
can not be reassigned", no crash.

Further observation: using the interp name as a proc 
name silently destroys the slave interpreter:
% interp create foo
foo
% interp eval foo {set bar 0}
0
% proc foo {} {puts bar}
% interp eval foo {set bar}
could not find interpreter "foo"
andreas_kupries Ticket [641195ffff]: 1 change [History diff]2002-11-20 23:09:13
hobbsplain2002-11-23 08:22:21
Logged In: YES 
user_id=72656

This falls in the category of "don't do that".  I've added code 
that prevents a seg fault, but you will still kill the interpreter.
Log in (anonymous is fine) to add a comment.