Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_embed.StdPrinterTests() crash if stdout FD is not 1 or 2 #89616

Closed
vstinner opened this issue Oct 13, 2021 · 6 comments
Closed

test_embed.StdPrinterTests() crash if stdout FD is not 1 or 2 #89616

vstinner opened this issue Oct 13, 2021 · 6 comments
Labels
3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

BPO 45453
Nosy @vstinner, @miss-islington
PRs
  • bpo-45453: Fix test_embed.StdPrinterTests #28916
  • [3.10] bpo-45453: Fix test_embed.StdPrinterTests (GH-28916) #28917
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-10-13.10:25:40.555>
    created_at = <Date 2021-10-13.01:52:49.617>
    labels = ['tests', '3.10', '3.11']
    title = 'test_embed.StdPrinterTests() crash if stdout FD is not 1 or 2'
    updated_at = <Date 2021-10-13.10:25:40.555>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2021-10-13.10:25:40.555>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-13.10:25:40.555>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2021-10-13.01:52:49.617>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45453
    keywords = ['patch']
    message_count = 6.0
    messages = ['403779', '403783', '403784', '403788', '403791', '403817']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'miss-islington']
    pr_nums = ['28916', '28917']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45453'
    versions = ['Python 3.10', 'Python 3.11']

    @vstinner
    Copy link
    Member Author

    test_embed does crash randomly on AMD64 Fedora Rawhide Clang 3.x:

    So far, I failed to reproduce the issue.

    @vstinner vstinner added 3.11 only security fixes tests Tests in the Lib/test dir labels Oct 13, 2021
    @vstinner
    Copy link
    Member Author

    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

    @vstinner
    Copy link
    Member Author

    Oh, maybe this is no traceback on a crash because of my recent libregrtest changes in bpo-45410.

    @vstinner
    Copy link
    Member Author

    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.

    @vstinner
    Copy link
    Member Author

    New changeset 678433f by Victor Stinner in branch 'main':
    bpo-45453: Fix test_embed.StdPrinterTests (GH-28916)
    678433f

    @vstinner
    Copy link
    Member Author

    New changeset 7e74d99 by Miss Islington (bot) in branch '3.10':
    bpo-45453: Fix test_embed.StdPrinterTests (GH-28916) (GH-28917)
    7e74d99

    @vstinner vstinner added the 3.10 only security fixes label Oct 13, 2021
    @vstinner vstinner changed the title test_embed: random crash on AMD64 Fedora Rawhide Clang 3.x test_embed.StdPrinterTests() crash if stdout FD is not 1 or 2 Oct 13, 2021
    @vstinner vstinner added the 3.10 only security fixes label Oct 13, 2021
    @vstinner vstinner changed the title test_embed: random crash on AMD64 Fedora Rawhide Clang 3.x test_embed.StdPrinterTests() crash if stdout FD is not 1 or 2 Oct 13, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant