Mailing List Archive

Trouble with httplib and IRIX
Hello,

I'm running python 1.5.2 and running it on IRIX 6.5.3 systems.

I have the following problem when i'm trying to connect to an
non-existing machine the program hangs forever. When i kill ,restart and run
it again, it gives an error message that it couldn't find the host. This is
the behaviour that i would expect the first time.

My question is does somebody else have encounter the same problems on a
IRIX machine?

-------------------- Python programm ------------------------

#!/usr/local/bin/python

import socket
import httplib


def main():


h = httplib.HTTP()
h.set_debuglevel(100)

try:
h.connect("www.nsrc.nus.sg")

except socket.error, detail:
print 'Connect failed: %s' %detail


main()

--
********************************************************************
* *
* Bas van der Vlies e-mail: basv@sara.nl *
* SARA - Academic Computing Services phone: +31 20 592 8012 *
* Kruislaan 415 fax: +31 20 6683167 *
* 1098 SJ Amsterdam *
* *
********************************************************************

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Trouble with httplib and IRIX [ In reply to ]
basv@sara.nl said:
> I'm running python 1.5.2 and running it on IRIX 6.5.3 systems.
> ...
> I have the following problem when i'm trying to connect to an
> non-existing machine the program hangs forever.

I don't get that behaviour using 1.5.2c1 or 1.5.1 on either of
our 6.5.2m machines.

