[Python-bugs-list] [Bug #115221] test_poll hangs on Debian Linux 2.2

noreply@sourceforge.net noreply@sourceforge.net
Wed, 11 Oct 2000 16:44:52 -0700


Bug #115221, was updated on 2000-Sep-24 07:38
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Open
Resolution: None
Bug Group: Platform-specific
Priority: 7
Summary: test_poll hangs on Debian Linux 2.2

Details: When run from the command-line test_poll.py prints
"This is a test." 12 times and then hangs, without ever printing "Poll test 1 complete".

All other tests seem to work just fine.

Follow-Ups:

Date: 2000-Sep-27 10:58
By: nascheme

Comment:
I can't reproduce this on my Debian 2.2 system running Linux
 2.2.16.  Can you give the output from "uname -a" and "dpkg 
-l libc6"?  I am using libc6 2.1.3-13.
-------------------------------------------------------

Date: 2000-Oct-05 07:17
By: jhylton

Comment:
Andrew -- Is this still a problem for you?  
-------------------------------------------------------

Date: 2000-Oct-05 07:52
By: akuchling

Comment:
I don't have a Debian system to reproduce this on.

-------------------------------------------------------

Date: 2000-Oct-05 08:43
By: larsga

Comment:
I did a "cvs update", recompiled and ran the regtest again. Problem still persists.

Traceback is
Traceback (most recent call last):
  File "test_poll.py", line 171, in ?
    test_poll1()
  File "test_poll.py", line 65, in test_poll1
    poll_unit_tests()
  File "test_poll.py", line 77, in poll_unit_tests
    r = p.poll()
KeyboardInterrupt

[larsga@pc-larsga test]$ uname -a
Linux pc-larsga 2.0.36 #2 Sun Jan 17 19:38:45 EST 1999 i686 unknown
[larsga@pc-larsga test]$ dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  libc6          2.1.3-10       GNU C Library: Shared libraries and Timezone

-------------------------------------------------------

Date: 2000-Oct-05 08:48
By: akuchling

Comment:
Interesting; Neil has libc6-2.1.3-13, while Lars has 2.1.3-10.  Presumably that last tag is a release level?

On the other hand, Neil is running a 2.2 Linux while Lars is running 2.0.36, and Neil also reported problems with
poll on a 2.0 machine.  So the finger of suspicion is pointing at the kernel...
-------------------------------------------------------

Date: 2000-Oct-07 08:43
By: twouters

Comment:
When running test_poll on the current CVS tree on RedHat 5.2 with a 2.0.36 kernel, I also get a test_poll error, though not the same one:

 This is a test.
 This is a test.
[...]
test test_poll crashed -- select.error: (9, 'Bad file descriptor')
Traceback (most recent call last):
  File "Lib/test/regrtest.py", line 235, in runtest
    __import__(test, globals(), locals(), [])
  File "./Lib/test/test_poll.py", line 171, in ?
    test_poll1()
  File "./Lib/test/test_poll.py", line 65, in test_poll1
    poll_unit_tests()
  File "./Lib/test/test_poll.py", line 77, in poll_unit_tests
    r = p.poll()
error: (9, 'Bad file descriptor')
1 test failed: test_poll

RedHat 5.2 with a 2.2 kernel works fine. Let me know if you want me to submit a separate bugreport for the rh52-kernel2.0-poll error.

-------------------------------------------------------

Date: 2000-Oct-11 16:44
By: jhylton

Comment:
Would this patch fix the most recently reported problem?

Index: Lib/test/test_poll.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_poll.py,v
retrieving revision 1.3
diff -c -r1.3 test_poll.py
*** Lib/test/test_poll.py       2000/08/29 16:53:34     1.3
--- Lib/test/test_poll.py       2000/10/11 23:44:31
***************
*** 74,81 ****
          pass
      p = select.poll()
      p.register(FD)
!     r = p.poll()
!     assert r[0] == (FD, select.POLLNVAL)
  
      f = open(TESTFN, 'w')
      fd = f.fileno()
--- 74,87 ----
          pass
      p = select.poll()
      p.register(FD)
!     try:
!         r = p.poll()
!     except select.error, msg:
!         # old versions of Linux seem to raise an exception instead of
!         # returning POLLNVAL 
!         pass
!     else:
!         assert r[0] == (FD, select.POLLNVAL)
  
      f = open(TESTFN, 'w')
      fd = f.fileno()

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=115221&group_id=5470