Skip to content
Tcl Source Code History Of Ticket 670042ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 670042ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 670042ffffffffffffffffffffffffffffffffff

  1. Ticket change [c38707a0e8] (rid 111677) by dgp on 2003-01-17 22:58:32:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      dgpIs line 481 of tclLoad.c a bug?
      kennykbyes, dgp?
      dgpRather than a return, shouldn't that be a goto down
      to where the package is registered as loaded in a
      non-NULL interp?
      kennykbOK, let me walk through this slowly.
      dgpAs is, Tcl_StaticPackage(one,...);
      Tcl_StaticPackage(two,...);
      kennykbWe've discovered that there's a package with
      the same name and procedures statically loaded in SOME
      interp.
      dgpwill cause [info loaded {}] in interp one, to
      include foo, but [info loaded {}] in interp two will not.
      kennykbBut it doesn't have to be the current one.
      dgp"statically loaded" is a per-process question.
      kennykbHmm, but then the code down below actually has
      to check that the package ISN'T already loaded in the
      current interp?
      dgpfirstPkgPtr is a process-wide resource.
      Out of a cloud of smoke, miguel appears!
      dgpAs I understand it, it's up to the caller to get
      this right.
      kennykbexcuse me.  we've discovered that a static
      package is provided in the process... but we don't know
      that it's in [info loaded] in the current interp.
      dgpSo if the caller calls Foo_Init(two) directly, it's
      up to that caller to also call
      Tcl_StaticPackage(two,...) to keep the [info loaded]
      results correct.
      kennykbSo, you want to replace the Tcl_MutexUnlock and
      return with a break, then condition the next paragraph
      upon pkgPtr == null, yes?
      kennykbHmm, I was more concerned with two
      Tcl_StaticPackage calls for the same package in the
      same interp.
      kennykbIs that illegal, or should it simply do nothing?
      dgpthat's cleaner than the goto, yes.
      dgpIt would seem that s per-interp search for already
      registered packages would be need then, yes.
      kennykb... probably up at the top, so we can do it
      without acquiring the lock.
      kennykbHmm, then we need two more test cases, one to
      make sure that Tcl_StaticPackage gets [imfo loaded]
      right in the second interp, and one to make sure that
      you can Tcl_StaticPackage the same package twice.
      
      
      ....
      
      dgpWhat got me started was trying to grok the intent
      of Tcl_StaticPackage's modes of operation.
      kennykbOK, well, you did indeed find a bug.
      kennykbAnd you're right that the 'package' there is a
      misnomer, I quite forgot the conversation where I
      argued you into that position. 
      dgpapparently, the interp==NULL mode is just for
      saying "hey, there are two routines available, Foo_Init
      and Foo_SafeInit, and the [load] command in the future
      should associate them with the "Foo" value in its
      "package" argument.
      dgp...in all interps.
      dgpThe (interp!=NULL) mode, though, seems intended to
      make a stronger claim.
      dgpHey, that association should be made, *and*, btw,
      I've called one of those routines on this interp already.
      dgpIf that understanding is correct, I'd note that I
      derived that from looking at the code, not at the docs
      for Tcl_StaticPackage, which could be clearer.
      kennykb... and we ought to update the docs to reflect
      that understanding.
      
      
      
    4. foundin initialized to: "obsolete: 8.4.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "40. Dynamic Loading"
    10. title initialized to: "Tcl_StaticPackage fails interp registration."
    11. type initialized to: "Bug"
  2. Ticket change [4ce88128c7] (rid 126971) by kennykb on 2003-02-02 06:43:36:

    1. closedate changed to: "2003-02-01T23:43:36"
    2. closer changed to: "kennykb"
    3. resolution changed to: "Fixed"
    4. status changed to: "Closed"