max> pwd
/home/u05/dalke/ftps/Python-1.5.2c1
max> env PYTHONPATH=Lib ./python
Python 1.5.2c1 (#4, Apr 14 1999, 16:29:33) [C] on irix6
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import socket
>>> import httplib
>>> httplib.__file__
'Lib/httplib.pyc'
>>> def main():
... h = httplib.HTTP()
... h.set_debuglevel(100)
... try:
... h.connect("www.nsrc.nus.sg")
... except socket.error, detail:
... print 'Connect failed: %s' %detail
...
>>> main()
connect: ('www.nsrc.nus.sg', 80)
Connect failed: host not found
>>> ^D
max> uname -aR
IRIX64 max 6.5 6.5.2m 11051732 IP30

Can you attach a debugger or force a core dump and see where it's
hanging?

Andrew
dalke@acm.org
Trouble with httplib and IRIX [ In reply to ]
In article <3724CF13.C4680904@bioreason.com>,
Andrew Dalke <dalke@bioreason.com> wrote:
> basv@sara.nl said:
> > I'm running python 1.5.2 and running it on IRIX 6.5.3 systems.
> > ...
> > I have the following problem when i'm trying to connect to an
> > non-existing machine the program hangs forever.
>
> I don't get that behaviour using 1.5.2c1 or 1.5.1 on either of
> our 6.5.2m machines.
>
> max> pwd
> /home/u05/dalke/ftps/Python-1.5.2c1
> max> env PYTHONPATH=Lib ./python
> Python 1.5.2c1 (#4, Apr 14 1999, 16:29:33) [C] on irix6
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> import socket
> >>> import httplib
> >>> httplib.__file__
> 'Lib/httplib.pyc'
> >>> def main():
> ... h = httplib.HTTP()
> ... h.set_debuglevel(100)
> ... try:
> ... h.connect("www.nsrc.nus.sg")
> ... except socket.error, detail:
> ... print 'Connect failed: %s' %detail
> ...
> >>> main()
> connect: ('www.nsrc.nus.sg', 80)
> Connect failed: host not found
> >>> ^D
> max> uname -aR
> IRIX64 max 6.5 6.5.2m 11051732 IP30
>
> Can you attach a debugger or force a core dump and see where it's
> hanging?

I have attached the debugger to the process (dbx -p <pid>) and it gives
the following message:
Source (of /xlv57/6.5.3m/work/irix/lib/libc/libc_n32_M4/sys/nanosleep.s)
not available for Process 344004

Below is the output of the first 9 lines from the 'dbx' output:

0 __nanosleep(0x7fff1af8, 0x0, 0xfb545b8, 0x0, 0x101a3ef9, 0x250000, 0xf,
0x77) ["/xlv57/6.5.3m/work/irix/lib/libc/libc_n32_M4/sys/nanosleep.s":15,
0xfaf6e38] 1 _usleep(0x186a0, 0x0, 0xfb545b8, 0x5f5e100, 0x101a3ef9,
0x250000, 0xf, 0x77)
["/xlv57/6.5.3m/work/irix/lib/libc/libc_n32_M4/gen/usleep.c":46, 0xfa52f60]
2 _ns_lookup(0x7fff1af8, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0xf)
["/xlv57/6.5.3m/work/irix/lib/libc/libc_n32_M4/ns/ns_lookup.c":175,
0xfaa8610] 3 _gethostbyname_r(0x7fff1af8, 0x101970c0, 0x101a3ef0, 0x0,
0x101a3ef9, 0x250000, 0xf, 0x77)
["/xlv57/6.5.3m/work/irix/lib/libc/libc_n32_M4/ns/ns_hosts.c":470, 0xfb165f8]
4 _gethostbyname(0x101a03e4, 0x0, 0xfb545b8, 0x0, 0x101a3ef9, 0x250000, 0xf,
0x77) ["/xlv57/6.5.3m/work/irix/lib/libc/libc_n32_M4/ns/ns_hosts.c":532,
0xfb16880] 5 setipaddr(0x101a03e4, 0x0, 0xfb545b8, 0x0, 0x101a3ef9,
0x250000, 0xf, 0x77)
["/home/sara/bas/src/applications/Python/Python-1.5.2/Modules/socketmodule.c"
:404, 0x1006f6d0] 6 getsockaddrarg(0x7fff1af8, 0x0, 0x0, 0x0, 0x101a3ef9,
0x0, 0xf, 0x77)
["/home/sara/bas/src/applications/Python/Python-1.5.2/Modules/socketmodule.c"
:544, 0x1006f980] 7 PySocketSock_connect(0x0, 0x0, 0xfb545b8, 0x0,
0x101a3ef9, 0x250000, 0xf, 0x77)
["/home/sara/bas/src/applications/Python/Python-1.5.2/Modules/socketmodule.c"
:851, 0x100701c8] 8 call_builtin(0x2, 0x0, 0xfb545b8, 0x0, 0x101a3ef9,
0x250000, 0xf, 0x77)
["/home/sara/bas/src/applications/Python/Python-1.5.2/Python/ceval.c":2359,
0x1003d798] 9 PyEval_CallObjectWithKeywords(0x1019c028, 0x101970e0, 0x0,
0x0, 0x101a3ef9, 0x250000, 0xf, 0x77)
["/home/sara/bas/src/applications/Python/Python-1.5.2/Python/ceval.c":2324,
0x1003d4b0]

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Trouble with httplib and IRIX [ In reply to ]
In article <7g3sgs$87n$1@nnrp1.dejanews.com>,
basv@sara.nl wrote:
> In article <3724CF13.C4680904@bioreason.com>,
> Andrew Dalke <dalke@bioreason.com> wrote:
> > basv@sara.nl said:
> > > I'm running python 1.5.2 and running it on IRIX 6.5.3 systems.
> > > ...
> > > I have the following problem when i'm trying to connect to an
> > > non-existing machine the program hangs forever.
> >
> > I don't get that behaviour using 1.5.2c1 or 1.5.1 on either of
> > our 6.5.2m machines.

This is a bug in 6.5.3, ping and telnet also hangs forever. I just
phoned SGI and they said that it will be fixed in 6.5.4


********************************************************************
* *
* Bas van der Vlies e-mail: basv@sara.nl *
* SARA - Academic Computing Services phone: +31 20 592 8012 *
* Kruislaan 415 fax: +31 20 6683167 *
* 1098 SJ Amsterdam *
* *
********************************************************************

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own