classification
Title: Skip libpthread related test failures on OpenBSD
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: djmdjm, exarkun, henry.precheur, mark.dickinson, pitrou, skrah
Priority: normal Keywords: needs review, patch

Created on 2010-05-14 14:13 by skrah, last changed 2013-01-17 12:31 by skrah. This issue is now closed.

Files
File name Uploaded Description Edit
openbsd_libpthread_skips.patch skrah, 2010-05-14 14:13 review
Messages (7)
msg105709 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-05-14 14:13
[Added OpenBSD Python port maintainers to the nosy list.]

I've identified a number of tests that all pass when Python is compiled
without threads, but fail otherwise. The failures are probably caused
by libpthread issues in OpenBSD, as described in this patch:


http://www.openbsd.org/cgi-bin/cvsweb/ports/lang/python/2.6/patches/patch-Lib_test_test_signal_py


Would you agree that it is reasonable to skip all these tests until
libpthread is fixed?
msg105711 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-05-14 14:40
This looks reasonable. Perhaps you should add a reference to the relevant OpenBSD bug number(s) or URL(s), if any.
msg105727 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2010-05-14 17:54
In addition to skipping the tests, would it also make sense to document these known limitations of Python threading on OpenBSD somewhere that end users might see it?
msg105799 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-05-15 11:10
I can't pinpoint the exact causes for each individual test failure. I assumed that they are caused by threading/signal issues, because the tests pass when Python is compiled --without-threads.


But here's a list of possible culprits for future reference:

[pthread's execve(2) breaks close(2)]
http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yes&numbers=6183

[SIGCHLD handler is called at bad timing when linked to libpthread]
http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yes&numbers=6273

[pthread: 100% CPU usage after execv]
http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yes&numbers=6376

[pthread: file descriptors are "pseudo-blocking"]
http://www.mail-archive.com/misc@openbsd.org/msg80643.html

[test_siginterrupt_off broken by libpthread's internal hooking of signals]
[test_itimer_prof broken by libpthread's internal use of SIGPROF]
http://www.openbsd.org/cgi-bin/cvsweb/ports/lang/python/2.6/patches/patch-Lib_test_test_signal_py
msg105800 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-05-15 11:28
The FreeBSD-6.4-RELEASE-i386 buildbot has similar libpthread issues.

This is just in:

======================================================================
FAIL: test_send_signal (test.test_subprocess.POSIXProcessTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_subprocess.py", line 770, in test_send_signal
    self.assertIn(b'KeyboardInterrupt', stderr)
AssertionError: b'KeyboardInterrupt' not found in b''


Re documentation:

Another approach would be to configure builds on systems with known
threading issues --without-threads by default. Advantages:

  a) Users will be immediately aware of the issues.

  b) Less work with the FreeBSD-6.4 buildbot.

  c) The --without-threads path is actually tested regularly.
msg105837 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-05-15 23:13
The gentoo-3.x buildbot also shows the threading problems again:

test test_subprocess failed -- Traceback (most recent call last):
  File "/home/buildslave/python-trunk/3.x.norwitz-x86/build/Lib/test/test_subprocess.py", line 770, in test_send_signal
    self.assertIn(b'KeyboardInterrupt', stderr)
AssertionError: b'KeyboardInterrupt' not found in b''


References:

[gentoo-3.x]
http://bugs.python.org/issue4970

[freebsd-6.4]
http://bugs.python.org/issue3864
msg180126 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2013-01-17 12:31
All threading issues are fixed in OpenBSD 5.2.
History
Date User Action Args
2013-01-17 12:31:10skrahsetstatus: open -> closed
resolution: out of date
messages: + msg180126

stage: patch review -> resolved
2010-05-15 23:13:55skrahsetmessages: + msg105837
2010-05-15 11:28:24skrahsetmessages: + msg105800
2010-05-15 11:10:29skrahsetmessages: + msg105799
2010-05-14 17:54:08exarkunsetmessages: + msg105727
2010-05-14 14:40:57pitrousetnosy: + pitrou, exarkun, mark.dickinson
messages: + msg105711
2010-05-14 14:13:56skrahcreate