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 runner should try to increase stack size if it is too low
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.11
process
Status: closed Resolution: duplicate
Dependencies: Superseder: test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds
View: 44348
Assigned To: Nosy List: JelleZijlstra, Rohit Mediratta, berker.peksag, cstratak, iritkatriel, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2016-06-09 07:28 by Rohit Mediratta, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (9)
msg267965 - (view) Author: Rohit Mediratta (Rohit Mediratta) * Date: 2016-06-09 07:28
Fresh clone and running test_exceptions testcase caught a Seg fault.
This was being run on a Centos VM.

[/loc/rom/pyd/cpython] $ ./python 
Python 3.6.0a1+ (default:12d939477b4f, Jun  7 2016, 17:32:31) 
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 


[/loc/rom/pyd/cpython] $ ./python ../coveragepy/ run --pylib Lib/test/regrtest.py  test_exceptions 
Run tests sequentially
0:00:00 [1/1] test_exceptions
Fatal Python error: Segmentation fault

Current thread 0x00007fc7324d1700 (most recent call first):
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  ...
Segmentation fault
msg268097 - (view) Author: Rohit Mediratta (Rohit Mediratta) * Date: 2016-06-10 06:54
Debugged with gdb and found the following


(gdb) run ../coveragepy/ run --pylib Lib/test/regrtest.py  test_exceptions 
Starting program: /local/romedira/pydev/cpython/python ../coveragepy/ run --pylib Lib/test/regrtest.py  test_exceptions
[Thread debugging using libthread_db enabled]
Run tests sequentially
0:00:00 [1/1] test_exceptions

Program received signal SIGSEGV, Segmentation fault.
0x00000000005bf1e8 in PyEval_EvalFrameEx (f=Cannot access memory at address 0x7fffff7fd438
) at Python/ceval.c:798
798	{
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.80.el6_3.6.x86_64 keyutils-libs-1.4-4.el6.x86_64 krb5-libs-1.9-33.el6_3.3.x86_64 libcom_err-1.41.12-12.el6.x86_64 libselinux-2.0.94-5.3.el6.x86_64 openssl-1.0.1e-16.el6_5.1.x86_64 zlib-1.2.3-29.el6.x86_64
msg268102 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2016-06-10 07:33
This test asserts that indefinite recursion causes a RecursionError, but such recursion can instead segfault if the amount of stack space available is less than Python's recursion limit (sys.getrecursionlimit()).

Are you using any unusual settings for the recursion limit? Perhaps the solution here is to have CPython use a lower default recursion limit on your platform.
msg268263 - (view) Author: Rohit Mediratta (Rohit Mediratta) * Date: 2016-06-11 20:15
It's set to 1000, I didnt change during install, so it's likely set to the default value.

>>> import sys
>>> sys.getrecursionlimit()
1000


I also have a lot of memory free (87G) to run scripts (should be able to handle without running into issues)

[/loc/rom/pyd/cpython] $ free -m
             total       used       free     shared    buffers     cached
Mem:         96870       9849      87021          0        716       7512
-/+ buffers/cache:       1620      95250
Swap:            0          0          0
msg268330 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-06-12 05:59
Can you please try without coveragepy?

    ./python -m test test_exceptions
msg268332 - (view) Author: Rohit Mediratta (Rohit Mediratta) * Date: 2016-06-12 06:26
Leads to the same Segfault


[/loc/rom/pyd/cpython] $ ./python -m test test_exceptions
Run tests sequentially
0:00:00 [1/1] test_exceptions
Fatal Python error: Segmentation fault

Current thread 0x00007fb466572700 (most recent call first):
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  File "/local/romedira/pydev/cpython/Lib/test/test_exceptions.py", line 490 in f
  ...
Segmentation fault (core dumped)
msg315833 - (view) Author: Charalampos Stratakis (cstratak) * Date: 2018-04-27 11:46
This is an issue with the stack size.

It was encountered recently while building Python 3.6 under CentOS 6 [0] and the way to fix it was to increase the maximum stack size using ulimit e.g. [1]

[0] https://bugzilla.redhat.com/show_bug.cgi?id=1572150
[1] https://src.fedoraproject.org/rpms/python3/blob/f26/f/python3.spec#_1132
msg315834 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-04-27 11:52
> It was encountered recently while building Python 3.6 under CentOS 6 [0] and the way to fix it was to increase the maximum stack size using ulimit e.g. [1]

In a perfect world, unit tests should not depend on the environment. So Python may *try* to increase the maximum stack size when running these tests. (If the limit cannot be increased, it's fine.)
msg401306 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-09-07 16:45
I just pushed a change to reduce the stack memory usage when deleting a chain of exceptions in bpo-44348. I consider that this issue is a duplicate. If it's not the case, please reopen the issue.

commit fb305092a5d7894b41f122c1a1117b3abf4c567e (upstream/main, main)
Author: Victor Stinner <vstinner@python.org>
Date:   Tue Sep 7 15:42:11 2021 +0200

    bpo-44348: BaseException deallocator uses trashcan (GH-28190)
    
    The deallocator function of the BaseException type now uses the
    trashcan mecanism to prevent stack overflow. For example, when a
    RecursionError instance is raised, it can be linked to another
    RecursionError through the __context__ attribute or the __traceback__
    attribute, and then a chain of exceptions is created. When the chain
    is destroyed, nested deallocator function calls can crash with a
    stack overflow if the chain is too long compared to the available
    stack memory.
History
Date User Action Args
2022-04-11 14:58:32adminsetgithub: 71464
2021-09-07 16:45:07vstinnersetstatus: open -> closed
superseder: test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds
messages: + msg401306

resolution: duplicate
stage: resolved
2021-09-07 11:05:38iritkatrielsettitle: Fatal Python error: Segmentation fault in test_exceptions -> Test runner should try to increase stack size if it is too low
nosy: + serhiy.storchaka, iritkatriel

versions: + Python 3.11, - Python 3.6
components: - Interpreter Core
type: crash -> enhancement
2018-04-27 11:52:06vstinnersetnosy: + vstinner
messages: + msg315834
2018-04-27 11:46:36cstrataksetnosy: + cstratak
messages: + msg315833
2016-06-12 06:26:22Rohit Medirattasetmessages: + msg268332
2016-06-12 05:59:10berker.peksagsetnosy: + berker.peksag
messages: + msg268330
2016-06-11 20:15:36Rohit Medirattasetmessages: + msg268263
2016-06-10 07:33:07JelleZijlstrasetnosy: + JelleZijlstra
messages: + msg268102
2016-06-10 06:54:16Rohit Medirattasetmessages: + msg268097
2016-06-09 10:03:39SilentGhostsetcomponents: + Tests
2016-06-09 07:28:55Rohit Medirattacreate