-
-
Notifications
You must be signed in to change notification settings - Fork 317
Open
Description
Steps to reproduce
The following fuzzed code triggers a MemoryError in astroid:
a=b # type:i{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{This bug was discovered by OSS-Fuzz: https://issues.oss-fuzz.com/issues/489780714 (report not public yet)
Current behavior
Traceback (most recent call last):
File "astroid/run_parse.py", line 7, in <module>
astroid.builder.parse(code)
File "astroid/astroid/builder.py", line 313, in parse
return builder.string_build(code, modname=module_name, path=path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/builder.py", line 155, in string_build
module, builder = self._data_build(data, modname, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/builder.py", line 210, in _data_build
module = builder.visit_module(node, modname, node_file, package)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/rebuilder.py", line 174, in visit_module
[self.visit(child, newnode) for child in node.body],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/rebuilder.py", line 174, in <listcomp>
[self.visit(child, newnode) for child in node.body],
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/rebuilder.py", line 493, in visit
return visit_method(node, parent)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/rebuilder.py", line 717, in visit_assign
type_annotation = self.check_type_comment(node, parent=newnode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/rebuilder.py", line 642, in check_type_comment
type_comment_ast = self._parser_module.parse(node.type_comment)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "astroid/astroid/_ast.py", line 30, in parse
return ast.parse(string, type_comments=type_comments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/uv/python/cpython-3.11.11-linux-x86_64-gnu/lib/python3.11/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MemoryErrorExpected behavior
No crash
Version
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels