Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: eba97a3f0c873b28fd0a7b8b95139144cfc8b25e
Ticket: 218392ffffffffffffffffffffffffffffffffff
Tcl_StaticPackage does not call initProc upon load.
User & Date: nobody on 2000-10-26 00:57:02
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    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
    
  4. foundin changed to: "obsolete: 8.2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to:
    Tcl_StaticPackage does not call initProc upon load.
    
  11. type changed to: "RFE"