Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-22
17:19 • Ticket [05382a5317] extra pipes opened with exec status still Closed with 3 ... artifact: efae1e920d user: serhiy.storchaka
2026-10-21
10:03 • Closed ticket [05382a5317]. artifact: fd0545d183 user: serhiy.storchaka
2015-12-09
13:46 • New ticket [05382a5317]. artifact: 2522d39768 user: anonymous

extra pipes opened with exec

Closed / Fixed05382a5317cf938117548b5b76fc9ed5a003b25dCreated 11 years agoUpdated 42 days ago
Descriptionplain2015-12-09 13:46:25
#!/usr/bin/tclsh

if {$::argv > 0} {
  incr ::argv -1
  exec $::argv0 $::argv &
  exit 0
}

vwait forever

-- snip --

run the snippet as 'foo.tcl <number>' then check the open fds with 'ls -l /proc/<pid>/fd/'

argv = 1 gives 4 pipes
argv = 5 gives 12 pipes
etc

bug is present on tcl 8.5.9
bug is (apparently) not present on tcl 8.6.1. always 2 pipes, regardless of iterations
serhiy.storchakawiki2026-10-21 10:03:38

Fixed in 8.5.13 by [662a69f571] (backport of [5a5e87fae7], in 8.6.0): the notifier's internal pipes are now close-on-exec, so exec'd children no longer inherit them.

serhiy.storchaka Ticket [05382a5317]: 3 changes [History diff]2026-10-22 17:19:31
Log in (anonymous is fine) to add a comment.