Skip to content
Tcl Source Code History Of Ticket 2269431fff
Login

History Of Ticket 2269431fff

Artifacts Associated With Ticket 2269431fff

  1. Ticket change [db294bf986] (rid 107914) by fomp on 2008-11-12 13:12:46:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      On Windows loading shared objects from a virtual file system,
      e.g. starkits, leaves temporary files behind after interpreter exits.
      
    4. foundin initialized to: "obsolete: 8.5.5"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "fomp"
    10. subsystem initialized to: "40. Dynamic Loading"
    11. title initialized to:
      load of shared objects leaves temporary files on windows
      
    12. type initialized to: "Bug"
  2. Ticket change [e360c32600] (rid 87788) by fomp on 2008-11-12 20:22:56:

    1. icomment:
      The following patch fixes the bug:
      
      --- generic/tclLoad.c   7 Oct 2008 20:51:46 -0000       1.16.4.1
      +++ generic/tclLoad.c   12 Nov 2008 13:21:09 -0000
      @@ -1154,7 +1154,7 @@
      
              if (pkgPtr->fileName[0] != '\0') {
                  Tcl_FSUnloadFileProc *unLoadProcPtr = pkgPtr->unLoadProcPtr;
      -           if ((unLoadProcPtr != NULL) && (pkgPtr->unloadProc != NULL)) {
      +           if (unLoadProcPtr != NULL) {
                      (*unLoadProcPtr)(pkgPtr->loadHandle);
                  }
              }
      
      
      
    2. login: "fomp"
    3. mimetype: "text/plain"
    4. username: "fomp"
  3. Ticket change [3b6fbe4ad2] (rid 112748) by dgp on 2008-11-12 23:22:18:

    1. assignee changed to: "nijtmans"
    2. icomment:
      
      There's a battle here with
      Bug 2059262.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "9 Immediate"
    6. username: "dgp"
  4. Ticket change [dce0bf59e0] (rid 114562) by nijtmans on 2008-11-13 06:20:12:

    1. icomment:
      The problem here is: how can we know that the dll
      which is unloaded here doesn't install an exit handler?
      If it does, it will lead to a crash as soon as the
      application exists. So, what is worse, a file leak
      or a crash? The only idea I have now is that in stead
      of unloading at this point, Tcl could install an
      exit handler which does the unloading at a later
      time. However, is the unLoadProc then still
      available? Ideas welcome.
      
      (Does this really have prio 9?)
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  5. Ticket change [9325bc1179] (rid 105767) by ferrieux on 2008-11-13 14:40:25:

    1. icomment:
      I'm just starting to discover how intricated the finalization hairball is, but I suspect that delaying things is not the solution; indeed, in bug 2270477 we've just seen what happens when an exit handler schedules things for "later"...
      
      Now unLoadProc and exitHandler seem a bit in contradiction... I understand that unloading is a rather recent feature, so there are extensions without an unLoadProc, but for those who have both, we could decide than the unLoadProc takes over and automatically de-registers the exitHandler ? Or calls it immediately ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  6. Ticket change [e1d154aecd] (rid 87518) by nijtmans on 2008-11-13 19:05:58:

    1. icomment:
      > I'm just starting to discover how intricated the finalization hairball is,
      > but I suspect that delaying things is not the solution; indeed, in bug
      
      Indeed, thinking more about it, delaying is not the solution: On Windows
      and HP-UX it is impossible to remove a shared library from the filesystem
      when it is not unloaded.
      
      But I have a better idea now. If the dll is loaded from a
      VFS file system, then its unloadProc is FSUnloadTempFile
      (a static function in tclIOUtil.c). So we can simply
      check for this, and allowing the unload in this
      situation. That's a much simpler fix, and it prevents
      muggling with exit handler related things!
      
      > an unLoadProc, but for those who have both, we could decide than the
      > unLoadProc takes over and automatically de-registers the exitHandler ? Or
      > calls it immediately ?
      Yes, this is how it should be. But the problematic libraries
      referred to in [Bug 2059262] don't have any way to de-register
      or run the exitHandler (believe me, I searched for that before
      filing 2059262!).
      
      Regards,
             Jan Nijtmans
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  7. Ticket change [e2fc3f3c66] (rid 87715) by ferrieux on 2008-11-13 20:24:18:

    1. icomment:
      > But the problematic libraries
      > referred to in [Bug 2059262] don't have
      > any way to de-register
      > or run the exitHandler
      
      The idea was not for the library itself to do it, but for the generic Tcl code... Maybe it doesn't make sense, I don't know the details :-} Tell me.
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  8. Ticket change [1f7357581f] (rid 91150) by nijtmans on 2008-11-14 05:46:18:

    1. icomment:
      Checked in the fix, in tclLoad.c 1.21. It just restores the
      behaviour from before Bugfix 2059262 when the library comes
      from VFS. If the librarie doesn't come from VFS, nothing
      changes. It's the most simple solution I can think of.
      The only dis-advantage is that when the library has no
      unloadProc, the real unloading from memory is left to
      the OS. If you don't want this, there is an easy workaround:
      Just give the library an unLoadProc, even an empty one suffices.
      
      This means that ill-behaved libraries still cannot be loaded
      from VFS: it will lead to a core-dump when the application
      ends. Lucky enough, I cannot imagine that anyone would like
      to load Oracle from a starkit: It simply is too dependant on
      other files installed to be useful. I can live with that
      limitation.
      
      If anyone has a better suggestion, I'm all ears!
      
      Still needs to be backported, so leaving open.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  9. Ticket change [63f357434d] (rid 92671) by nijtmans on 2008-11-14 07:25:05:

    1. closedate changed to: "2008-11-14T00:25:05"
    2. closer changed to: "nijtmans"
    3. icomment:
      Backported to core-8-5-branch, so can be closed.
      
      If someone has a better idea, feel free to re-open
      this artifact with (lots of) comments!
      
      Regards,
               Jan Nijtmans
      
      
    4. login: "nijtmans"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "nijtmans"
  10. Ticket change [b5d6fc1d59] (rid 125315) by nijtmans on 2008-11-14 16:15:08:

    1. icomment:
      
      Created lower-priority follow-up:
        [ 2282547 ] load of ill-behaved shared library from VFS: core dump
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"