Skip to content
Tcl Source Code View Ticket
Login

View Ticket

hidden bgerror fallback gets wrong stack

Closed / Fixed1790274fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-09-07 15:45:10
Works in 8.4.16:

% info patch
8.4.16
% interp create -safe safe
safe
% interp alias safe puts {} puts
puts
% safe eval {proc bgerror m {puts $m\n$::errorCode\n$::errorInfo}}
% safe eval after 0 error foo
after#0
% update
foo
NONE
foo
    while executing
"error foo"
    ("after" script)
% interp hide safe bgerror
% safe eval after 0 error foo
after#1
% update
foo
NONE
foo
    while executing
"error foo"
    ("after" script)


Broken in 8.5a6 (and HEAD):

% info patch
8.5a6
% interp create -safe safe
safe
% interp alias safe puts {} puts
puts
% safe eval {proc bgerror m {puts $m\n$::errorCode\n$::errorInfo}}
% safe eval after 0 error foo
after#0
% update
foo
NONE
foo
    while executing
"error foo"
    ("after" script)
% interp hide safe bgerror
% safe eval after 0 error foo
after#1
% update
foo
NONE
invalid command name "bgerror"
    while executing
"bgerror foo"
dgp Ticket [1790274fff]: 1 change [History diff]2007-09-07 22:55:38
dgpplain2007-09-07 23:52:43
Logged In: YES 
user_id=80530
Originator: NO


This variation shows that 8.4 has
a bug as well:

% interp create -safe safe
safe
% interp alias safe puts {} puts
puts
% safe eval {proc bgerror m {puts $m\n$::errorCode\n$::errorInfo}}
% interp hide safe bgerror
% safe eval after 0 error foo
after#0
% update
foo
NONE
foo
    while executing
"error foo"
    ("after" script)
% safe eval {proc bgerror m {error bar grok baz}}
% safe eval after 0 error foo
after#1
% update
foo
baz
grok
    (procedure "bgerror" line 1)
    invoked from within
"bgerror foo"
dgpplain2007-09-08 01:10:02
Logged In: YES 
user_id=80530
Originator: NO


Committing attached patch to
HEAD as a fix.

Patch uses routines available
only in 8.5, so no backport.
Unless someone re-opens, consider
this a "Won't fix" on the 8.4 branch.
Log in (anonymous is fine) to add a comment.