Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e0925741a79bfa29ef318429594bf8e66902814afcb48d89ad6cb4650bfade74
Ticket: 61c01e0edb08a9ed905aefdf17ce113da303c77b
likely race condition with package require in several threads causing error
User & Date: sebres on 2025-07-17 12:40:11
Changes

  1. icomment:
    It doesn't look like encoding issue to me... however if I see "access violation", I remember about [f2ff05fc84], so the question is whether something (C or tcl) would set system encoding in threads (even if it set to same value).
    
    As for difference to 8.6 - it can be the library in zipfs.
    
    Anyway it looks rather as a timing issue to me and not necessarily a race condition. And it has definitely to do with a expanding of auto_path, because for some reason the path to tcllib/math is not there if error occurs, however the path to tcllib was set (it is also interesting - who add the path to tcllib).
    
    The first question is - can you try to use a tcl without zipfs?<br/>
    So either build it with `configure --disable-zipfs`.<br/>
    Or copy tcl-library together with all packages in some common directory, set env "TCL_LIBRARY" to this root path and start your test from that shell.<br/>
    
    Another question is - who add `C:/bawTcl/lib` or `D:/podcasts/Tcl90/lib` in auto_path initially? Are they added by tcl itself, or by you (e.g. somewhere in init.tcl or by some package).
    I guess the init.tcl may be customized there (e. g. so enhancements of auto_load or auto_load_index), because by default tcl doesn't search pkgIndex.tcl recursively (but only in first level of each directory in auto_path), so if something adds path to tcllib "delayed" it'd work exactly as described - first time fails and 2nd attempt to require it'd load it successfully.
    Also I assume, it'd not fail anymore if you'd add path to tcllib by yourself, e. g. somewhere in init.tcl or with `lappend auto_path C:/bawTcl/lib/tcllib`.
    
    So to clarify the issue, one needs to know which changes both tcl-editions have and how it is customized locally and how the auto_load mechanisms work (particularly who adds tcllib to auto_path).
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"