Skip to content
Tcl Source Code History Of Ticket 21dbc600ae
Login

History Of Ticket 21dbc600ae

Artifacts Associated With Ticket 21dbc600ae

  1. Ticket change [078d303703] (rid 207751) by avl42 on 2022-12-06 11:45:49:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-plain"
    4. comment initialized to:
      simplest test script:
         close stdin; close stdout; exec true
      
      Workaround (assuming that stdin/-out just need to be closed):
         close stdin; close stdout; open /dev/null r; exec true
      
      In either case: exec first creates a pipe, and while the child runs, the parent
      waits on that pipe for EOF (probably initiated from another thread).
      
      With at least one of stdin or stdout NOT closed (or re-opened afterwards), the EOF on that pipe is seen, but with BOTH stdin/-out closed, nothing ever closes the write-end of the pipe.
      
      PS: that pipe is NOT the one by which the main process communicates to the child.
      
    5. foundin initialized to: "8.6.8"
    6. is_private initialized to: "0"
    7. login: "avl42"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "2287a4a5f84eadc47fdc912609f4f98319372d33"
    10. resolution initialized to: "None"
    11. severity initialized to: "Severe"
    12. status initialized to: "Open"
    13. submitter initialized to: "avl42"
    14. subsystem initialized to: "16. Commands A-H"
    15. title initialized to:
      exec hangs, iff stdin & stdout both were previously closed.
      
    16. type initialized to: "Bug"
  2. Ticket change [4402fb3863] (rid 207752) by avl42 on 2022-12-06 11:47:24:

    1. comment changed to:
      simplest test script:
         close stdin; close stdout; exec true
      
      Workaround (assuming that stdin/-out just need to be closed):
         close stdin; close stdout; open /dev/null r; exec true
      
      In either case: exec first creates a pipe, and while the child runs,
      the parent waits on that pipe for EOF (probably initiated from another thread).
      
      With at least one of stdin or stdout NOT closed (or re-opened afterwards),
      the EOF on that pipe is seen, but with BOTH stdin/-out closed, nothing
      ever closes the write-end of the pipe.
      
      PS: that pipe is NOT the one by which the main process communicates to the child.
      
    2. login: "avl42"
    3. mimetype: "text/plain"
  3. Ticket change [b183dfce90] (rid 207753) by avl42 on 2022-12-06 11:56:25:

    1. comment changed to:
      simplest test script:
         close stdin; close stdout; exec true
      
      Workaround (assuming that original stdin & -out just need to be closed):
         close stdin; close stdout; open /dev/null r; exec true
      
      In either case: exec first creates a pipe, and while the child runs,
      the parent waits on that pipe for EOF (probably initiated from another thread).
      
      With at least one of stdin or stdout NOT closed (or re-opened afterwards),
      the EOF on that pipe is seen, but with BOTH stdin/-out closed, nothing
      ever closes the write-end of the pipe.
      
      PS: that pipe is NOT the one by which the main process communicates to the child.
      
    2. login: "avl42"
    3. mimetype: "text/plain"
  4. Ticket change [c1502e06c2] (rid 207754) by avl42 on 2022-12-06 12:06:26:

    1. comment changed to:
      simplest test script:
         close stdin; close stdout; exec true
      
      Workaround (assuming that original stdin & -out just need to be closed):
         close stdin; close stdout; open /dev/null r; exec true
      
      In either case: exec first creates a pipe, and while the child runs,
      the parent waits on that pipe for EOF (probably to be initiated
      from another thread).
      
      With at least one of stdin or stdout NOT closed (or re-opened afterwards),
      the EOF on that pipe is seen, but with BOTH stdin/-out closed, nothing
      ever closes the write-end of the pipe.
      
      PS: that pipe is NOT the one by which the main process communicates to the child.
      
    2. login: "avl42"
    3. mimetype: "text/plain"
  5. Ticket change [62a9a947df] (rid 257943) by serhiy.storchaka on 2026-10-13 18:34:38:

    1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
    2. icomment:
      Still hangs with 8.6.17, 9.0 and 9.1. With stdin and stdout closed, the pipe
      for the output of the child gets descriptors 0 and 1, and
      <code>TclpCloseFile()</code> never closes 0, 1 and 2, so the parent keeps the
      write end open and never sees the end of the output.
      
      Proposed fix in branch [/timeline?r=exec-closed-stdio|exec-closed-stdio]:
      move pipes and files created for a pipeline above descriptor 2. Test
      exec-23.1.
      
    3. login: "serhiy.storchaka"
    4. mimetype: "text/x-fossil-wiki"
  6. Ticket change [086710a575] (rid 259580) by jan.nijtmans on 2026-10-20 20:53:48:

    1. icomment:
      I'm seeing this compiler warning, even though it appears to work fine:
      <pre>
      unix/tclUnixPipe.c:469:13: warning: variable ‘errPipeIn’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
        469 |     TclFile errPipeIn, errPipeOut;
            |             ^~~~~~~~~
      unix/tclUnixPipe.c:469:24: warning: variable ‘errPipeOut’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
        469 |     TclFile errPipeIn, errPipeOut;
            |                        ^~~~~~~~~~
      </pre>
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  7. Ticket change [48150806be] (rid 259583) by jan.nijtmans on 2026-10-20 21:03:20:

    1. icomment:
      This warning is caused by the line
      <pre>
      pid = fork();
      </pre>
      
      in line 602
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [d25c98d11f] (rid 259617) by serhiy.storchaka on 2026-10-20 21:28:10:

    1. icomment:
      The warning is not new in this branch: TclpCreateProcess() is unchanged, but unix/tclUnixPipe.c has <code>#define fork vfork</code> when HAVE_VFORK is set, so <code>pid = fork();</code> is really vfork(), after which gcc warns about locals that may be clobbered. <code>dsArray</code> and <code>newArgv</code> there were already volatile for this reason, <code>errPipeIn</code>/<code>errPipeOut</code> were not.
      
      Fixed in [4af19e7744] on the branch: they are volatile now (TclpCreatePipe() fills plain temporaries). My gcc 15 never showed the warning, so please check that it is gone with yours.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"