Re: expect + telnet hangs on AIX



Don Libes <libes@xxxxxxxx> wrote in message news:<s6a8y3nedg9.fsf@xxxxxxxxxxxxxxxxxx>...
> kkivi@xxxxxxxxxx (Konstantin Kivi) writes:
>
> > Don Libes <libes@xxxxxxxx> wrote in message news:<s6afyxxe0vx.fsf@xxxxxxxxxxxxxxxxxx>...
> > > kkivi@xxxxxxxxxx (Konstantin Kivi) writes:
> > >
> > > > >
> > > > > Use autoexpect <URL: http://wiki.tcl.tk/autoexpect >.
> > > > > It's ideal help in such situations.
> > > >
> > > > Unfortunataly, it hangs too, after writing that script.exp is
> > > > created.
> > > >
> > > > It's interesting that ps doesn't show any 'expect' instances,
> > > > only 'sh'. When I kill 'sh' the session is still hanging. I have
> > > > to kill ssh client from my cleint maachine.
> > >
> > > Your description is too vague. Let's start over - can you get Expect
> > > to interact with any program properly? Is it only telnet that
> > > misbehaves? Is it only telnet to a particular host that misbehaves?
> > > And what versions of Expect and AIX are you using?
> > >
> > > Don
> >
> >
> > Don,
> >
> > AIX version is 5.3
> >
> > [grs1]/grs1/home/tst > expect -v
> > expect version 5.43.0
> > [grs1]/grs1/home/tst >
> > [grs1]/grs1/home/tst > ldd `which expect`
> > /usr/local/bin/expect needs:
> > /usr/lib/libc.a(shr.o)
> > /usr/local/lib/libtcl8.4.so
> > /unix
> > /usr/lib/libcrypt.a(shr.o)
> > /usr/lib/libdl.a(shr.o)
> > [grs1]/grs1/home/tst >
> >
> > here is sample client
> > ==============================
> > #!/bin/sh
> >
> > echo ==
> > while read aaa ; do
> > if [ "$aaa" = "quit" ] ; then
> > exit 1;
> > fi
> > echo $aaa $aaa
> > echo ==
> > done
> > ===========================
> >
> > here is sample script
> > ========================
> > spawn exp.sh
> >
> > expect "==" { sleep .1 ; send "bbb\r" }
> > expect "==" { sleep .1 ; send "quit\r" }
> > ======================================
> > This script hangs 80% of the time
> >
> > When running expect -d it never hangs
> >
> >
> > If I add
> > puts "bye"
> > at the end of samle script it hangs 25 % times
> >
> > If I run it with nohup it never hangs.
>
> The presence of "sleep .1" and your comment about it not hanging when
> you use -d suggest that your script is time-dependent. In that case,
> you simply need to account for the time dependencies better - for
> example by sleeping longer or in different places.

I added sleep without much thought. It's like slow_send.

>
> On the other hand, if you are claiming that Expect is truly hung where
> it shouldn't be, you need to show that more conclusively, for example,
> by explicitly setting Expect's timeout and defining exactly what you
> mean by "hung" including where in the script it is stopping -
> including diagnostic output (from -d) (and if that's still not
> sufficient, a system call trace).
>

I found a remedy for my problem.
adding
'close stdout '
at the end of the script prevents hanging of expect.

I also have to wrap entire script in
if [ catch { lala lala lalala } res ] {
puts $res
}
close stdout
as any error prevents proper stdout closing .

I also seen one time or two in debug mode something like
' cannot write - sleep for 1 second' and then hang at exit time.

If you want to see the the syscall trace here is one

===========================truss -o explog expect <<EOF
if [ catch { set timeout 30
spawn telnet localhost 7700
expect {=>} {
sleep .5
send "restart_obr all\r"
}
} res ] {
puts $res
}

#close stdout
EOF

===========================
script connects to our custom systen and restart it.
everything work except that expect seems to hang .
ps shows that there is no more expect.

the trace is
=========================================

