Bug 11939

Summary: spawn after fork doesn't work in expect with --enable-threads
Product: [Retired] Red Hat Raw Hide Reporter: Jonathan Kamens <jik>
Component: tcltkAssignee: Jens Petersen <petersen>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-06-07 08:28:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Kamens 2000-06-07 08:28:36 UTC
I am using the RawHide tcltk-8.2.3-36 package with the following changes:

* Expect version upgraded to 5.31.8.
* Tcl and Tk versions upgraded to 8.3.1.
* Removed patches that are no longer necessary after Tcl and Tk upgrades.
* Change Expect "cd" build commands because the Expect source code now
unpacks into a directory with a hyphen in it.

With these changes, the following Expect script does not work properly:

#!/usr/bin/expect --

--- cut here ---
set timeout 2
set pid [fork]

if {! $pid} {
    spawn echo ready
    expect {
	{ready} {
	    send_error "got ready\n"
	}
	default {
	    send_error "didn't get ready\n"
	}
    }
}
--- cut here ---

It should print "got ready", but instead it prints "didn't get ready".

I solved this problem by removing "--enable-threads" from the spec file.

I think that the "experimental" --enable-threads should be removed until
it's a bit less experimental.

Comment 1 Jeff Johnson 2000-06-10 13:45:04 UTC
The option --enable-threads has been removed in tcltk-8.3.1.