Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8bb3f77e0d5deb8696cd8d1bdbc72c7230d49730
Ticket: 943274ffffffffffffffffffffffffffffffffff
Tcl 8.4.5 with Expect 5.39 hangs waiting for data matching p
User & Date: mellenbe on 2004-05-05 07:55:01
Changes

  1. icomment:
    Logged In: YES 
    user_id=1030524
    
    As far as I know we do not change anything in the way the 
    channel is set up.   In addition, these same scripts work fine 
    with Tcl7.5 and Expect5.21.
    
    There are two conditions checked at 5298, 
    CHANNEL_NONBLOCKING was always on and I never remember 
    seeing CHANNEL_TIMER_FEV.  Both conditions have to be 
    true to avoid the read.   This is how we got to the else 
    condition.
    
    I believe our channel is always in non-blocking mode just as 
    expect set it up.  I didn't save any of the traces I did after I 
    instrumented several of these routines.
    
    The sequence I saw in DoReadChars is this,
    At 4411 we enter the for loop  
    At 4417 ReadChars is called and sets copiedNow.  After this 
    call, the data that was copied is the last of the data from our 
    server and contains our logical eof consisting of 3 % signs 
    (i.e., the prompt).  There is no more data to expect from the 
    server after the prompt is seen.
    
    Next I believe we fall through to the logic at 4437 and take 
    the else condition at 4455 where copied and toRead are 
    updated.  Remember at this point there is not more data so 
    next time through the for loop we somehow end up making 
    the function call at 4447.  Since the server has no more 
    data, the read hangs.  
    
    I think when the data was returned by ReadChars expect 
    should have been given an opportunity to examine it before 
    the next read.
    
    How can Tcl tell when there is no more data at the channel?  
    Our server is long running.  There are not eof or other 
    indicators sent.  Logical eof is determined by looking for a 
    prompt in the data, it's totally application specific.
    
    Sometimes I can hang this right away with my test script 
    other times it takes longer.  I hope this helps.  Let me know if 
    you need more information or the test script.  I can 
    reproduces this from solaris to solaris over a network.
    
    Mike 
    
    
  2. login: "mellenbe"
  3. mimetype: "text/plain"
  4. username: "mellenbe"