Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a880e103d900473c7c7e139efd30fe267ba818f5
Ticket: 943274ffffffffffffffffffffffffffffffffff
Tcl 8.4.5 with Expect 5.39 hangs waiting for data matching p
User & Date: andreas_kupries on 2004-05-05 06:28:57
Changes

  1. icomment:
    Logged In: YES 
    user_id=75003
    
    I am trying to understand this and have some questions. You
    said that GetInput is blocking in the read ... Line 5303 ...
    Ok, just before that the generic IO system looks if the
    channel is non-blocking or not. It tries to read only if the
    channel is in blocking mode. So your expect channel is in
    blocking mode, right ? On the other hand, when expect
    creates a channel it sets this chanel to -blocking 0, i.e.
    non-blocking (exp_chan.c, line 520, function expCreateChannel).
    
    So, does your application (or a package it uses) switch the
    expect channel into blocking mode ? If yes, can you disable
    that part and check if your application will still work
    correctly ?
    
    From the Tcl core's perspective the behaviour is correct:
    
    - On the next to last round Expect sees that it has not much
    room in expect_out and ask for less data than Tcl has in its
    buffers, and Tcl returns that.
    - On the next round Expect asks for much more data than Tcl
    has in the buffers, and so Tcl goes looking for more, and as
    the channel is blocking it also knows that it should wait
    for the OS to deliver the data. If the channel had been
    non-blocking Tcl would not only see that the OS is currently
    out of data but would also abort the operation and simply
    return what data it has, instead of trying to forcibly
    fulfill the request completely.
    
    
    
  2. login: "andreas_kupries"
  3. mimetype: "text/plain"
  4. username: "andreas_kupries"