Skip to content

Dict creation in recursive function cause interpreter crashes. #87353

Closed

Description

@CharlesFengY
BPO 43187
Nosy @iritkatriel, @CharlesFengY

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 2021-09-07.19:20:32.340>
created_at = <Date 2021-02-10.09:19:35.501>
labels = ['interpreter-core', '3.9', 'type-crash']
title = 'Dict creation in recursive function cause interpreter crashes.'
updated_at = <Date 2021-09-07.19:20:32.340>
user = 'https://github.com/CharlesFengY'

bugs.python.org fields:

activity = <Date 2021-09-07.19:20:32.340>
actor = 'iritkatriel'
assignee = 'none'
closed = True
closed_date = <Date 2021-09-07.19:20:32.340>
closer = 'iritkatriel'
components = ['Interpreter Core']
creation = <Date 2021-02-10.09:19:35.501>
creator = 'CharlesFengY'
dependencies = []
files = []
hgrepos = []
issue_num = 43187
keywords = []
message_count = 2.0
messages = ['386765', '401331']
nosy_count = 2.0
nosy_names = ['iritkatriel', 'CharlesFengY']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue43187'
versions = ['Python 3.9']

Activity

  1. CharlesFengY commented on Feb 10, 2021

    CharlesFengYmannequin
    MannequinAuthor

    In the following programs, dict is created in recursive calls. Then a core dump is reported by Python interpreter.
    +++++++++++++++++++++++++++++++++++++++++++
    def test_equal_operator_modifying_operand():

        class X():
    
            def __del__(DictTest):
                dict_b.clear()
    
            def __eq__(DictTest, other):
                dict_a.clear()
                return True
    
            def __hash__(DictTest):
                return 13
        dict_d = {X(): 0}
    
        class Y():
    
            def __eq__(DictTest, other):
                dict_d.clear()
                return True
        dict_d = {0: Y()}
        # dict_c = {0: set()}
        test_equal_operator_modifying_operand()
    
    test_equal_operator_modifying_operand()
    +++++++++++++++++++++++++++++++++++++++++
  2. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Feb 10, 2021
  3. iritkatriel commented on Sep 7, 2021

    @iritkatriel
    Member

    On 3.9 I reproduce the segfault.

    On 3.11 on a mac I get

    RecursionError: maximum recursion depth exceeded while calling a Python object

    So it has been fixed in the meantime.

  4. transferred this issue fromon Apr 10, 2022
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.9 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA 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