Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2020-12-31
15:57 • Closed ticket [693851ffff]: Bug in safe::interpCreate plus 5 other changes artifact: 600992f350 user: kjnash
2020-07-21
17:36 • Ticket [693851ffff]: 7 changes artifact: b25a493b47 user: kjnash
17:25
Adapt Safe Base for interpreter names with namespace separators. Add a test and revise safe(n). Fi... check-in: ba718daa57 user: kjnash tags: safe-bugfixes-8-6
2003-07-17
05:33 • Ticket [693851ffff] Bug in safe::interpCreate status still Open with 5 other... artifact: 0b24757a10 user: hobbs
2003-07-09
15:07 • Ticket [693851ffff]: 3 changes artifact: b3122a4916 user: fireegl
2003-03-05
01:56 • Ticket [693851ffff]: 4 changes artifact: a12c67fe60 user: fireegl
01:56 • Ticket [693851ffff]: 2 changes artifact: bd85ae19ca user: fireegl
2003-02-27
04:08 • Ticket [693851ffff]: 4 changes artifact: 55968b143a user: nobody
2003-02-26
19:15 • New ticket [693851ffff]. artifact: f8cb052725 user: fireegl

Bug in safe::interpCreate

Closed / Fixed693851ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 6 years ago
Descriptionplain2003-02-26 19:15:52
I want to create a safe interpreter (bar) under the foo 
namespace..  Here's the sample code and the error it 
gives:

% namespace eval foo {safe::interpCreate ::foo::bar}
can't set "S::foo::bar(access_path,0)": parent 
namespace doesn't exist
nobodyplain2003-02-27 04:08:38
Logged In: NO 

Based on my preliminary research,

changing this proc in "safe.tcl" from this:

    proc InterpStateName {slave} {
        return "S$slave"
    }

to this:

    proc InterpStateName {slave} {
        regsub -all -- {::} $slave "" slave
        return "S$slave"
    }

seems to fix the problem.

JJM
fireegl Ticket [693851ffff]: 2 changes [History diff]2003-03-05 01:56:50
fireeglplain2003-03-05 01:56:51
Logged In: YES 
user_id=20221

I personally did it like this..

proc InterpStateName {slave} {
        return "${slave}S"
}

It would seem that it would put the variable in the same 
namespace that I created the interpreter uder this way.
fireegl Ticket [693851ffff]: 3 changes [History diff]2003-07-09 15:07:10
hobbsplain2003-07-17 05:33:25
Logged In: YES 
user_id=72656

I think the correct thing is to improve the docs to note that 
slaves cannot be in namespaces.  There may be other bugs 
lurking.  Or rather, make the creation more ns aware and 
create the [namespace qual $slaveName] first.  If someone 
can create and test that patch, it would be better.
kjnashplain2020-07-21 17:36:33
Fixed in safe-bugfixes-8-6 commit [ba718daa57], but subject to some restrictions because of the need for compatibility with existing code, and the non-standard namespace handling of "interp" (see bug [66c2e8c974]).

In the fixed version, the interpreter name "slave" may include namespace separators,
but may not have leading or trailing namespace separators, or excess
colon characters in namespace separators.  The interpreter name is
qualified relative to the global namespace ::, not the namespace in which
the ::safe::interpCreate or ::safe::interpInit command is evaluated.
kjnash Closed ticket [693851ffff]. [History diff]2020-12-31 15:57:04
Log in (anonymous is fine) to add a comment.