Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f6aa743d4da2a5f5e232ef5dc6495873b67e2ed1bb5c3df152eeee3f29a28cd9
Ticket: 815e2468064b4324bc4b303b9bafd3ef92803c32
tcl crash on channel thread transfer and fileevent writable in place
User & Date: serhiy.storchaka on 2026-10-13 14:52:56
Changes

  1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
  2. icomment:
    Not fixed: the script in the description still panics with "Channel released
    more than preserved": on Linux in 6 of 10 runs with 9.0 and 4 of 5 with 9.1
    (Thread 3.0.4) and 5 of 5 with 8.6.17 (Thread 2.8.12), on Windows 11 in 10 of
    10 runs with 9.1 (Thread 3.0.7) and 3 of 10 with 8.6 (Thread 2.8.13). The fix
    in branch fix-815e246806-8-6 (atomic reference count of channels) was never
    merged.
    
    Proposed fix in branch [/timeline?r=channel-refcount-thread-safe|channel-refcount-thread-safe]:
    protect the reference count of channels with a mutex. Test thread-9.1.
    
    Unlike the earlier fix, it uses a mutex rather than atomic operations: it needs
    no compiler-specific builtins, so it works with every compiler and platform Tcl
    supports, and it also covers the compound operations, where the count is
    checked together with the closed state of the channel before freeing it. The
    cost is one uncontended lock per preserve/release.
    
  3. login: "serhiy.storchaka"
  4. mimetype: "text/x-fossil-wiki"
  5. resolution changed to: "None"
  6. status changed to: "Open"