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_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot #90700

Closed
vstinner opened this issue Jan 27, 2022 · 13 comments
Closed

test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot #90700

vstinner opened this issue Jan 27, 2022 · 13 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

BPO 46542
Nosy @vstinner, @ambv, @stratakis, @miss-islington
PRs
  • bpo-46542: test_json uses support.infinite_recursion() #30972
  • [3.10] bpo-46542: test_json uses support.infinite_recursion() (GH-30972) #30973
  • [3.9] bpo-46542: test_json uses support.infinite_recursion() (GH-30972) #30974
  • bpo-46530: add "thread_time" to test_time.test_get_clock_info #30913
  • bpo-46542: test_lib2to3 uses support.infinite_recursion() #31035
  • [3.10] bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035) #31036
  • [3.9] bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035) #31037
  • 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 2022-01-31.20:46:51.687>
    created_at = <Date 2022-01-27.01:29:56.716>
    labels = ['tests', '3.9', '3.10', '3.11']
    title = 'test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot'
    updated_at = <Date 2022-01-31.20:46:51.683>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2022-01-31.20:46:51.683>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-01-31.20:46:51.687>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2022-01-27.01:29:56.716>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46542
    keywords = ['patch']
    message_count = 13.0
    messages = ['411820', '411821', '411935', '411944', '411946', '411953', '411954', '412203', '412209', '412214', '412216', '412217', '412218']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'lukasz.langa', 'cstratak', 'miss-islington']
    pr_nums = ['30972', '30973', '30974', '30913', '31035', '31036', '31037']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue46542'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @vstinner
    Copy link
    Member Author

    s390x Fedora Clang 3.x buildbot:
    https://buildbot.python.org/all/#/builders/3/builds/1385

    This change may be caused by this buildbot configuration change:
    python/buildmaster-config@8fbb749

    ---
    0:05:48 load avg: 7.72 [215/432/1] test_lib2to3 crashed (Exit code -11) -- running: (...)
    Fatal Python error: Segmentation fault

    Current thread 0x000003ff94176710 (most recent call first):
    File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 845 in generate_matches
    File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 785 in _recursive_matches
    File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 786 in _recursive_matches
    File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 786 in _recursive_matches
    (...)
    File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py", line 786 in _recursive_matches
    ...

    Extension modules: _testcapi (total: 1)
    ---

    and

    ---
    0:06:29 load avg: 7.50 [245/432/2] test_json crashed (Exit code -11) -- running: (...)
    Fatal Python error: Segmentation fault

    Current thread 0x000003ffbccf6710 (most recent call first):
    File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/json/encoder.py", line 439 in _iterencode
    File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/json/encoder.py", line 325 in _iterencode_list
    (...)
    File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/json/encoder.py", line 439 in _iterencode
    ...

    Extension modules: _testcapi (total: 1)
    ---

    test.pythoninfo difference between successful build 1383 and failing build 1385:

    • Py_DEBUG: No => Yes
    • pymem.allocator: pymalloc => pymalloc_debug
    • sysconfig[CFLAGS]: -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall
      => sysconfig[CFLAGS]: -Wsign-compare -g -O0 -Wall

    @vstinner vstinner added 3.11 only security fixes tests Tests in the Lib/test dir labels Jan 27, 2022
    @vstinner
    Copy link
    Member Author

    These 2 tests seem to check for RecursionError. See my notes:
    https://pythondev.readthedocs.io/unstable_tests.html#unlimited-recursion

    @stratakis
    Copy link
    Mannequin

    stratakis mannequin commented Jan 27, 2022

    The issue seems to be affecting also the PPC64LE Fedora Rawhide Clang 3.x and PPC64LE Fedora Stable Clang 3.x

    @vstinner
    Copy link
    Member Author

    I managed to reproduce the test_json crash on the "Fedora Stable ppc64le" buildbot using clang. Commands:
    ---
    ./configure --with-pydebug CC=clang
    make -j10
    ./python -m test -v test_json
    ---

    I wrote #75155 to fix it.

    @vstinner
    Copy link
    Member Author

    New changeset e7a6285 by Victor Stinner in branch 'main':
    bpo-46542: test_json uses support.infinite_recursion() (GH-30972)
    e7a6285

    @miss-islington
    Copy link
    Contributor

    New changeset 20f5313 by Miss Islington (bot) in branch '3.10':
    bpo-46542: test_json uses support.infinite_recursion() (GH-30972)
    20f5313

    @miss-islington
    Copy link
    Contributor

    New changeset 8cd8246 by Miss Islington (bot) in branch '3.9':
    bpo-46542: test_json uses support.infinite_recursion() (GH-30972)
    8cd8246

    @vstinner
    Copy link
    Member Author

    test_lib2to3 crash if Python is built with clang when running test_all_project_files() of lib2to3.tests.test_all_fixers.Test_all. This test crash on processing the file: "Lib/lib2to3/tests/data/infinite_recursion.py".

    The #75038 change increased the usage of the stack memory when Python is built with clang:
    #30855 (comment)

    • GCC allocates between 544 bytes (-O3) and 608 bytes (-Og) on the stack
    • clang allocates between 656 bytes (-O3) and 9200 bytes (Og) on the stack

    @vstinner
    Copy link
    Member Author

    The regression was introduced by #75038: "bpo-46329: Split calls into precall and call instructions" (commit 89fd7c3).

    @ambv
    Copy link
    Contributor

    ambv commented Jan 31, 2022

    New changeset ee0ac32 by Victor Stinner in branch 'main':
    bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035)
    ee0ac32

    @miss-islington
    Copy link
    Contributor

    New changeset 3046386 by Miss Islington (bot) in branch '3.9':
    bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035)
    3046386

    @miss-islington
    Copy link
    Contributor

    New changeset 3479451 by Miss Islington (bot) in branch '3.10':
    bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035)
    3479451

    @vstinner
    Copy link
    Member Author

    s390x Fedora Clang 3.x buildbot is back to green, I close the issue.

    @vstinner vstinner added 3.9 only security fixes 3.10 only security fixes labels Jan 31, 2022
    @vstinner vstinner added 3.9 only security fixes 3.10 only security fixes labels Jan 31, 2022
    @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.9 only security fixes 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

    3 participants