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

History Of Ticket 1011715fff

Artifacts Associated With Ticket 1011715fff

  1. Ticket change [531a5a3668] (rid 126423) by nobody on 2004-08-18 19:38:33:

    1. assignee initialized to: "kennykb"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      platform: linux, gcc 2.95.3
      
      The c-library function exit() cannot reach
      C++-destructors which
      has been registered via atexit() . This happens,
      because tcl8.5.xxx
      unloads any shared library associated with a registered
      package.
      
      example:
      
      ----------- t.cpp --------------------------
      #include <tcl.h>
      
      class X { public: ~X() {}; };
      
      extern "C" int
      T_Init( Tcl_Interp * interp )
      {
          static X x;
          return TCL_OK;
      }
      ---------------------------------------------
      make a shared library:
      
      g++ -o libt.so -shared -fPIC -I../generic t.cpp
      
      Then, in tclsh: "load libt.so; exit" ends up with a
      core dump.
      
      (1) load libt.so load the dll and calls T_Init()
      (2) g++ registers an exit-handler calling atexit() after
           constructing the static object x of class X.
      (3) at end: TclpUnloadFile() calls dlclose() for this
           package
      (4) Tcl calls exit() 
      (5) exit() calls the exit-handler registered in step (2),
           which unfortunately has been unloaded in step (3)
      
      The unload behavior is controlled by the macro
      TCL_UNLOAD_DLLS.
      
      The current snapshot's Makefile.in defines this macro
      as -DTCL_UNLOAD_DLLS=1
      
      Having -DTCL_UNLOAD_DLLS=0 as default would 
      ensure compatibility with previous versions 
      (no implicit unload).
      
      -- [email protected]
      
       
      
      
          
      
      
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.5a2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "40. Dynamic Loading"
    10. title initialized to: "segfault in exit() due to unloaded shared library"
    11. type initialized to: "Bug"
  2. Ticket change [06265efb71] (rid 89169) by kennykb on 2004-08-20 02:39:23:

    1. assignee changed to: "dkf"
    2. icomment:
      Logged In: YES 
      user_id=99768
      
      Donal,  this appears to be TIP#100 stuff.
      It appears that the stanza of code beginning at line 1155
      of tclLoad.c is unloading all packages, irrespective of
      whether they support a Foo_Unload entry point, and
      therefore unloading packages that aren't designed to
      be unloaded.
      
      Should the test for pkgPtr->fileName[0] perhaps
      also include a test that pkgPtr->unloadProc is non-NULL,
      to indicate that the package expects to be unloaded
      early?  
      
      
    3. login: "kennykb"
    4. mimetype: "text/plain"
    5. username: "kennykb"
  3. Ticket change [0f4118d046] (rid 94754) by dkf on 2004-08-20 03:22:51:

    1. assignee changed to: "kennykb"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      TIP#100 is silent on the exact topic.  :^(
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  4. Ticket change [4e6ecf999a] (rid 127233) by kennykb on 2004-09-08 04:55:52:

    1. assignee changed to: "mistachkin"
    2. icomment:
      Logged In: YES 
      user_id=99768
      
      Joe, do you think it'll take a TIP to fix this?  We don't define
      a Foo_Unload for process exit, and the interpreter is no
      longer available.  Any thoughts?
      
      
    3. login: "kennykb"
    4. mimetype: "text/plain"
    5. username: "kennykb"
  5. Ticket change [cf09298e7e] (rid 112888) by dkf on 2004-09-08 05:25:12:

    1. assignee changed to: "kennykb"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      Deeper consideration: It would be easy to either not unload
      DLLs at all on Finalize or only unload the DLLs on finalize
      if they support unloading at other times. But we need input
      from someone like Joe Mistachkin on this; IIRC he's one of
      the (potential?) users of unloading, and might want the
      facility for non-Tcl-aware libs too...
      
      I've insufficient experience to help here (I prefer to
      consider C++ as part of the problem space, a bit like PL/1
      was reputed to be.)
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  6. Ticket change [dc45f60069] (rid 108109) by dkf on 2004-09-08 15:19:26:

    1. assignee changed to: "mistachkin"
  7. Ticket change [eb46f4b05a] (rid 103521) by mistachkin on 2004-10-10 02:38:01:

    1. icomment:
      Logged In: YES 
      user_id=113501
      
      It would seem from reading the description of the problem
      above that gcc expects the atexit() handlers to be called
      prior to the DLL being unloaded?  Is there any way we can
      figure out those handlers and call them ourselves?
      
      Perhaps we can "hook" atexit(), figure out which DLL invoked
      it, and simply call the handlers ourselves prior to
      unloading the DLL in question.
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  8. Ticket change [d69bf12b3b] (rid 123836) by dkf on 2004-12-23 23:43:36:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      xref Tcl bug 1082283 maybe?
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  9. Ticket change [bd8772a1e7] (rid 101921) by dgp on 2005-11-02 00:22:14:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Have finalization fixes since the
      latest comments resolved this?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Ticket change [da45db7710] (rid 107743) by dgp on 2006-03-10 13:43:47:

    1. priority changed to: "9 Immediate"
  11. Ticket change [536270611a] (rid 93751) by dgp on 2007-10-25 22:29:56:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      status?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [cc00688e6f] (rid 95614) by dgp on 2007-12-04 01:47:02:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      Is there still an 8.5.0-blocking
      issue here?
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  13. Ticket change [3822e689df] (rid 112153) by dgp on 2007-12-07 02:33:05:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      I can't block for a bug, no matter
      how serious, if there's apparently
      no one working on a solution.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. priority changed to: "8"
    5. username: "dgp"
  14. Ticket change [1949ebd3cf] (rid 122785) by georgeps on 2007-12-18 01:33:59:

    1. icomment:
      Logged In: YES 
      user_id=585068
      Originator: NO
      
      For what it's worth I can't duplicate this in Ubuntu 7.x with gcc 4.1.2 and  /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.8
      
      I suspect based on some searching, that this issue was fixed in libstdc++ by using cxa_finalize when a library is unloaded/dlclose()
      
      Also, a minor clarification; the code generated by g++ is calling cxa_atexit, and not atexit().
      
      So, I suggest unless there is further input from the submitter, that this bug be closed.
      
      
      
      
    2. login: "georgeps"
    3. mimetype: "text/plain"
    4. username: "georgeps"
  15. Ticket change [cf918d8069] (rid 113007) by dgp on 2007-12-18 01:59:36:

    1. closedate changed to: "2007-12-17T18:59:36"
    2. closer changed to: "dgp"
    3. resolution changed to: "Out of Date"
    4. status changed to: "Pending"
  16. Ticket change [5ba7946aac] (rid 118366) by sf-robot on 2008-01-01 10:20:07:

    1. closedate changed to: "2008-01-01T03:20:07"
    2. closer changed to: "sf-robot"
    3. icomment:
      Logged In: YES 
      user_id=1312539
      Originator: NO
      
      This Tracker item was closed automatically by the system. It was
      previously set to a Pending status, and the original submitter
      did not respond within 14 days (the time period specified by
      the administrator of this Tracker).
      
      
    4. login: "sf-robot"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "sf-robot"