[Python-bugs-list] Follow up to bug platformbug/401 (PR#416)

andyg@one.net.au andyg@one.net.au
Thu, 27 Jul 2000 19:33:01 -0400 (EDT)


I'm not sure how I am to reply to Jeremy's notes in regards to my posted
bug.
Hopefully this will be successful.

I've include a copy of the details of the bug below.  In reply to Jeremy's
notes;

Hi, thanks for replying ;)
I'm not sure if it is a configuration problem.  I can reproduce the problem
on all sun
boxes I have tried, including some badly set up systems installed a couple
of years
ago, and a recently installed system set up by a sun expert.

Note, it's not the socket.gethostbyname call which hangs the system.  You
can pretty much do whatever you like between the socket.gethostbyname call
and the
os.system call and everything will be fine.  It's during the os.system call
that python
hangs.  Although without the prior socket.gethostbyname call, the os.system
call will
never hang.  After it has hung there are two python instances in memory.
Here's a
ps taken while the process is hang :

   andyg  9766 23356  0 17:03:18 pts/12   0:00 /usr/local/bin/python
./fred.py
   andyg  9767  9766  0 17:03:18 pts/12   0:00 /usr/local/bin/python
./fred.py

If you kill the child nicely, the parent continues on executing code after
the os.system call.
However, if you upset the parent by hitting ctrl-c in the hang screen for
instance, the child
will no longer respond to a nice kill.  The parent will remain hang.  It
then requires a kill -9 against
the child to get rid of both process.  This brings the parent back to the
command prompt.

Just a thought - could this have anything to do with python1.5.2's known
problem with cleaning
up after popen2 commands on sun machines ?

The hostnames which hang are being resolved from the /etc/hosts file.
socket.gethostbyname
doesn't seem to resolve things which I can resolve with nslookup, but which
aren't in the /etc/hosts
file (perhaps I am using it wrong?).  I put a host which is definately in a
different domain in the
/etc/hosts file (www.yahoo.com 204.71.200.74).  It hang as well.

Thanks for your help.

Andy.
-----------------------------------
Logged in as guest

Viewing platformbug/401
Full headers

From: andyg@one.net.au
Subject: combination of socket.gethostbyname and os.system hangs program
Compose reply
Download message

Move To:
0 replies:
0 followups:

Private message: yes  no

Notes:

Notification:
This sounds like a configuration problem on your local machine, although I
don't
have a Solaris box to test it on.  How is the hostname that is hanging being
looked up?  Do you get the same behavior if you use a different name
service,
e.g. a name in a different domain?

From: andyg@one.net.au
To: bugs-py@python.org
Subject: combination of socket.gethostbyname and os.system hangs program
Date: Mon, 17 Jul 2000 04:26:12 -0400 (EDT)

Full_Name: Andy Gayton
Version: Python 1.5.2 (#3, Jun 29 2000, 15:52:04)  [GCC 2.8.1] on sunos5
OS: SunOS psol002 5.6 Generic_105181-21 sun4u sparc SUNW,Ultra-Enterprise
Submission from: syd-cache01.one.net.au (203.101.17.53)


A combination of socket.gethostbyname and os.system appears to hang
python intermittently.  We run Dec and Sun systems - it only appears
to be a problem with sun systems.

The following is the simplest way I can reproduce the problem:

test.py:
--------------------------------
#!/usr/local/bin/python
import os
import socket
print socket.gethostbyname( "a hostname (but not localhost)" )
os.system("echo fred")

hang.sh:
--------------------------------
#!/bin/ksh
while true ; do
  ./test.py
done

output:
---------------------------------
10.666.666.666
fred
10.666.666.666
fred
... eventually ...
10.666.666.666
<hung>

If "a hostname" is "localhost" it doesn't hang.  For anything else which it
can successfully resolve, it seems to hang.

Thanks !
Andy.


Up to top level
incoming   irreproducible   notabug   open   platformbug   request
resolved   trash   3rdpartybug

Logged in as guest
-----------------------------------------