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_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot
Type: Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cstratak, lukasz.langa, miss-islington, vstinner
Priority: normal Keywords: patch

Created on 2022-01-27 01:29 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30972 merged vstinner, 2022-01-28 00:18
PR 30973 merged miss-islington, 2022-01-28 00:35
PR 30974 merged miss-islington, 2022-01-28 00:35
PR 30913 sobolevn, 2022-01-28 16:59
PR 31035 merged vstinner, 2022-01-31 16:35
PR 31036 merged miss-islington, 2022-01-31 17:47
PR 31037 merged miss-islington, 2022-01-31 17:47
Messages (13)
msg411820 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-01-27 01:29
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:
https://github.com/python/buildmaster-config/commit/8fbb7492d4509df074750bc1a8ea69812ff53aae

---
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
msg411821 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-01-27 01:40
These 2 tests seem to check for RecursionError. See my notes:
https://pythondev.readthedocs.io/unstable_tests.html#unlimited-recursion
msg411935 - (view) Author: Charalampos Stratakis (cstratak) * Date: 2022-01-27 22:46
The issue seems to be affecting also the PPC64LE Fedora Rawhide Clang 3.x and PPC64LE Fedora Stable Clang 3.x
msg411944 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-01-28 00:20
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 GH-30972 to fix it.
msg411946 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-01-28 00:35
New changeset e7a6285f1be18992191599792524d3aa6aedfa55 by Victor Stinner in branch 'main':
bpo-46542: test_json uses support.infinite_recursion() (GH-30972)
https://github.com/python/cpython/commit/e7a6285f1be18992191599792524d3aa6aedfa55
msg411953 - (view) Author: miss-islington (miss-islington) Date: 2022-01-28 00:57
New changeset 20f53136679e260466a765de5befa3b9db396c9e by Miss Islington (bot) in branch '3.10':
bpo-46542: test_json uses support.infinite_recursion() (GH-30972)
https://github.com/python/cpython/commit/20f53136679e260466a765de5befa3b9db396c9e
msg411954 - (view) Author: miss-islington (miss-islington) Date: 2022-01-28 01:05
New changeset 8cd82461f9bb17381bf9d09989daea316c609cd5 by Miss Islington (bot) in branch '3.9':
bpo-46542: test_json uses support.infinite_recursion() (GH-30972)
https://github.com/python/cpython/commit/8cd82461f9bb17381bf9d09989daea316c609cd5
msg412203 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-01-31 14:58
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 GH-30855 change increased the usage of the stack memory when Python is built with clang:
https://github.com/python/cpython/pull/30855#issuecomment-1024884758

* 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
msg412209 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-01-31 16:46
The regression was introduced by GH-30855: "bpo-46329: Split calls into precall and call instructions" (commit 89fd7c34520aac493a8784a221366ed04452612b).
msg412214 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2022-01-31 17:46
New changeset ee0ac328d38a86f7907598c94cb88a97635b32f8 by Victor Stinner in branch 'main':
bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035)
https://github.com/python/cpython/commit/ee0ac328d38a86f7907598c94cb88a97635b32f8
msg412216 - (view) Author: miss-islington (miss-islington) Date: 2022-01-31 20:03
New changeset 30463860796790d3be97b76744290e4c364ad765 by Miss Islington (bot) in branch '3.9':
bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035)
https://github.com/python/cpython/commit/30463860796790d3be97b76744290e4c364ad765
msg412217 - (view) Author: miss-islington (miss-islington) Date: 2022-01-31 20:03
New changeset 34794517d1380e206fbbc9735b8aaaf07a5237ce by Miss Islington (bot) in branch '3.10':
bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035)
https://github.com/python/cpython/commit/34794517d1380e206fbbc9735b8aaaf07a5237ce
msg412218 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-01-31 20:46
s390x Fedora Clang 3.x buildbot is back to green, I close the issue.
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90700
2022-01-31 20:46:51vstinnersetstatus: open -> closed
versions: + Python 3.9, Python 3.10
messages: + msg412218

resolution: fixed
stage: patch review -> resolved
2022-01-31 20:03:53miss-islingtonsetmessages: + msg412217
2022-01-31 20:03:53miss-islingtonsetmessages: + msg412216
2022-01-31 17:47:05miss-islingtonsetpull_requests: + pull_request29220
2022-01-31 17:47:01miss-islingtonsetpull_requests: + pull_request29219
2022-01-31 17:46:23lukasz.langasetnosy: + lukasz.langa
messages: + msg412214
2022-01-31 16:46:43vstinnersetmessages: + msg412209
2022-01-31 16:35:25vstinnersetpull_requests: + pull_request29218
2022-01-31 16:22:37sobolevnsetnosy: - sobolevn
2022-01-31 14:58:25vstinnersetmessages: + msg412203
2022-01-28 16:59:15sobolevnsetnosy: + sobolevn
pull_requests: + pull_request29174
2022-01-28 01:05:03miss-islingtonsetmessages: + msg411954
2022-01-28 00:57:22miss-islingtonsetmessages: + msg411953
2022-01-28 00:35:28miss-islingtonsetpull_requests: + pull_request29153
2022-01-28 00:35:23miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request29152
2022-01-28 00:35:19vstinnersetmessages: + msg411946
2022-01-28 00:20:34vstinnersetmessages: + msg411944
2022-01-28 00:18:49vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request29151
2022-01-27 22:46:19cstrataksetnosy: + cstratak
messages: + msg411935
2022-01-27 01:40:09vstinnersetmessages: + msg411821
2022-01-27 01:29:56vstinnercreate