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

Segmentation Fault when statically nesting EXACTLY 20 content managers. #118544

Closed
babygrimes opened this issue May 3, 2024 · 1 comment
Closed
Labels
type-bug An unexpected behavior, bug, or error

Comments

@babygrimes
Copy link

babygrimes commented May 3, 2024

Bug report

Bug description:

# Add a code block here, if required
async def test():
    async with (
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            cm(),
            # cm(),
    ):
        pass

The above code (with the final cm() commented out) will cause a Segmentation Fault on Ubuntu 22.04. This works as expected on Python3.11.

[dmgrime@dave-laptop:~]$ python3.11 breakme.py
[dmgrime@dave-laptop:~]$ python3.12 breakme.py
Segmentation fault

Note: commenting out an additional cm() works as expected in both Python3.11 and Python3.12 (no exception, no seg fault).

[dmgrime@dave-laptop:~]$ python3.11 breakme.py
[dmgrime@dave-laptop:~]$ python3.12 breakme.py
[dmgrime@dave-laptop:~]$

Note: uncommenting the final cm() works as expected in both Python3.11 and Python3.12 (exception but no seg fault).

[dmgrime@dave-laptop:~]$ python3.11 breakme.py
  File "/home/dmgrime/breakme.py", line 2
    async with (
    ^^^^^^^^^^^^
SyntaxError: too many statically nested blocks
[dmgrime@dave-laptop:~]$ python3.12 breakme.py
  File "/home/dmgrime/breakme.py", line 2
    async with (
    ^^^^^^^^^^^^
SyntaxError: too many statically nested blocks
[dmgrime@dave-laptop:~]$

CPython versions tested on:

3.11, 3.12

Operating systems tested on:

Linux

@babygrimes babygrimes added the type-bug An unexpected behavior, bug, or error label May 3, 2024
@Eclips4
Copy link
Member

Eclips4 commented May 3, 2024

Duplicate of #116767

@Eclips4 Eclips4 marked this as a duplicate of #116767 May 3, 2024
@Eclips4 Eclips4 closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants