Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: da6e8c05009a8805539d1482b0647ee3b2441e6b4d656a8b86eda46b1189218b
Ticket: 463b7a93be0a2ddd3484d776b83e2b8ab6f63f0c
Tcl_Unload, make gdb-test, segmentation fault
User & Date: pooryorick on 2021-05-14 18:48:45
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    Up to at least commit [45fa0ff557cfdb12], the command,
    
    <code><verbatim>
    make TESTFLAGS='-file "unload.test winPipe.test"' gdb-test
    </verbatim></code>
    
    , produces the results below.  The problem is that in some cases, although the
    library is unloaded its record is not removed from the per-interp list of
    loaded libraries, and subsequent calls to <code>TclGetLoadedLibraries()</code>
    attempt to acces the record, whose storage has already been freed.
    
    
    <code><verbatim>
    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff7a2d5e2 in __strcmp_sse2_unaligned () from /usr/lib/libc.so.6
    (gdb) bt
    #0  0x00007ffff7a2d5e2 in __strcmp_sse2_unaligned () from /usr/lib/libc.so.6
    #1  0x00007ffff7eda1d0 in TclGetLoadedLibraries (interp=0x555555584a70, targetName=0x7ffff7fc3550 <tclEmptyString> "", prefix=0x555555711b10 "Tcltest") at /path/to/src/generic/tclLoad.c:1092
    #2  0x00007ffff7dbbd7b in InfoLoadedCmd (dummy1681=0x0, interp=0x555555584a70, objc=3, objv=0x55555565c940) at /path/to/src/generic/tclCmdIL.c:1703
    #3  0x00007ffff7d9f195 in Dispatch (data=0x55555574b478, interp=0x555555584a70, dummy4779=0) at /path/to/src/generic/tclBasic.c:4817
    #4  0x00007ffff7d9f21b in TclNRRunCallbacks (interp=0x555555584a70, result=0, rootPtr=0x0) at /path/to/src/generic/tclBasic.c:4857
    #5  0x00007ffff7d9eadd in Tcl_EvalObjv (interp=0x555555584a70, objc=3, objv=0x5555555c3a20, flags=2097168) at /path/to/src/generic/tclBasic.c:4576
    #6  0x00007ffff7da11b0 in TclEvalEx (interp=0x555555584a70, 
        script=0x5555555e0cb0 "# all.tcl --\n#\n# This file contains a top-level script to run all of the Tcl\n# tests.  Execute it by invoking \"source all.tcl\" when running tcltest\n# in this directory.\n#\n# Copyright © 1998-1999 Scri"..., numBytes=1012, flags=0, line=26, clNextOuter=0x0, 
        outerScript=0x5555555e0cb0 "# all.tcl --\n#\n# This file contains a top-level script to run all of the Tcl\n# tests.  Execute it by invoking \"source all.tcl\" when running tcltest\n# in this directory.\n#\n# Copyright © 1998-1999 Scri"...) at /path/to/src/generic/tclBasic.c:5728
    #7  0x00007ffff7ecc0e9 in Tcl_FSEvalFileEx (interp=0x555555584a70, pathPtr=0x5555555cbc60, encodingName=0x7ffff7f7d94c "utf-8") at /path/to/src/generic/tclIOUtil.c:1782
    #8  0x00007ffff7edabfe in Tcl_MainEx (argc=-1, argv=0x7fffffffe2f8, appInitProc=0x5555555563bc <Tcl_AppInit>, interp=0x555555584a70) at /path/to/src/generic/tclMain.c:399
    #9  0x00005555555563b5 in main (argc=6, argv=0x7fffffffe2c8) at /path/to/src/unix/tclAppInit.c:91
    </verbatim></code>
    
  5. is_private changed to: "0"
  6. login: "pooryorick"
  7. priority changed to: "5 Medium"
  8. resolution changed to: "None"
  9. severity changed to: "Minor"
  10. status changed to: "Open"
  11. submitter changed to: "pooryorick"
  12. subsystem changed to: "- New Builtin Commands"
  13. title changed to: "Tcl_Unload, make gdb-test, segmentation fault"
  14. type changed to: "Bug"