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 — symtable_handle_namedexpr does not adjust correctly the recursion level · Issue #82128 · python/cpython

symtable_handle_namedexpr does not adjust correctly the recursion level #82128

New issue
Copy link
New issue
Copy link
Closed
Closed
symtable_handle_namedexpr does not adjust correctly the recursion level#82128
Copy link
Labels
3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifeinterpreter-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

@pablogsal
pablogsal
opened on Aug 26, 2019
Issue body actions
BPO 37947
Nosy @ncoghlan, @pablogsal, @miss-islington
PRs
  • bpo-37947: Adjust correctly the recursion level in symtable for named expressions #15499
  • [3.8] bpo-37947: Adjust correctly the recursion level in symtable for named expressions (GH-15499) #15515
  • bpo-37947: Avoid double-decrement in symtable recursion counting #15593
  • [3.8] bpo-37947: Avoid double-decrement in symtable recursion counting (GH-15593) #15594
  • 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 2019-08-26.15:28:36.283>
    created_at = <Date 2019-08-26.03:09:10.895>
    labels = ['interpreter-core', '3.8', '3.9', 'type-crash']
    title = 'symtable_handle_namedexpr does not adjust correctly the recursion level'
    updated_at = <Date 2019-09-03.07:49:39.607>
    user = 'https://github.com/pablogsal'

    bugs.python.org fields:

    activity = <Date 2019-09-03.07:49:39.607>
    actor = 'ncoghlan'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-26.15:28:36.283>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2019-08-26.03:09:10.895>
    creator = 'pablogsal'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37947
    keywords = ['patch']
    message_count = 9.0
    messages = ['350478', '350535', '350540', '350766', '350767', '350770', '350776', '350779', '351071']
    nosy_count = 3.0
    nosy_names = ['ncoghlan', 'pablogsal', 'miss-islington']
    pr_nums = ['15499', '15515', '15593', '15594']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue37947'
    versions = ['Python 3.8', 'Python 3.9']

    Linked PRs

    • gh-82129: Provide __annotate__ method for dataclasses from make_dataclass #122262

    Activity

    1. pablogsal commented on Aug 26, 2019

      @pablogsal
      pablogsal
      on Aug 26, 2019
      MemberAuthor
      More actions

      The symtable_handle_namedexpr function does not adjust correctly the recursion level when exiting (also, is actually not returning anything in a function defined as non-void but the return value is not used so is not technically undefined behavior).

    2. pablogsal
      added
      3.8 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
      on Aug 26, 2019
    3. pablogsal commented on Aug 26, 2019

      @pablogsal
      pablogsal
      on Aug 26, 2019
      MemberAuthor
      More actions

      New changeset 0e4ea16 by Pablo Galindo in branch 'master':
      bpo-37947: Adjust correctly the recursion level in symtable for named expressions (GH-15499)
      0e4ea16

    4. pablogsal commented on Aug 26, 2019

      @pablogsal
      pablogsal
      on Aug 26, 2019
      MemberAuthor
      More actions

      New changeset 3769425 by Pablo Galindo in branch '3.8':
      [3.8] bpo-37947: Adjust correctly the recursion level in symtable for named expressions (GH-15499) (GH-15515)
      3769425

    5. pablogsal
      closed this as completedon Aug 26, 2019
    6. ncoghlan commented on Aug 29, 2019

      @ncoghlan
      ncoghlan
      on Aug 29, 2019
      Contributor
      More actions

      Reviewing the PR post-merge, I'm pretty sure this has introduced a double-decrement bug due to the original code being hard to read (the error cases did the decrement inside the helper function, while the success case did it in the calling function).

      #15593 builds on your PR by removing the recursion counter adjustments from inside the helper function, leaving only the ones in the calling function.

    7. pablogsal commented on Aug 29, 2019

      @pablogsal
      pablogsal
      on Aug 29, 2019
      MemberAuthor
      More actions

      Thank you very much Nick for correcting this!

    8. ncoghlan commented on Aug 29, 2019

      @ncoghlan
      ncoghlan
      on Aug 29, 2019
      Contributor
      More actions

      Reviewing all the code that touches recursion_depth (both in the symtable and in the thread state), I'm not seeing any sanity checks that ensure our increments and decrements *balance*.

      So I'm going to add one to PySymTable_BuildObject.

    9. ncoghlan commented on Aug 29, 2019

      @ncoghlan
      ncoghlan
      on Aug 29, 2019
      Contributor
      More actions

      New changeset 0614523 by Nick Coghlan in branch 'master':
      bpo-37947: Avoid double-decrement in symtable recursion counting (GH-15593)
      0614523

    10. miss-islington commented on Aug 29, 2019

      @miss-islington
      miss-islington
      on Aug 29, 2019
      Contributor
      More actions

      New changeset 384c6d7 by Miss Islington (bot) in branch '3.8':
      bpo-37947: Avoid double-decrement in symtable recursion counting (GH-15593)
      384c6d7

    11. ncoghlan commented on Sep 3, 2019

      @ncoghlan
      ncoghlan
      on Sep 3, 2019
      Contributor
      More actions

      We never actually coded a reproducer for this, but if we had, it would have been a crash bug.

    12. ncoghlan
      added
      type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
      on Sep 3, 2019
    13. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    14. sobolevn
      added a commit that references this issue on Jul 25, 2024

      pythongh-82128: Provide `__annotate__` method for dataclasses from `m…

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

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifeinterpreter-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.