execve("/usr/local/bin/expect", 0x2FF22934, 0x2FF2293C) argc: 1
__loadx(0x0A040000, 0xD03CDAA4, 0x00000005, 0x10000000, 0x20000367) =
0x00000000_sigaction(13, 0x2FF22738, 0x2FF22748) = 0
sbrk(0x00000000) = 0x200081F0
__libc_sbrk(0x00000000) = 0x200081F0
__libc_sbrk(0x00000000) = 0x20018200
uname(0x2FF22658) = 0
access("/grs1/home/tst/bin/expect", 01) Err#2 ENOENT
access("/usr/local/gcc342/bin/expect", 01) Err#2 ENOENT
access("/usr/local/bin/expect", 01) = 0
statx("/usr/local/bin/expect", 0x2FF223E0, 128, 010) = 0
getuidx(4) = 233
getuidx(2) = 233
getuidx(1) = 233
getgidx(4) = 201
getgidx(2) = 201
getgidx(1) = 201
accessx("/usr/local/lib/tcl8.4/encoding", 0, 0) = 0
statx("/", 0x2FF206A8, 128, 011) = 0
statx("/usr", 0x2FF206A8, 128, 011) = 0
statx("/usr/local", 0x2FF206A8, 128, 011) = 0
statx("/usr/local/lib", 0x2FF206A8, 128, 011) = 0
statx("/usr/local/lib/tcl8.4", 0x2FF206A8, 128, 011) = 0
statx("/usr/local/lib/tcl8.4/encoding", 0x2FF206A8, 128, 011) = 0
open("/usr/local/lib/tcl8.4/encoding/iso8859-1.enc",
O_RDONLY|O_LARGEFILE) = 3
kfcntl(3, F_SETFD, 0x00000001) = 0
kioctl(3, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
kread(3, " # E n c o d i n g f".., 4096) = 1094
kread(3, " # E n c o d i n g f".., 4096) = 0
close(3) = 0
getuidx(4) = 233
getuidx(2) = 233
getuidx(1) = 233
getgidx(4) = 201
getgidx(2) = 201
getgidx(1) = 201
accessx("/usr/local/lib/tcl8.4", 0, 0) = 0
statx("/", 0x2FF20048, 128, 011) = 0
statx("/usr", 0x2FF20048, 128, 011) = 0
statx("/usr/local", 0x2FF20048, 128, 011) = 0
statx("/usr/local/lib", 0x2FF20048, 128, 011) = 0
statx("/usr/local/lib/tcl8.4", 0x2FF20048, 128, 011) = 0
access("/usr/local/lib/tcl8.4/init.tcl", 0) = 0
statx("/usr/local/lib/tcl8.4/init.tcl", 0x2FF21AE8, 128, 010) = 0
open("/usr/local/lib/tcl8.4/init.tcl", O_RDONLY|O_LARGEFILE) = 3
kfcntl(3, F_SETFD, 0x00000001) = 0
kioctl(3, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
kread(3, " # i n i t . t c l -".., 4096) = 4096
kread(3, " [ l l e n g t h [ i n".., 4096) = 4096
kread(3, " a c k t r a c e i n".., 4096) = 4096
kread(3, " c a s e , w e s u".., 4096) = 4096
kread(3, " # W i n d o w s s e".., 4096) = 4096
__libc_sbrk(0x00000000) = 0x20028210
kread(3, " e r r o r $ a c t i o".., 4096) = 2036
kread(3, " e r r o r $ a c t i o".., 4096) = 0
close(3) = 0
_getpid() = 447136
open("/dev/tty", O_RDWR) = 3
kioctl(3, 22528, 0x00000000, 0x00000000) = 0
kioctl(3, 21505, 0x20008180, 0x00000000) = 0
kioctl(3, 1074295912, 0x20006F9C, 0x00000000) = 0
kioctl(0, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
kioctl(1, 22528, 0x00000000, 0x00000000) = 0
_getpid() = 447136
kioctl(0, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
klseek(0, 0, 0, 0x00000001) = 0
kioctl(0, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
ngetsockname(0, 0x2FF225E8, 0x2FF225F8) Err#57 ENOTSOCK
klseek(1, 0, 0, 0x00000001) = 0
kioctl(1, 22528, 0x00000000, 0x00000000) = 0
kioctl(1, 22528, 0x00000000, 0x00000000) = 0
kioctl(1, 21505, 0x20020D78, 0x00000000) = 0
klseek(2, 0, 0, 0x00000001) = 0
kioctl(2, 22528, 0x00000000, 0x00000000) = 0
kioctl(2, 22528, 0x00000000, 0x00000000) = 0
kioctl(2, 21505, 0x20022F38, 0x00000000) = 0
kfcntl(0, F_GETFL, 0x00000001) = 67108864
kioctl(0, -2147195266, 0x2FF22578, 0x00000000) = 0
kioctl(0, -2147195267, 0x2FF22578, 0x00000000) = 0
kfcntl(0, F_SETFL, 0x04000004) = 0
kfcntl(0, F_GETFL, 0x2FF22FFC) = 67108868
kioctl(2, 22528, 0x00000000, 0x00000000) = 0
kfcntl(2, F_GETFL, 0x00000001) = 67110914
kioctl(2, -2147195266, 0x2FF22578, 0x00000000) Err#123 ENOSTR
kioctl(2, -2147195267, 0x2FF22578, 0x00000000) = 0
kfcntl(2, F_SETFL, 0x04000806) = 0
kfcntl(2, F_GETFL, 0x2FF22FFC) = 67110918
kfcntl(3, F_SETFD, 0x00000001) = 0
kfcntl(3, F_GETFL, 0x00000001) = 2
kioctl(3, -2147195266, 0x2FF22578, 0x00000000) Err#123 ENOSTR
kioctl(3, -2147195267, 0x2FF22578, 0x00000000) = 0
kfcntl(3, F_SETFL, 0x00000006) = 0
kfcntl(3, F_GETFL, 0x2FF22FFC) = 6
_sigaction(2, 0x2FF22400, 0x2FF22410) = 0
_sigaction(15, 0x2FF22400, 0x2FF22410) = 0
kioctl(0, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
open("/usr/local/lib/expect5.43/expect.rc", O_RDONLY) Err#2 ENOENT
open("/grs1/home/tst/.expect.rc", O_RDONLY) Err#2 ENOENT
kioctl(0, 22528, 0x00000000, 0x00000000) Err#25 ENOTTY
kread(0, " i f [ c a t c h {".., 4096) = 150
kwrite(1, " s p a w n", 5) = 5
kwrite(1, " ", 1) = 1
kwrite(1, " t e l n e t", 6) = 6
kwrite(1, " ", 1) = 1
kwrite(1, " l o c a l h o s t", 9) = 9
kwrite(1, " ", 1) = 1
kwrite(1, " 7 7 0 0", 4) = 4
kwrite(1, "\r\r\n", 3) = 3
open("/dev/ptc", O_RDWR) = 4
kioctl(4, 22529, 0x2FF20594, 0x00000000) = 0
statx("/dev/pts/15", 0x2FF205B8, 76, 0) = 0
kfcntl(4, F_SETFD, 0x00000001) = 0
pipe(0x2FF20C08) = 0
pipe(0x2FF20C10) = 0
pipe(0x2FF20C18) = 0
kfork() = 328562
close(6) = 0
close(7) = 0
close(10) = 0
kfcntl(4, F_SETFD, 0x00000001) = 0
kfcntl(4, F_GETFL, 0x00000001) = 2
kioctl(4, -2147195266, 0x2FF20858, 0x00000000) Err#123 ENOSTR
kioctl(4, -2147195267, 0x2FF20858, 0x00000000) = 0
kfcntl(4, F_SETFL, 0x00000006) = 0
kfcntl(4, F_GETFL, 0x2FF22FFC) = 6
kread(5, " ", 1) = 1
kwrite(8, " ", 1) = 1
close(5) = 0
close(8) = 0
kread(9, "\0\0\002", 4) = 0
close(9) = 0
_select(5, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF20BE0) = 1
kread(4, " T r y i n g . . .\r\n C".., 4096) = 36
kwrite(1, " T r y i n g . . .\r\n C".., 36) = 36
_select(5, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF20BE0) = 1
kread(4, " E s c a p e c h a r a".., 4096) = 27
kwrite(1, " E s c a p e c h a r a".., 27) = 27
_select(5, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF20BE0) = 1
kread(4, " 0\r\n\r\r\n = = > a r a".., 4096) = 9
kwrite(1, " 0\r\n\r\r\n = = >", 9) = 9
_select(0, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF207C0) = 0
kwrite(4, " r e s t a r t _ o b r ".., 16) = 16
kread(0, " i f [ c a t c h {".., 4096) = 0
kioctl(3, 22528, 0x00000000, 0x00000000) = 0
kfcntl(4, F_GETFL, 0x00000000) = 6
kioctl(4, -2147195266, 0x2FF220F8, 0x00000000) Err#123 ENOSTR
kioctl(4, -2147195267, 0x2FF220F8, 0x00000000) = 0
kfcntl(4, F_SETFL, 0x00000002) = 0
kfcntl(4, F_GETFL, 0x2FF22FFC) = 2
close(4) = 0
open("/dev/null", O_RDONLY) = 4
kfcntl(4, F_SETFD, 0x00000001) = 0
kfcntl(3, F_GETFL, 0x00000000) = 6
kioctl(3, -2147195266, 0x2FF220F8, 0x00000000) Err#123 ENOSTR
kioctl(3, -2147195267, 0x2FF220F8, 0x00000000) = 0
kfcntl(3, F_SETFL, 0x00000002) = 0
kfcntl(3, F_GETFL, 0x2FF22FFC) = 2
close(3) = 0
open("/dev/null", O_RDONLY) = 3
kfcntl(3, F_SETFD, 0x00000001) = 0
kfcntl(2, F_GETFL, 0x00000000) = 67110918
kioctl(2, -2147195266, 0x2FF220F8, 0x00000000) Err#123 ENOSTR
kioctl(2, -2147195267, 0x2FF220F8, 0x00000000) = 0
kfcntl(2, F_SETFL, 0x04000802) = 0
kfcntl(2, F_GETFL, 0x2FF22FFC) = 67110914
close(2) = 0
open("/dev/null", O_RDONLY) = 2
kfcntl(2, F_SETFD, 0x00000001) = 0
kfcntl(0, F_GETFL, 0x00000000) = 67108868
kioctl(0, -2147195266, 0x2FF220F8, 0x00000000) = 0
kioctl(0, -2147195267, 0x2FF220F8, 0x00000000) = 0
kfcntl(0, F_SETFL, 0x04000000) = 0
kfcntl(0, F_GETFL, 0x2FF22FFC) = 67108864
kwrite(1, 0x20035748, 0) = 0
_nsleep(0x2FF22138, 0x2FF221B0) = 0
close(0) = 0
close(1) = 0
open("/dev/null", O_RDONLY) = 0
kfcntl(0, F_SETFD, 0x00000001) = 0
kfcntl(4, F_GETFL, 0x00000000) = 0
kioctl(4, -2147195266, 0x2FF22150, 0x00000000) Err#19 ENODEV
kioctl(4, -2147195267, 0x2FF22150, 0x00000000) Err#19 ENODEV
kfcntl(4, F_SETFL, 0x00000000) = 0
kfcntl(4, F_GETFL, 0x2FF22FFC) = 0
close(4) = 0
kfcntl(3, F_GETFL, 0x00000000) = 0
kioctl(3, -2147195266, 0x2FF22150, 0x00000000) Err#19 ENODEV
kioctl(3, -2147195267, 0x2FF22150, 0x00000000) Err#19 ENODEV
kfcntl(3, F_SETFL, 0x00000000) = 0
kfcntl(3, F_GETFL, 0x2FF22FFC) = 0
close(3) = 0
kfcntl(2, F_GETFL, 0x00000000) = 0
kioctl(2, -2147195266, 0x2FF22150, 0x00000000) Err#19 ENODEV
kioctl(2, -2147195267, 0x2FF22150, 0x00000000) Err#19 ENODEV
kfcntl(2, F_SETFL, 0x00000000) = 0
kfcntl(2, F_GETFL, 0x2FF22FFC) = 0
close(2) = 0
kfcntl(2, F_GETFL, 0x00000000) Err#9 EBADF
kioctl(2, -2147195266, 0x2FF22160, 0x00000000) Err#9 EBADF
kioctl(2, -2147195267, 0x2FF22160, 0x00000000) Err#9 EBADF
kfcntl(2, F_SETFL, 0xFFFFFFFB) Err#9 EBADF
kfcntl(1, F_GETFL, 0x00000000) Err#9 EBADF
kioctl(1, -2147195266, 0x2FF22160, 0x00000000) Err#9 EBADF
kioctl(1, -2147195267, 0x2FF22160, 0x00000000) Err#9 EBADF
kfcntl(1, F_SETFL, 0xFFFFFFFB) Err#9 EBADF
kfcntl(0, F_GETFL, 0x00000000) = 0
kioctl(0, -2147195266, 0x2FF22160, 0x00000000) Err#19 ENODEV
kioctl(0, -2147195267, 0x2FF22160, 0x00000000) Err#19 ENODEV
kfcntl(0, F_SETFL, 0x00000000) = 0
kfcntl(0, F_GETFL, 0x2FF22FFC) = 0
kfcntl(0, F_GETFL, 0x00000000) = 0
kioctl(0, -2147195266, 0x2FF22150, 0x00000000) Err#19 ENODEV
kioctl(0, -2147195267, 0x2FF22150, 0x00000000) Err#19 ENODEV
kfcntl(0, F_SETFL, 0x00000000) = 0
kfcntl(0, F_GETFL, 0x2FF22FFC) = 0
kwrite(1, 0x20035748, 0) Err#9 EBADF
close(0) = 0
kfcntl(1, F_GETFL, 0x200040D4) Err#9 EBADF
kfcntl(2, F_GETFL, 0x2FF22FF8) Err#9 EBADF
_exit(0)
konst@konst://.../konst>

after I uncomment close stdout trace changes as follows
1c1
< execve("/usr/local/bin/expect", 0x2FF22934, 0x2FF2293C) argc: 1
---
> execve("/usr/local/bin/expect", 0x2FF22910, 0x2FF22918) argc: 1
3c3
< _sigaction(13, 0x2FF22738, 0x2FF22748) = 0
---
> _sigaction(13, 0x2FF22718, 0x2FF22728) = 0
7c7
< uname(0x2FF22658) = 0
---
> uname(0x2FF22638) = 0
11c11
< statx("/usr/local/bin/expect", 0x2FF223E0, 128, 010) = 0
---
> statx("/usr/local/bin/expect", 0x2FF223C0, 128, 010) = 0
19,24c19,24
< statx("/", 0x2FF206A8, 128, 011) = 0
< statx("/usr", 0x2FF206A8, 128, 011) = 0
< statx("/usr/local", 0x2FF206A8, 128, 011) = 0
< statx("/usr/local/lib", 0x2FF206A8, 128, 011) = 0
< statx("/usr/local/lib/tcl8.4", 0x2FF206A8, 128, 011) = 0
< statx("/usr/local/lib/tcl8.4/encoding", 0x2FF206A8, 128, 011) = 0
---
> statx("/", 0x2FF20688, 128, 011) = 0
> statx("/usr", 0x2FF20688, 128, 011) = 0
> statx("/usr/local", 0x2FF20688, 128, 011) = 0
> statx("/usr/local/lib", 0x2FF20688, 128, 011) = 0
> statx("/usr/local/lib/tcl8.4", 0x2FF20688, 128, 011) = 0
> statx("/usr/local/lib/tcl8.4/encoding", 0x2FF20688, 128, 011) = 0
38,42c38,42
< statx("/", 0x2FF20048, 128, 011) = 0
< statx("/usr", 0x2FF20048, 128, 011) = 0
< statx("/usr/local", 0x2FF20048, 128, 011) = 0
< statx("/usr/local/lib", 0x2FF20048, 128, 011) = 0
< statx("/usr/local/lib/tcl8.4", 0x2FF20048, 128, 011) = 0
---
> statx("/", 0x2FF20028, 128, 011) = 0
> statx("/usr", 0x2FF20028, 128, 011) = 0
> statx("/usr/local", 0x2FF20028, 128, 011) = 0
> statx("/usr/local/lib", 0x2FF20028, 128, 011) = 0
> statx("/usr/local/lib/tcl8.4", 0x2FF20028, 128, 011) = 0
44c44
< statx("/usr/local/lib/tcl8.4/init.tcl", 0x2FF21AE8, 128, 010) = 0
---
> statx("/usr/local/lib/tcl8.4/init.tcl", 0x2FF21AC8, 128, 010) = 0
57c57
< _getpid() = 447136
---
> _getpid() = 442994
64c64
< _getpid() = 447136
---
> _getpid() = 442994
68c68
< ngetsockname(0, 0x2FF225E8, 0x2FF225F8) Err#57 ENOTSOCK
---
> ngetsockname(0, 0x2FF225C8, 0x2FF225D8) Err#57 ENOTSOCK
72c72
< kioctl(1, 21505, 0x20020D78, 0x00000000) = 0
---
> kioctl(1, 21505, 0x20020DE8, 0x00000000) = 0
76,81c76,81
< kioctl(2, 21505, 0x20022F38, 0x00000000) = 0
< kfcntl(0, F_GETFL, 0x00000001) = 67108864
< kioctl(0, -2147195266, 0x2FF22578, 0x00000000) = 0
< kioctl(0, -2147195267, 0x2FF22578, 0x00000000) = 0
< kfcntl(0, F_SETFL, 0x04000004) = 0
< kfcntl(0, F_GETFL, 0x2FF22FFC) = 67108868
---
> kioctl(2, 21505, 0x20022FA8, 0x00000000) = 0
> kfcntl(0, F_GETFL, 0x00000001) = 2
> kioctl(0, -2147195266, 0x2FF22558, 0x00000000) = 0
> kioctl(0, -2147195267, 0x2FF22558, 0x00000000) = 0
> kfcntl(0, F_SETFL, 0x00000006) = 0
> kfcntl(0, F_GETFL, 0x2FF22FFC) = 6
84,85c84,85
< kioctl(2, -2147195266, 0x2FF22578, 0x00000000) Err#123 ENOSTR
< kioctl(2, -2147195267, 0x2FF22578, 0x00000000) = 0
---
> kioctl(2, -2147195266, 0x2FF22558, 0x00000000) Err#123 ENOSTR
> kioctl(2, -2147195267, 0x2FF22558, 0x00000000) = 0
90,91c90,91
< kioctl(3, -2147195266, 0x2FF22578, 0x00000000) Err#123 ENOSTR
< kioctl(3, -2147195267, 0x2FF22578, 0x00000000) = 0
---
> kioctl(3, -2147195266, 0x2FF22558, 0x00000000) Err#123 ENOSTR
> kioctl(3, -2147195267, 0x2FF22558, 0x00000000) = 0
94,95c94,95
< _sigaction(2, 0x2FF22400, 0x2FF22410) = 0
< _sigaction(15, 0x2FF22400, 0x2FF22410) = 0
---
> _sigaction(2, 0x2FF223E0, 0x2FF223F0) = 0
> _sigaction(15, 0x2FF223E0, 0x2FF223F0) = 0
100c100
< kread(0, " i f [ c a t c h {".., 4096) = 150
---
> kread(0, " i f [ c a t c h {".., 4096) = 149
110,111c110,111
< kioctl(4, 22529, 0x2FF20594, 0x00000000) = 0
< statx("/dev/pts/15", 0x2FF205B8, 76, 0) = 0
---
> kioctl(4, 22529, 0x2FF20574, 0x00000000) = 0
> statx("/dev/pts/12", 0x2FF20598, 76, 0) = 0
113,116c113,116
< pipe(0x2FF20C08) = 0
< pipe(0x2FF20C10) = 0
< pipe(0x2FF20C18) = 0
< kfork() = 328562
---
> pipe(0x2FF20BE8) = 0
> pipe(0x2FF20BF0) = 0
> pipe(0x2FF20BF8) = 0
> kfork() = 312166
122,123c122,123
< kioctl(4, -2147195266, 0x2FF20858, 0x00000000) Err#123 ENOSTR
< kioctl(4, -2147195267, 0x2FF20858, 0x00000000) = 0
---
> kioctl(4, -2147195266, 0x2FF20838, 0x00000000) Err#123 ENOSTR
> kioctl(4, -2147195267, 0x2FF20838, 0x00000000) = 0
132c132
< _select(5, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF20BE0) = 1
---
> _select(5, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF20BC0) = 1
135c135
< _select(5, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF20BE0) = 1
---
> _select(5, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF20BC0) = 1
138c138
< _select(5, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF20BE0) = 1
---
> _select(5, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF20BC0) = 1
141c141
< _select(0, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF207C0) = 0
---
> _select(0, 0x2000E65C, 0x2001065C, 0x2001265C, 0x2FF207A0) = 0
142a143
> close(1) = 0
146,147c147,148
< kioctl(4, -2147195266, 0x2FF220F8, 0x00000000) Err#123 ENOSTR
< kioctl(4, -2147195267, 0x2FF220F8, 0x00000000) = 0
---
> kioctl(4, -2147195266, 0x2FF220D8, 0x00000000) Err#123 ENOSTR
> kioctl(4, -2147195267, 0x2FF220D8, 0x00000000) = 0
151c152,154
< open("/dev/null", O_RDONLY) = 4
---
> open("/dev/null", O_RDONLY) = 1
> kfcntl(1, F_DUPFD, 0x00000004) = 4
> close(1) = 0
154,155c157,158
< kioctl(3, -2147195266, 0x2FF220F8, 0x00000000) Err#123 ENOSTR
< kioctl(3, -2147195267, 0x2FF220F8, 0x00000000) = 0
---
> kioctl(3, -2147195266, 0x2FF220D8, 0x00000000) Err#123 ENOSTR
> kioctl(3, -2147195267, 0x2FF220D8, 0x00000000) = 0
159c162,164
< open("/dev/null", O_RDONLY) = 3
---
> open("/dev/null", O_RDONLY) = 1
> kfcntl(1, F_DUPFD, 0x00000003) = 3
> close(1) = 0
162,163c167,168
< kioctl(2, -2147195266, 0x2FF220F8, 0x00000000) Err#123 ENOSTR
< kioctl(2, -2147195267, 0x2FF220F8, 0x00000000) = 0
---
> kioctl(2, -2147195266, 0x2FF220D8, 0x00000000) Err#123 ENOSTR
> kioctl(2, -2147195267, 0x2FF220D8, 0x00000000) = 0
167c172,174
< open("/dev/null", O_RDONLY) = 2
---
> open("/dev/null", O_RDONLY) = 1
> kfcntl(1, F_DUPFD, 0x00000002) = 2
> close(1) = 0
169,175c176,181
< kfcntl(0, F_GETFL, 0x00000000) = 67108868
< kioctl(0, -2147195266, 0x2FF220F8, 0x00000000) = 0
< kioctl(0, -2147195267, 0x2FF220F8, 0x00000000) = 0
< kfcntl(0, F_SETFL, 0x04000000) = 0
< kfcntl(0, F_GETFL, 0x2FF22FFC) = 67108864
< kwrite(1, 0x20035748, 0) = 0
< _nsleep(0x2FF22138, 0x2FF221B0) = 0
---
> kfcntl(0, F_GETFL, 0x00000000) = 6
> kioctl(0, -2147195266, 0x2FF220D8, 0x00000000) = 0
> kioctl(0, -2147195267, 0x2FF220D8, 0x00000000) = 0
> kfcntl(0, F_SETFL, 0x00000002) = 0
> kfcntl(0, F_GETFL, 0x2FF22FFC) = 2
> kwrite(1, 0x200357B8, 0) Err#9 EBADF
177c183
< close(1) = 0
---
> close(1) Err#9 EBADF
181,182c187,188
< kioctl(4, -2147195266, 0x2FF22150, 0x00000000) Err#19 ENODEV
< kioctl(4, -2147195267, 0x2FF22150, 0x00000000) Err#19 ENODEV
---
> kioctl(4, -2147195266, 0x2FF22130, 0x00000000) Err#19 ENODEV
> kioctl(4, -2147195267, 0x2FF22130, 0x00000000) Err#19 ENODEV
187,188c193,194
< kioctl(3, -2147195266, 0x2FF22150, 0x00000000) Err#19 ENODEV
< kioctl(3, -2147195267, 0x2FF22150, 0x00000000) Err#19 ENODEV
---
> kioctl(3, -2147195266, 0x2FF22130, 0x00000000) Err#19 ENODEV
> kioctl(3, -2147195267, 0x2FF22130, 0x00000000) Err#19 ENODEV
193,194c199,200
< kioctl(2, -2147195266, 0x2FF22150, 0x00000000) Err#19 ENODEV
< kioctl(2, -2147195267, 0x2FF22150, 0x00000000) Err#19 ENODEV
---
> kioctl(2, -2147195266, 0x2FF22130, 0x00000000) Err#19 ENODEV
> kioctl(2, -2147195267, 0x2FF22130, 0x00000000) Err#19 ENODEV
199,200c205,206
< kioctl(2, -2147195266, 0x2FF22160, 0x00000000) Err#9 EBADF
< kioctl(2, -2147195267, 0x2FF22160, 0x00000000) Err#9 EBADF
---
> kioctl(2, -2147195266, 0x2FF22140, 0x00000000) Err#9 EBADF
> kioctl(2, -2147195267, 0x2FF22140, 0x00000000) Err#9 EBADF
202,205d207
< kfcntl(1, F_GETFL, 0x00000000) Err#9 EBADF
< kioctl(1, -2147195266, 0x2FF22160, 0x00000000) Err#9 EBADF
< kioctl(1, -2147195267, 0x2FF22160, 0x00000000) Err#9 EBADF
< kfcntl(1, F_SETFL, 0xFFFFFFFB) Err#9 EBADF
207,208c209,210
< kioctl(0, -2147195266, 0x2FF22160, 0x00000000) Err#19 ENODEV
< kioctl(0, -2147195267, 0x2FF22160, 0x00000000) Err#19 ENODEV
---
> kioctl(0, -2147195266, 0x2FF22140, 0x00000000) Err#19 ENODEV
> kioctl(0, -2147195267, 0x2FF22140, 0x00000000) Err#19 ENODEV
212,213c214,215
< kioctl(0, -2147195266, 0x2FF22150, 0x00000000) Err#19 ENODEV
< kioctl(0, -2147195267, 0x2FF22150, 0x00000000) Err#19 ENODEV
---
> kioctl(0, -2147195266, 0x2FF22130, 0x00000000) Err#19 ENODEV
> kioctl(0, -2147195267, 0x2FF22130, 0x00000000) Err#19 ENODEV
216c218
< kwrite(1, 0x20035748, 0) Err#9 EBADF
---
> kwrite(1, 0x200357B8, 0) Err#9 EBADF

at this time expect doesn't hang

I can see some changes in open("/dev/null"), dup2() and close().


Konstantin
.



Relevant Pages

  • Re: expect + telnet hangs on AIX
    ... >>> The question is not about connection refused. ... >>> The question is why expect hangs. ... >>> via telnet. ... >This means that the program(or script) never returns. ...
    (comp.lang.tcl)
  • Re: expect + telnet hangs on AIX
    ... >> The question is not about connection refused. ... >> The question is why expect hangs. ... >> via telnet. ... This means that the program(or script) never returns. ...
    (comp.lang.tcl)
  • Re: A few questions, if somebody could please assist -ive been doing my head in to get my vba pr
    ... Dim c As String, wdth As Double ... as for telnet, I would look for a telnet program that can be scripted. ... spreadsheet the userform i have made runs from. ... script files like the ftp does and any telnt code i have seen has lost me ...
    (microsoft.public.excel.programming)
  • os.popen3 hangs in Windows XP SP1, SP2. Python 2.5 & 2.4. Consistent test case.
    ... I have a consistent test case where os.popen3hangs in Windows. ... system hangs when retrieving the lines from the child process stdout. ... The program runs properly if it then executes the following code ... print 'program exit code: ', ...
    (comp.lang.python)
  • SOLUTION: Keeping Telnet Session Open
    ... After more tinkering with my expect script, ... > Thanks to several people for responding. ... > see the telnet running in the psoutput. ... > the other end is accepting the connection. ...
    (SunManagers)