OriginalBugID: 5056 Bug
Version: 8.2
SubmitDate: '2000-04-13'
LastModified: '2000-05-15'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Linux-Red Hat
OSVersion: RedHat 6.1, NetBSD 1.4.2, Solaris 7
Machine: i386, sun4u
FixedDate: '2000-10-25'
ClosedDate: '2000-05-15'
Name: Michael Richardson
ReproducibleScript:
create a module as both a shared object and statically linked.
Call Tcl_StaticPackage in the Tcl_AppInit of the static function.
Do load "" Module in tcl. The initProc is not called.
Looking at tclLoad.c, line 124, it appears that if the package is already
loaded, that we goto "done", skipping the code at line 283. I don't see any
other calls to initProc, so I think that this functionality is broken.
DesiredBehavior:
I expect that initProc will be called when I do 'load "" Module'
I would do a patch, but it isn't clear to me how do make sure that the Init
function for the package only gets called once. The code seems to depend
upon the existence of the package on the package list to determine that the
package has been initialized.
What does the init C code really look like? initProc should be called
at least once, even in static packages, if everything is set up correctly.
-- 05/10/2000 hobbs
User's code...
int
Tcl_AppInit( Tcl_Interp *interp )
{
if( Tcl_Init( interp ) == TCL_ERROR ) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Beke", Beke_Init, Beke_Init);
...
}
How is the user certain that the code isn't called, instead of
just throwing some error? Doing the same to some test code
(tktable), it all works as expected.
-- 05/15/2000 hobbs
|