RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 950070 - expect login shows different behavior as in RHEL6
Summary: expect login shows different behavior as in RHEL6
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: expect
Version: 7.0
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Vitezslav Crhonek
QA Contact: Miroslav Vadkerti
URL:
Whiteboard:
Depends On:
Blocks: 950090
TreeView+ depends on / blocked
 
Reported: 2013-04-09 14:55 UTC by Miroslav Vadkerti
Modified: 2020-12-15 07:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-15 07:26:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Miroslav Vadkerti 2013-04-09 14:55:51 UTC
Description of problem:
I have this simple script
# cat test.exp
#!/usr/bin/expect -d
set timeout 60
spawn login
expect -nocase {login} {send "eal\r"}
expect -nocase {password} {send "fo0m4nchU\r"}
expect -nocase {level} {send "\r"}
send "PS1=:\\::\r"
expect {:::$} {send "exit\r"}
expect {:::$} {close; wait}'

On RHEL6 it works well:
-----------------------
# ./test.exp
expect version 5.44.1.15
argv[0] = /usr/bin/expect  argv[1] = -d  argv[2] = ./test.exp  
set argc 0
set argv0 "./test.exp"
set argv ""
executing commands from command file ./test.exp
spawn login
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {21762}

expect: does "" (spawn_id exp4) match glob pattern "login"? no
login: 
expect: does "login: " (spawn_id exp4) match glob pattern "login"? yes
expect: set expect_out(0,string) "login"
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) "login"
send: sending "eal\r" to { exp4 }
[snip]

On RHEL7 it fails:
------------------
# ./test.exp 
expect version 5.45
argv[0] = /usr/bin/expect  argv[1] = -d  argv[2] = ./test.exp  
set argc 0
set argv0 "./test.exp"
set argv ""
executing commands from command file ./test.exp
spawn login
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {18543}

expect: does "" (spawn_id exp4) match glob pattern "login"? no
expect: read eof
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) ""
expect: spawn id exp4 not open
    while executing
"expect -nocase {password} {send "fo0m4nchU\r"}"
    (file "./test.exp" line 5)

Version-Release number of selected component (if applicable):
util-linux-2.23-0.3.el7.x86_64
expect-5.45-8.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. execute test.exp script
  
Actual results:
On RHEL7 the expect reads eof. In strace I see:
select(5, [4], [], [4], {59, 999888})   = 1 (in [4], left {59, 997051})
gettimeofday({1365518725, 918093}, NULL) = 0
read(4, 0x127cb98, 4096)                = -1 EIO (Input/output error)
write(2, "expect: read eof\r\n", 18expect: read eof^M
[snip]

Expected results:
Script works as on RHEL6

Additional info:
The workaround I'm using now is to use sleep 1 after the spawn

Comment 2 Vitezslav Crhonek 2013-05-27 08:37:48 UTC
I tested it on RHEL6 with RHEL7 version of expect and it worked fine, RHEL6 version on RHEL7 doesn't work fine - similar to https://bugzilla.redhat.com/show_bug.cgi?id=965182.

Comment 4 Miroslav Vadkerti 2013-06-05 14:13:00 UTC
Reopenning. Sorry still I ocassionally see the issue

Comment 5 Miroslav Vadkerti 2013-07-08 12:40:17 UTC
This seems to be a dupe of Bug 965182.

*** This bug has been marked as a duplicate of bug 965182 ***

Comment 6 Miroslav Vadkerti 2013-07-23 15:45:47 UTC
Reopenning, this is not the same issue as dapospis reported.

Comment 7 Miroslav Vadkerti 2013-10-01 10:43:03 UTC
Still seeing the same behaviour with:

# rpm -q expect util-linux
expect-5.45-8.el7.x86_64
util-linux-2.23.2-5.el7.x86_64

Odd thing is that downgrading the expect to EL6 versions doesn't make the issue go away ... I will try to downgrade also TCL

Comment 8 Miroslav Vadkerti 2013-11-12 12:59:17 UTC
Can I provide any other information here? I do not like the idea having unnecessary sleeps in our tests. Thanks

Comment 9 Vitezslav Crhonek 2013-11-12 13:57:25 UTC
Well, you can try to identify which component causes this change somehow. I was not able too find out.

TCL is for sure one candidate, did the downgrade of it make any change?

Comment 10 Karel Srot 2014-02-28 06:46:31 UTC
Miro,
could you please check whether this is still an issue on recent composes? Thank you.

Comment 11 Miroslav Vadkerti 2014-02-28 07:55:15 UTC
Yep this is still an issue [1]. I will finally try out to downgrade the TCL to a RHEL6 version ...

[1] # ./test.exp 
spawn login
expect: spawn id exp4 not open
    while executing
"expect -nocase {password} {send "fo0m4nchU\r"}"
    (file "./test.exp" line 5)

Comment 12 Miroslav Vadkerti 2014-02-28 08:39:00 UTC
I still see the issue when downgrading to tcl-8.5.7-6 which should be the latest RHEL6 version. So looks like this must be an issue somewhere else as downgrading tcl or expect did not help ...

Comment 13 Vitezslav Crhonek 2014-03-24 15:48:07 UTC
Moving to 7.1.0 - we don't know which component is causing the issue, but there's a workaround.

Comment 20 RHEL Program Management 2020-12-15 07:26:26 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.