This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Expect script works in 1.5 but fails in 1.7




? 
Hi,

I have a simple Expect script that starts as:

set timeout -1
spawn ftp a.b.c.d
match_max 100000
expect? "*Name (a.b.c.d): "
send -- "anonymous\r"
expect? "*Password:"
send -- "anonymous\r"

This is fine in Cygwin 1.5 on my PC (installed in Nov 2008)?yet on some other PCs where I installed, last week, Cygwin 1.7 it fails at the Password introduction. I tried more combinations of stty echo and/or raw but without success.
Either it hangs without prompting the "Password:" or it prompts and gets the first character but the rest of chars are echoed on a new line and the login fails.

Thank you very much!
Bogdan Nicolau

PS
A short sample of my setup-for working PC- is here:
bash: cd: [~]$: No such file or directory
[~]$ cd "C:\backup\LaptopTools\ExpectWinUnix\expect-5.44.1\example"
[/cygdrive/c/backup/LaptopTools/ExpectWinUnix/expect-5.44.1/example]$ strace ftp a.b.c.d
**********************************************
Program name: C:\cygwin\bin\ftp.exe (pid 30700, ppid 1)
App version:? 1007.0, api: 0.167
DLL version:? 1005.25, api: 0.156
DLL build:??? 2008-06-12 19:34
OS version:?? Windows NT-6.0
Heap size:??? 402653184
Date/Time:??? 2010-02-15 12:30:59
**********************************************
?? 32??? 3949 [main] ftp 30700 set_myself: myself->dwProcessId 30700
?? 32??? 3981 [main] ftp 30700 time: 1266265859 = time (0)
? 467??? 4448 [main] ftp 30700 environ_init: GetEnvironmentStrings returned 0x628138 - "=C:=C:\cygwin\bin"
?? 57??? 4505 [main] ftp 30700 environ_init: 0x10A0238: !C:=C:\cygwin\bin
?? 56??? 4561 [main] ftp 30700 environ_init: 0x10A0250: ALLUSERSPROFILE=C:\ProgramData
?? 64??? 4625 [main] ftp 30700 environ_init: 0x10A0278: APPDATA=C:\Users\lmcabcd\AppData\Roaming
?? 85??? 4710 [main] ftp 30700 environ_init: 0x10A02A8: COLORFGBG=15;default;0
?? 73??? 4783 [main] ftp 30700 environ_init: 0x10A02C8: COLORTERM=rxvt-xpm
?? 51??? 4834 [main] ftp 30700 environ_init: 0x10A02E0: COMMONPROGRAMFILES=C:\Program Files\Common Files
?? 76??? 4910 [main] ftp 30700 environ_init: 0x10A0318: COMPUTERNAME=EV001F2990CA02
?? 52??? 4962 [main] ftp 30700 environ_init: 0x10A0338: COMSPEC=C:\Windows\system32\cmd.exe
?? 50??? 5012 [main] ftp 30700 environ_init: 0x10A0360: DISPLAY=:0
?? 49??? 5061 [main] ftp 30700 environ_init: 0x10A0370: FP_NO_HOST_CHECK=NO
?? 61??? 5122 [main] ftp 30700 getwinenv: can't set native for HOME= since no environ yet
...
====================================================================
a similar strace for the non-working PC is here:

