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_embed.StdPrinterTests() crash if stdout FD is not 1 or 2
Type: Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, vstinner
Priority: normal Keywords: patch

Created on 2021-10-13 01:52 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28916 merged vstinner, 2021-10-13 03:04
PR 28917 merged miss-islington, 2021-10-13 03:24
Messages (6)
msg403779 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-13 01:52
test_embed does crash randomly on AMD64 Fedora Rawhide Clang 3.x:

* https://buildbot.python.org/all/#/builders/188/builds/880
* https://buildbot.python.org/all/#/builders/188/builds/879

So far, I failed to reproduce the issue.
msg403783 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-13 02:31
It also crashed on the Address Sanitizer job of GitHub Action:
https://github.com/python/cpython/runs/3877327574

0:09:15 load avg: 4.46 [267/413/1] test_embed crashed (Exit code -11) -- running: test_gdb (1 min 2 sec), test_peg_generator (57.4 sec)

== Tests result: FAILURE then SUCCESS ==

1 re-run test:
    test_embed
msg403784 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-13 02:32
Oh, maybe this is no traceback on a crash because of my recent libregrtest changes in bpo-45410.
msg403788 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-13 02:59
Ah, I reproduced a crash locally:

0:00:19 load avg: 2.00 [3/3/1] test_embed crashed (Exit code -11)
Fatal Python error: Segmentation fault

Current thread 0x00007fef0ea9f2c0 (most recent call first):
  File "/home/vstinner/python/main/Lib/test/test_embed.py", line 1560 in create_printer
  File "/home/vstinner/python/main/Lib/test/test_embed.py", line 1595 in test_disallow_instantiation

The crash happens when sys.__stdout__.fileno() is not 1 or 2. It happens with my recents changes in bpo-45410.
msg403791 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-13 03:24
New changeset 678433f25e0d08dad7edf72be8f0cf9420e4ed2c by Victor Stinner in branch 'main':
bpo-45453: Fix test_embed.StdPrinterTests (GH-28916)
https://github.com/python/cpython/commit/678433f25e0d08dad7edf72be8f0cf9420e4ed2c
msg403817 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-13 10:24
New changeset 7e74d99c532f3eb55a86d10d30c068b03f2ad025 by Miss Islington (bot) in branch '3.10':
bpo-45453: Fix test_embed.StdPrinterTests (GH-28916) (GH-28917)
https://github.com/python/cpython/commit/7e74d99c532f3eb55a86d10d30c068b03f2ad025
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89616
2021-10-13 10:25:40vstinnersetstatus: open -> closed
title: test_embed: random crash on AMD64 Fedora Rawhide Clang 3.x -> test_embed.StdPrinterTests() crash if stdout FD is not 1 or 2
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.10
2021-10-13 10:24:56vstinnersetmessages: + msg403817
2021-10-13 03:24:42vstinnersetmessages: + msg403791
2021-10-13 03:24:41miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request27208
2021-10-13 03:04:01vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request27207
2021-10-13 02:59:24vstinnersetmessages: + msg403788
2021-10-13 02:32:17vstinnersetmessages: + msg403784
2021-10-13 02:31:28vstinnersetmessages: + msg403783
2021-10-13 01:52:49vstinnercreate