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_sigwaitinfo() of test_eintr hangs on randomly on FreeBSD buildbots
Type: Stage:
Components: Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: martin.panter, python-dev, vstinner
Priority: normal Keywords:

Created on 2015-09-30 09:32 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1532 merged vstinner, 2017-05-10 10:39
Messages (7)
msg251920 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-09-30 09:32
Too bad, the test test_eintr hangs sometimes on "AMD64 FreeBSD 9.x 3.x".

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.x/builds/3442/steps/test/logs/stdio

[397/399] test_traceback -- running: test_eintr (254 sec), test_subprocess (62 sec)
[398/399] test_subprocess (71 sec) -- running: test_eintr (264 sec)
running: test_eintr (324 sec)
running: test_eintr (384 sec)
running: test_eintr (444 sec)
running: test_eintr (504 sec)
...

running: test_eintr (3505 sec)
running: test_eintr (3565 sec)
[399/399] test_eintr
Timeout (1:00:00)!
Thread 0x0000000801807400 (most recent call first):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/selectors.py", line 375 in select
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/subprocess.py", line 1698 in _communicate
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/subprocess.py", line 1068 in communicate
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/support/script_helper.py", line 86 in run_python_until_end
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/support/script_helper.py", line 96 in _assert_python
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/support/script_helper.py", line 135 in assert_python_ok
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/test_eintr.py", line 19 in test_all
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/case.py", line 600 in run
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/case.py", line 648 in __call__
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py", line 122 in run
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py", line 84 in __call__
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py", line 122 in run
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py", line 84 in __call__
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py", line 122 in run
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/suite.py", line 84 in __call__
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/unittest/runner.py", line 176 in run
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/support/__init__.py", line 1775 in _run_suite
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/support/__init__.py", line 1809 in run_unittest
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/runtest.py", line 159 in test_runner
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/runtest.py", line 160 in runtest_inner
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/runtest.py", line 113 in runtest
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/runtest_mp.py", line 68 in run_tests_slave
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/main.py", line 357 in main
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/main.py", line 407 in main
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/main.py", line 429 in main_in_temp_cwd
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/regrtest.py", line 39 in <module>
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/runpy.py", line 85 in _run_code
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/runpy.py", line 170 in _run_module_as_main
Traceback (most recent call last):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/__main__.py", line 3, in <module>
    regrtest.main_in_temp_cwd()
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/main.py", line 429, in main_in_temp_cwd
    main()
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/main.py", line 407, in main
    Regrtest().main(tests=tests, **kwargs)
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/main.py", line 365, in main
    self.run_tests()
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/main.py", line 332, in run_tests
    run_tests_multiprocess(self)
  File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/libregrtest/runtest_mp.py", line 210, in run_tests_multiprocess
    raise Exception(msg)
Exception: Child error on test_eintr: Exit code 1
*** [buildbottest] Error code 1
msg252020 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-10-01 11:17
New changeset 10efb1797e7b by Victor Stinner in branch 'default':
Issue #25277: Set a timeout of 10 minutes in test_eintr using faulthandler to
https://hg.python.org/cpython/rev/10efb1797e7b
msg252590 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-10-09 07:20
The bug was reproduced with faulthandler:

FAIL: test_all (test.test_eintr.EINTRTests)
Timeout (0:10:00)!
Thread 0x0000000802006400 (most recent call first):
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/eintrdata/eintr_tester.py", line 402 in test_sigwaitinfo
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/case.py", line 600 in run
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/case.py", line 648 in __call__
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", line 122 in run
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", line 84 in __call__
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", line 122 in run
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/suite.py", line 84 in __call__
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/runner.py", line 176 in run
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/support/__init__.py", line 1775 in _run_suite
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/support/__init__.py", line 1809 in run_unittest
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/eintrdata/eintr_tester.py", line 470 in test_main
  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/eintrdata/eintr_tester.py", line 474 in <module>

The same error occurred multiple times on buildbots FreeBSD 10.0 and 9.x.
msg252892 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-10-12 21:37
New changeset 605eda657884 by Victor Stinner in branch '3.5':
Issue #25277: Use a longer sleep in test_eintr to reduce the risk of race
https://hg.python.org/cpython/rev/605eda657884
msg252893 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-10-12 21:55
I hope that 2 seconds should be enough to workaround the lack of real synchronization between the parent and the child process.
msg256278 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-12-12 11:26
Did you consider blocking the signal before spawning the child? I haven’t used signals much, so I could be wrong, but it seems sigwaitinfo() is meant to be called with the signal blocked. Something like this:

pthread_sigmask(SIG_BLOCK, {signum})
try:
    t0 = ...
    ...  # Spawn child, call sigwaitinfo(), etc
finally:
    pthread_sigmask(SIG_UNBLOCK, {signum})
self.assertGreaterEqual(dt, ...)
msg293404 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-10 12:13
New changeset dab10f4f5b52c6de1aac3a8b5dc87d2eb0223a6c by Victor Stinner in branch '3.5':
[3.5] bpo-30320, bpo-25277: backport test_eintr enhancements from master to 3.5 (#1532)
https://github.com/python/cpython/commit/dab10f4f5b52c6de1aac3a8b5dc87d2eb0223a6c
History
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69464
2017-05-10 12:13:40vstinnersetmessages: + msg293404
2017-05-10 10:39:13vstinnersetpull_requests: + pull_request1632
2015-12-12 11:26:45martin.pantersetnosy: + martin.panter
messages: + msg256278
2015-10-12 21:55:36vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg252893
2015-10-12 21:37:42python-devsetmessages: + msg252892
2015-10-09 07:20:34vstinnersetmessages: + msg252590
title: test_eintr hangs on randomly on "AMD64 FreeBSD 9.x 3.x" -> test_sigwaitinfo() of test_eintr hangs on randomly on FreeBSD buildbots
2015-10-01 11:17:17python-devsetnosy: + python-dev
messages: + msg252020
2015-09-30 09:32:47vstinnercreate