$ strace expect -f autoexpect ftp a.b.c.d
**********************************************
Program name: E:\cygwin\bin\expect.exe (pid 3248, ppid 1)
App version:? 1003.15, api: 0.63
DLL version:? 1005.25, api: 0.156
wait_sig: entering ReadFile loop, my_readsig 0x0, my_sendsig 0x0
DLL build:??? 2008-06-12 19:34
OS version:?? Windows NT-5.1
Heap size:??? 402653184
Date/Time:??? 2010-02-15 12:05:11
**********************************************
? 199??? 1525 [main] expect 3248 set_myself: myself->dwProcessId 3248
? 150??? 1675 [main] expect 3248 time: 1266264311 = time (0)
? 761??? 2436 [main] expect 3248 environ_init: GetEnvironmentStrings returned 0x245300 - "=::=::\"
? 264??? 2700 [main] expect 3248 environ_init: 0x700238: !::=::\
? 216??? 2916 [main] expect 3248 environ_init: 0x700248: !E:=E:\cygwin\bin
? 177??? 3093 [main] expect 3248 environ_init: 0x700260: ALLUSERSPROFILE=E:\Documents and Settings\A
? 247??? 3340 [main] expect 3248 environ_init: 0x700298: APPDATA=E:\Documents and Settings\Abcd
a
? 332??? 3672 [main] expect 3248 environ_init: 0x7002E0: CLIENTNAME=Console
? 215??? 3887 [main] expect 3248 environ_init: 0x7002F8: COMMONPROGRAMFILES=E:\Program Files\Common
? 244??? 4131 [main] expect 3248 environ_init: 0x700330: COMPUTERNAME=ABCD-281CCA
? 238??? 4369 [main] expect 3248 environ_init: 0x700358: COMSPEC=E:\WINDOWS\system32\cmd.exe
? 252??? 4621 [main] expect 3248 environ_init: 0x700380: CVS_RSH=/bin/ssh
? 229??? 4850 [main] expect 3248 environ_init: 0x700398: FP_NO_HOST_CHECK=NO
? 236??? 5086 [main] expect 3248 getwinenv: can't set native for HOME= since no environ yet
...
User (carroll.aset.psu.edu:(none)):? 1820 6243445 [main] expect 3248 fhandler_console::write: 36 = w
?3396 6246841 [main] expect 3248 cygwin_select: 6, 0x701B6C, 0x701B74, 0x701B7C, 0x0
?1701 6248542 [main] expect 3248 dtable::select_read: /dev/console fd 0
?1520 6250062 [main] expect 3248 dtable::select_except: /dev/console fd 0
?1706 6251768 [main] expect 3248 dtable::select_read: /dev/ptmx fd 5
?1615 6253383 [main] expect 3248 dtable::select_except: /dev/ptmx fd 5
?1681 6255064 [main] expect 3248 cygwin_select: to NULL, ms FFFFFFFF
?1725 6256789 [main] expect 3248 cygwin_select: sel.always_ready 0
?1856 6258645 [main] expect 3248 select_stuff::wait: m 3, ms 4294967295
13735553 19994198 [main] expect 3248 select_stuff::wait: woke up.? wait_ret 2.? verifying
? 247 19994445 [main] expect 3248 select_stuff::wait: gotone 1
? 185 19994630 [main] expect 3248 select_stuff::wait: returning 0
? 204 19994834 [main] expect 3248 select_stuff::cleanup: calling cleanup routines
?7532 20002366 [select_pipe] expect 3248 thread_pipe: stopping
? 339 20002705 [main] expect 3248 peek_console: already ready
? 181 20002886 [main] expect 3248 set_bits: me 0x70B3C0, testing fd 0 (/dev/console)
? 190 20003076 [main] expect 3248 set_bits: ready 1
? 164 20003240 [main] expect 3248 select_stuff::poll: returning 1
? 171 20003411 [main] expect 3248 select_stuff::cleanup: calling cleanup routines
? 178 20003589 [main] expect 3248 select_stuff::~select_stuff: deleting select records
? 419 20004008 [main] expect 3248 sig_send: sendsig 0x6FC, pid 3248, signal -34, its_me 1
? 213 20004221 [main] expect 3248 sig_send: wakeup 0x6A4
? 190 20004411 [main] expect 3248 sig_send: Waiting for pack.wakeup 0x6A4
??? 9 20004420 [sig] expect 3248 wait_sig: signalling pack.wakeup 0x6A4
? 371 20004791 [main] expect 3248 sig_send: returning 0x0 from sending signal -34
? 185 20004976 [main] expect 3248 readv: readv (0, 0x22C290, 1) blocking, sigcatchers 2
? 188 20005164 [main] expect 3248 readv: no need to call ready_for_read
? 352 20005516 [main] expect 3248 fhandler_termios::line_edit: char a
? 260 20005776 [main] expect 3248 readv: 1 = readv (0, 0x22C290, 1), errno 0
? 984 20006760 [main] expect 3248 sig_send: sendsig 0x6FC, pid 3248, signal -34, its_me 1
? 218 20006978 [main] expect 3248 sig_send: wakeup 0x6A4
? 187 20007165 [main] expect 3248 sig_send: Waiting for pack.wakeup 0x6A4
??? 8 20007173 [sig] expect 3248 wait_sig: signalling pack.wakeup 0x6A4
? 372 20007545 [main] expect 3248 sig_send: returning 0x0 from sending signal -34
? 186 20007731 [main] expect 3248 writev: writev (5, 0x22B8D0, 1)
? 166 20007897 [main] expect 3248 fhandler_termios::line_edit: char a
...
Password:? 2698 25920851 [main] expect 3248 fhandler_console::write: 70B3E8, 2
?2515 25923366 [main] expect 3248 fhandler_console::write: at 13(0x20) state is 0
?2707 25926073 [main] expect 3248 fhandler_console::write: at 10(0x20) state is 0
?4982 25931055 [main] expect 3248 fhandler_console::write: 2 = write_console (,..2)
?4774 25935829 [main] expect 3248 cygwin_select: 6, 0x701B6C, 0x701B74, 0x701B7C, 0x0
?2669 25938498 [main] expect 3248 dtable::select_read: /dev/console fd 0
?2539 25941037 [main] expect 3248 dtable::select_except: /dev/console fd 0
?2618 25943655 [main] expect 3248 dtable::select_read: /dev/ptmx fd 5
?2632 25946287 [main] expect 3248 dtable::select_except: /dev/ptmx fd 5
?2708 25948995 [main] expect 3248 cygwin_select: to NULL, ms FFFFFFFF
?3128 25952123 [main] expect 3248 cygwin_select: sel.always_ready 0
?3047 25955170 [main] expect 3248 select_stuff::wait: m 3, ms 4294967295
4821572 30776742 [main] expect 3248 select_stuff::wait: woke up.? wait_ret 2.? verifying
?5166 30781908 [main] expect 3248 select_stuff::wait: gotone 0
?2656 30784564 [main] expect 3248 select_stuff::wait: looping
106710 30891274 [main] expect 3248 select_stuff::wait: woke up.? wait_ret 2.? verifying
?2890 30894164 [main] expect 3248 select_stuff::wait: gotone 0
?2600 30896764 [main] expect 3248 select_stuff::wait: looping
138776 31035540 [main] expect 3248 select_stuff::wait: woke up.? wait_ret 2.? verifying
?2838 31038378 [main] expect 3248 select_stuff::wait: gotone 1
?2563 31040941 [main] expect 3248 select_stuff::wait: returning 0
?2594 31043535 [main] expect 3248 select_stuff::cleanup: calling cleanup routines
?5378 31048913 [select_pipe] expect 3248 thread_pipe: stopping
?2792 31051705 [main] expect 3248 peek_console: already ready
?2557 31054262 [main] expect 3248 set_bits: me 0x712C40, testing fd 0 (/dev/console)
?2644 31056906 [main] expect 3248 set_bits: ready 1
?2562 31059468 [main] expect 3248 select_stuff::poll: returning 1
?2683 31062151 [main] expect 3248 select_stuff::cleanup: calling cleanup routines
?2614 31064765 [main] expect 3248 select_stuff::~select_stuff: deleting select records
?2859 31067624 [main] expect 3248 sig_send: sendsig 0x6FC, pid 3248, signal -34, its_me 1
?2647 31070271 [main] expect 3248 sig_send: wakeup 0x6A4
?2588 31072859 [main] expect 3248 sig_send: Waiting for pack.wakeup 0x6A4
?2570 31075429 [sig] expect 3248 wait_sig: signalling pack.wakeup 0x6A4
?2613 31078042 [main] expect 3248 sig_send: returning 0x0 from sending signal -34
?2614 31080656 [main] expect 3248 readv: readv (0, 0x22C290, 1) blocking, sigcatchers 2
?2633 31083289 [main] expect 3248 readv: no need to call ready_for_read
?2856 31086145 [main] expect 3248 fhandler_termios::line_edit: char n
?2680 31088825 [main] expect 3248 readv: 1 = readv (0, 0x22C290, 1), errno 0
?3036 31091861 [main] expect 3248 sig_send: sendsig 0x6FC, pid 3248, signal -34, its_me 1
?2637 31094498 [main] expect 3248 sig_send: wakeup 0x6A4
?2574 31097072 [main] expect 3248 sig_send: Waiting for pack.wakeup 0x6A4
?2620 31099692 [sig] expect 3248 wait_sig: signalling pack.wakeup 0x6A4
?2603 31102295 [main] expect 3248 sig_send: returning 0x0 from sending signal -34
?2591 31104886 [main] expect 3248 writev: writev (5, 0x22B8D0, 1)
===========================================================================


      __________________________________________________________________
Make your browsing faster, safer, and easier with the new Internet Explorer® 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]