Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ca04d4f53835f68e38e93328ec6a8dcf02646897
Ticket: 2960862fffffffffffffffffffffffffffffffff
loaded library paths should be normalized
User & Date: muonics on 2010-02-28 21:27:04
Changes

  1. assignee changed to: "kennykb"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Somewhat obscure, but tclLoad.c keeps track of loaded libraries by path/filename in order to keep from loading the same library twice. However, it doesn't normalize the path before doing so, so it's possible to load the same library twice in the same interpreter using different paths, which can cause unexpected behavior (such as crashing) depending on what the library does on initialization and cleanup when it expects that to only happen once in an interpreter (e.g. due to double cleanup of thread-specific data):
    
    % load ./libfoo.so
    % info loaded
    {./libfoo.so Foo}
    % load ./libfoo.so
    % info loaded
    {./libfoo.so Foo}
    % exit
    (no crash)
    
    % load ./libfoo.so
    % info loaded
    {./libfoo.so Foo}
    % cd ..
    % load foo/libfoo.so
    % info loaded
    {foo/libfoo.so Foo} {./libfoo.so Foo}
    % exit
    Segmentation fault (core dumped)
    
    Observed with 8.4 branch. Haven't tested 8.5 or 8.6, but I don't see any attempts to normalize in tclLoad.c in MAIN either.
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "muonics"
  10. subsystem changed to: "40. Dynamic Loading"
  11. title changed to: "loaded library paths should be normalized"
  12. type changed to: "Bug"