Skip to content
Tcl Source Code History Of Ticket 218087
Login

History Of Ticket 218087

Artifacts Associated With Ticket 218087

  1. Ticket change [113bc74936] (rid 95107) by nobody on 2000-10-26 00:53:01:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      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
      
    4. foundin initialized to: "obsolete: 8.0p2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "60. NRE and coroutines"
    10. title initialized to: "spawn and eof"
    11. type initialized to: "Bug"
  2. Ticket change [71f80394d3] (rid 100783) by welch on 2000-10-26 08:14:46:

    1. closedate changed to: "2000-10-26T01:14:46"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [046f00827d] (rid 120000) by dgp on 2001-04-05 08:20:14:

    1. closedate changed to: "2001-04-05T01:20:14"
    2. closer changed to: "dgp"
    3. subsystem changed to: "27. Channel Types"