GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.12] Lambda generators cause assertion failure: `python: Objects/genobject.c:400: gen_close: Assertion `exception_handler_depth > 0' failed.` · Issue #119897 · python/cpython

[3.12] Lambda generators cause assertion failure: python: Objects/genobject.c:400: gen_close: Assertion exception_handler_depth > 0' failed.` #119897

New issue
Copy link
New issue
Copy link
Closed
Closed
[3.12] Lambda generators cause assertion failure: python: Objects/genobject.c:400: gen_close: Assertion exception_handler_depth > 0' failed.`#119897
Copy link
Assignees
iritkatriel
Labels
3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@mgorny
mgorny
opened on Jun 1, 2024
Issue body actions

Crash report

What happened?

When CPython 3.12 is built with assertions enabled, the following snippet causes the interpreter to crash:

x = lambda: (yield 3)
next(x())
$ ./python /tmp/LambdasTest.py 
python: Objects/genobject.c:400: gen_close: Assertion `exception_handler_depth > 0' failed.
Aborted (core dumped)

This doesn't happen with 3.11 or with main. From a quick bisect:

  • [3.12] gh-100762: Fix optimization in gen_close (GH-111069) #115818 (eb4774d) broke it on 3.12
  • gh-111354: simplify detection of RESUME after YIELD_VALUE at except-depth 1  #111459 (52cc4af) fixed it on main

This was triggered in the wild by Nuitka's test suite: Nuitka/Nuitka#2893.

CC @iritkatriel

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.12.3+ (heads/3.12:6d9677d78e, Jun 1 2024, 11:06:51) [GCC 14.1.1 20240516]

Linked PRs

  • [3.12] gh-119897: Revert buggy optimization which was removed in 3.13 #120467
  • gh-119897: Add test for lambda generator invocation #120658
  • [3.13] gh-119897: Add test for lambda generator invocation (GH-120658) #120673

Activity

  1. mgorny
    added
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    on Jun 1, 2024
  2. Eclips4
    added
    3.12only security fixesonly security fixes
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Jun 1, 2024
  3. mgorny commented on Jun 10, 2024

    @mgorny
    mgorny
    on Jun 10, 2024
    ContributorAuthor
    More actions

    Gentle ping.

  4. mgorny commented on Jun 12, 2024

    @mgorny
    mgorny
    on Jun 12, 2024
    ContributorAuthor
    More actions

    Given no reply, I'm going to revert this change in Gentoo. Hope that doesn't cause more issues.

  5. gentoo-bot
    added a commit that references this issue on Jun 12, 2024

    dev-lang/python: Bump to 3.12.4_p1

    f7e34ff
  6. iritkatriel
    self-assigned this
    on Jun 13, 2024
  7. iritkatriel commented on Jun 13, 2024

    @iritkatriel
    iritkatriel
    on Jun 13, 2024
    Member
    More actions

    Thanks. I agree, let's revert the bad commit in 3.12.

  8. iritkatriel
    added a commit that references this issue on Jun 18, 2024

    gh-119897: Add test for lambda generator invocation (#120658)

    73dc1c6
  9. miss-islington
    added a commit that references this issue on Jun 18, 2024

    pythongh-119897: Add test for lambda generator invocation (pythonGH-1…

    88395b5
  10. iritkatriel
    added a commit that references this issue on Jun 18, 2024

    [3.12] gh-119897: Revert buggy optimization which was removed in 3.13 (…

    5d997b5
  11. iritkatriel commented on Jun 18, 2024

    @iritkatriel
    iritkatriel
    on Jun 18, 2024
    Member
    More actions

    Thanks.

  12. iritkatriel
    closed this as completedon Jun 18, 2024
  13. mgorny commented on Jun 18, 2024

    @mgorny
    mgorny
    on Jun 18, 2024
    ContributorAuthor
    More actions

    Thank you!

  14. iritkatriel
    added a commit that references this issue on Jun 18, 2024

    [3.13] gh-119897: Add test for lambda generator invocation (GH-120658) (

    692874c
  15. mrahtz
    added a commit that references this issue on Jun 30, 2024

    pythongh-119897: Add test for lambda generator invocation (python#120658

    bed6d9c
  16. estyxx
    added a commit that references this issue on Jul 17, 2024

    pythongh-119897: Add test for lambda generator invocation (python#120658

    c70aa2b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @iritkatriel
    iritkatriel

Labels

3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.