|
2001-04-05
| ||
| 08:20 | • Ticket [218087ffff] spawn and eof status still Closed with 3 other changes artifact: 046f00827d user: dgp | |
|
2000-10-26
| ||
| 08:14 | • Closed ticket [218087ffff]. artifact: 71f80394d3 user: welch | |
| 00:53 | • New ticket [218087ffff]. artifact: 113bc74936 user: nobody | |
spawn and eof
Closed / Fixed218087ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:53:01
OriginalBugID: 1721 Bug
Version: 8.0p2
SubmitDate: '1999-04-05'
LastModified: '1999-12-03'
Severity: CRIT
Status: Closed
Submitter: pat
ChangedBy: hobbs
OS: HP-UX
OSVersion: 10.20
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '1999-12-03'
ReproducibleScript:
#!/opt/expect-5.25/bin/expect -f
set verbose 1
log_user 1
exp_internal -f tclose.log 1
proc send_value {pos val} {
# expect $pos
send_user $pos\n
send_user $val\n
}
proc send_verb {pos1 pos2 verb retain control_string} {
send_value $pos1 $verb
send_value $pos2 $retain
send_user $control_string\n
# expect $control_string
}
set fin 0
set fifoname /tmp/exp0.333
set fifofile [open "|cat -u < /tmp/exp0.333" "r"]
while {$fin == 0} {
catch {exec mkfifo /tmp/exp0.333} status
exec chmod 666 /tmp/exp0.333
# open will hang until other user's cat starts
# spawn -open [open "|cat -u < /tmp/exp0.333" "r"]
spawn -open $fifofile
set userin $spawn_id
# set userin 5
send_user userin=$userin\n
# exp_pid
while 1 {
set spawn_id $userin
expect {
-re "\n" { set line1 "$expect_out(buffer)" }
eof {
break
}
}
expect -re "\n" { set line2 "$expect_out(buffer)" }
expect -re "\n" { set line3 "$expect_out(buffer)" }
send_user line1=$line1\n\n
send_user line2=$line2\n\n
send_user line3=$line3\n\n
if { [llength $line1] > 1 } {
send_verb [lindex $line2 0] [lindex $line2 1] [lindex $line1 0] [lindex $line1 1] "$line3"
} else {
send_bye [lindex $line2 0] [lindex $line1 0] \
"$line3"
}
}
catch {close -i $userin} status
# catch {close $fifofile} status
send_user close_status=$status\n
catch {exec rm -f $fifoname} status
send_user rm-fifoname=$status\n
}
ObservedBehavior:
we use expect and tcl/tk.
our expect shell is blocked on a pipe open by spawn -open [open |cat -u < filename]
when all datas in the pipe are read a trap on eof is executed and another process is done using datas just read.
At the end of this process we wait again on pipe by making a new spawn.
After some loops we always have the message "too many open files", why?
open file ids must be being left open. All file systems have
some limit on the number of open files, and usually also have
a per process limit.
-- 12/03/1999 hobbs
welch Closed ticket [218087ffff].
[History diff]2000-10-26 08:14:46
dgp Ticket [218087ffff]: 3 changes
[History diff]2001-04-05 08:20:14
Log in (anonymous is fine) to add a comment.