Bug 43310 - expect in tcltk-8.3.1-53 doesn't work right.
Summary: expect in tcltk-8.3.1-53 doesn't work right.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tcltk
Version: 7.3
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Jens Petersen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-06-03 00:20 UTC by hjl
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-08-05 04:34:37 UTC
Embargoed:


Attachments (Terms of Use)
expect.test used to show the bug. (3.85 KB, text/plain)
2001-06-03 00:21 UTC, hjl
no flags Details
A patch to fix expect (5.28 KB, patch)
2001-06-04 02:30 UTC, hjl
no flags Details | Diff
An updated patch (6.22 KB, patch)
2001-06-04 16:15 UTC, hjl
no flags Details | Diff
Update comments (6.19 KB, patch)
2001-06-04 16:27 UTC, hjl
no flags Details | Diff
An updated patch. (6.19 KB, patch)
2001-10-23 06:40 UTC, hjl
no flags Details | Diff
A updated patch. (6.34 KB, patch)
2001-11-16 00:09 UTC, hjl
no flags Details | Diff
A new patch. (6.60 KB, patch)
2001-11-29 20:59 UTC, hjl
no flags Details | Diff

Description hjl 2001-06-03 00:20:31 UTC
expect in tcltk-8.3.1-53 doesn't work right. The
problem is spawn won't print out all output.

# expect
expect1.1> spawn cat expect.test
spawn cat expect.test
23928
expect1.2> expect
 1: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
 2: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
 3: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
 4: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
 5: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
 6: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
 7: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
 8: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
 9: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
10: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
11: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
12: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
13: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
14: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
15: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
16: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
17: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
18: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
19: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
20: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
21: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
22: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
23: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
24: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
25: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
26: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
27: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
28: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
29: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
30: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
31: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
32: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
33: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
34: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
35: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
36: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
37: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
38: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
39: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
40: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
41: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
42: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
43: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
44: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
45: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
46: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
47: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
48: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
49: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
50: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
51: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
52: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
53: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
54: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
55: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
56: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
57: 0123456789abdecf0123456789abdecf0123456789abdecf0123456789abdecf
expect1.3> 

The problem is the last line

58: 012345

is missing. The problem depends on the size of the file.

Comment 1 hjl 2001-06-03 00:21:25 UTC
Created attachment 20150 [details]
expect.test used to show the bug.

Comment 2 hjl 2001-06-04 02:29:53 UTC
The problem is expect is line-oriented. It is designed for
interactive programs. But if the program is not interactive,
it won't work right at all. I will submit a patch with
lots of comments. It works for me.

Comment 3 hjl 2001-06-04 02:30:52 UTC
Created attachment 20198 [details]
A patch to fix expect

Comment 4 hjl 2001-06-04 16:15:42 UTC
Created attachment 20213 [details]
An updated patch

Comment 5 hjl 2001-06-04 16:27:29 UTC
Created attachment 20214 [details]
Update comments

Comment 6 Eido Inoue 2001-07-10 19:49:30 UTC
Thanks for the patch. I tested it with expect 5.32 and the bug (and this fix)
seems to apply to that as well.

Have you submitted this upstream?


Comment 7 hjl 2001-07-10 20:17:08 UTC
I am not totally convinced my patch is 100% correct. It does fix
that problem. But I have seen one case that expect reads in some
junks beyond the end of the input. It seems that the input buffer
expansion doesn't work quite right.. Those junks beyond the end
of the input really confuses expect and puts it in an endless loop.
But it only happens at random. I can't duplicate it reliably
myself. It happens when I cross compile binutils to Linux/hppa
and do "make check" on it.  expect chokes in gas sometimes.



Comment 8 hjl 2001-10-23 06:39:52 UTC
I spotted a few problems. I will upload a
new patch.

Comment 9 hjl 2001-10-23 06:40:49 UTC
Created attachment 34683 [details]
An updated patch.

Comment 10 hjl 2001-11-16 00:07:26 UTC
Here is a new patch. I hope I really get it right this time :-).

Comment 11 hjl 2001-11-16 00:09:20 UTC
Created attachment 37702 [details]
A updated patch.

Comment 12 hjl 2001-11-29 20:58:57 UTC
I have a new patch. I think I got it right time :-).

Comment 13 hjl 2001-11-29 20:59:46 UTC
Created attachment 39087 [details]
A new patch.

Comment 14 hjl 2002-06-10 15:57:33 UTC
7.3 has the old patch. Please use the latest one I
uploaded at 2001-11-29 03:59:45.

Comment 15 Jens Petersen 2002-08-14 06:34:35 UTC
Thanks for the updates.  I updated to the latest patch in expect-5.38.0-73.


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