8000 `list(FunctionType(a.gi_code, {})(0))` crashes Python · Issue #90847 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

list(FunctionType(a.gi_code, {})(0)) crashes Python #90847

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

Closed
sobolevn opened this issue Feb 9, 2022 · 3 comments
Closed

list(FunctionType(a.gi_code, {})(0)) crashes Python #90847

sobolevn opened this issue Feb 9, 2022 · 3 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@sobolevn
Copy link
Member
sobolevn commented Feb 9, 2022
BPO 46689
Nosy @tirkarthi, @sobolevn

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 = None
created_at = <Date 2022-02-09.11:31:51.245>
labels = ['interpreter-core', '3.10', '3.9', 'type-crash', '3.11']
title = '`list(FunctionType(a.gi_code, {})(0))` crashes Python'
updated_at = <Date 2022-02-09.17:16:46.319>
user = 'https://github.com/sobolevn'

bugs.python.org fields:

activity = <Date 2022-02-09.17:16:46.319>
actor = 'xtreak'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2022-02-09.11:31:51.245>
creator = 'sobolevn'
dependencies = []
files = []
hgrepos = []
issue_num = 46689
keywords = []
message_count = 2.0
messages = ['412897', '412926']
nosy_count = 2.0
nosy_names = ['xtreak', 'sobolevn']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue46689'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

@sobolevn
Copy link
Member Author
sobolevn commented Feb 9, 2022

Here's the simplest reproduction:

from types import FunctionType
a = (x for x in [1])
list(FunctionType(a.gi_code, {})(0))

I understand that the code above does not make much sense, but I still think it should not crash.

Demo:

» PYTHONFAULTHANDLER=1 ./python.exe
Python 3.11.0a5+ (heads/issue-46647-dirty:88819357a5, Feb  5 2022, 18:19:59) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from types import FunctionType
>>> a = (x for x in [1])
>>> list(FunctionType(a.gi_code, {})(0))
Fatal Python error: Segmentation fault

Current thread 0x0000000112ece5c0 (most recent call first):
  File "<stdin>", line 1 in <genexpr>
  File "<stdin>", line 1 in <module>
[1]    22662 segmentation fault  PYTHONFAULTHANDLER=1 ./python.exe

I can reproduce this on 3.9 and 3.10 as well.

@sobolevn sobolevn added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 9, 2022
@tirkarthi
Copy link
Member

See also https://bugs.python.org/issue36956

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@kumaraditya303
Copy link
Contributor

Duplicate of #81137

@kumaraditya303 kumaraditya303 marked this as a duplicate of #81137 May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

3 participants
0