Tcl Source Code

View Ticket
Login
Ticket UUID: 219167
Title: pkg_mkIndex: numbers in dll names
Type: Bug Created on: 2000-10-26 05:02:46
Submitter: nobody Assigned to: kennykb
Subsystem: 40. Dynamic Loading Severity:
Priority: 5 Medium Last modified: 2002-03-23 05:35:13
Status: Closed Closed by: hobbs
Resolution: None Closed on: 2002-03-22 22:35:13
Version: final: 8.0.5
Description:
OriginalBugID: 1706 Bug
Version: 8.0.5
SubmitDate: '1999-04-05'
LastModified: '2000-07-28'
Severity: SER
Status: Assigned
Submitter: pat
ChangedBy: ericm
OS: All
Machine: X86
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


Name:
Aharon Strosberg

ReproducibleScript:
EXPORT(int,Rldm818_Init)(Tcl_Interp *interp)
    {
    
            Tcl_CreateCommand(interp, "RLDLLOpenMux818",
    fnTclOpenMux818,NULL,NULL);
            Tcl_CreateCommand(interp, "RLDLLCloseMux818",
    fnTclCloseMux818,NULL,NULL);
            Tcl_CreateCommand(interp, "RLDLLSetMux818",
    fnTclSetMux818,NULL,NULL);
            Tcl_CreateCommand(interp, "RLDLLGetMux818",
    fnTclGetMux818,NULL,NULL);
    
            
            return Tcl_PkgProvide(interp,"RLDM818","1.0");
    
    }

ObservedBehavior:
When I try to make a pkgIndex for this dll using pkg_mkIndex,
    I get an empty file. This doesn?t happen when I omit the numbers
    in the fileName, pkg_Init and packageName.



This is because [load], when trying to guess the package name (and thus the name of the init function) takes the library file and strips off the extension and all trailing numbers, which are assumed to be version numbers.

One possible partial solution is to modify the [load] facilities to generate a list of possible package names.  Given the filename foo123.so, it currently looks for "Foo_Init"; in addition, it could look for "Foo123_Init".  That is, the first guess would be the strictly alpha prefix of the filename; the second guess would be the entire filename less the extension.

- eric

-- 07/28/2000 ericm
User Comments:
hobbs added on 2002-03-23 05:35:13:
Logged In: YES 
user_id=72656

You can work around this simply by specifying the expected 
package name (third arg to load).