This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_signal failure
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: neologix, python-dev, skrah, vstinner
Priority: normal Keywords: patch

Created on 2011-10-01 09:48 by skrah, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
check_signum_order.diff neologix, 2011-10-01 14:24 review
Messages (5)
msg144718 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2011-10-01 09:48
Got this failure on Debian lenny amd64:

[1/1] test_signal
test test_signal failed -- Traceback (most recent call last):
  File "/home/stefan/cpython/Lib/test/test_signal.py", line 339, in test_pending
    """,  *signals)
  File "/home/stefan/cpython/Lib/test/test_signal.py", line 263, in check_wakeup
    assert_python_ok('-c', code)
  File "/home/stefan/cpython/Lib/test/script_helper.py", line 50, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/home/stefan/cpython/Lib/test/script_helper.py", line 42, in _assert_python
    "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 1, stderr follows:
Traceback (most recent call last):
  File "<string>", line 41, in <module>
  File "<string>", line 16, in check_signum
Exception: (10, 12) != (12, 10)

1 test failed:
    test_signal
[103837 refs]
msg144720 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2011-10-01 10:19
See http://bugs.python.org/issue12469, specifically http://bugs.python.org/issue12469#msg139831

"""
> > When signals are unblocked, pending signal ared delivered in the reverse order
> > of their number (also on Linux, not only on FreeBSD 6).
> 
> I don't like this.
> POSIX doesn't make any guarantee about signal delivery order, except
> for real-time signals.
> It might work on FreeBSD and Linux, but that's definitely not
> documented, and might break with new kernel releases, or other
> kernels.

It looks like it works like this on most OSes (Linux, Mac OS X, Solaris,
FreeBSD): I don't see any test_signal failure on 3.x buildbots. If we
have a failure, we can use set() again, but only for test_pending:
signal order should be reliable if signals are not blocked.
"""

Looks like we now have a failure :-)
msg144729 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-10-01 12:17
WakeupSignalTests.test_pending() doesn't really check our signal handler but more the operating system, especially pthread_sigmask(SIG_UNBLOCK). I don't think that Python should test the signal order delivered by the operating systems when SIG_UNBLOCK.

Anyone motivated to write a patch to use again a set()?
msg144769 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2011-10-02 09:59
Patch looks good to me (and it fixes the problem).
msg144775 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-02 16:33
New changeset e4f4272479d0 by Charles-François Natali in branch 'default':
Issue #13084: Fix a test_signal failure: the delivery order is only defined for
http://hg.python.org/cpython/rev/e4f4272479d0
History
Date User Action Args
2022-04-11 14:57:22adminsetgithub: 57293
2011-10-02 17:00:59neologixsetstatus: open -> closed
resolution: fixed
stage: resolved
2011-10-02 16:33:36python-devsetnosy: + python-dev
messages: + msg144775
2011-10-02 09:59:53skrahsetmessages: + msg144769
2011-10-01 14:24:10neologixsetfiles: + check_signum_order.diff
keywords: + patch
2011-10-01 12:17:06vstinnersetmessages: + msg144729
2011-10-01 10:19:05neologixsetnosy: + vstinner, neologix
messages: + msg144720
2011-10-01 09:54:05skrahsettype: behavior
2011-10-01 09:48:23skrahcreate