Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 60272ca205aa6bc5d1f54cbe981d5cf157498272f4acfb0fba51cf31fea1b1bc
Ticket: be38540b321769e53e36e8d03b1a867a1df4675f
Deadlock during fork in TclpAlloc
User & Date: serhiy.storchaka on 2026-10-13 16:15:15
Changes

  1. foundin changed to: "9.1.0"
  2. icomment:
    Still happens with 9.1, now in <code>GetCache()</code> of the threaded
    allocator: if another thread holds a lock of the allocator when
    <code>fork()</code> is called, the child inherits the lock in the locked state,
    and its first allocation that needs it never returns. With the attached
    forkhang.c, where threads allocate and exit while another thread forks, 37 of
    120000 children hung.
    
    Proposed fix in branch [/timeline?r=alloc-fork-deadlock|alloc-fork-deadlock]:
    hold all allocator locks across <code>fork()</code> with
    <code>pthread_atfork()</code>.
    
  3. login: "serhiy.storchaka"
  4. mimetype: "text/x-fossil-wiki"