Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Uninitialized memory read related to type_comment for *args or **kwds #36

Closed
@gvanrossum

Description

@gvanrossum

I believe I've found a very shy error due to an uninitialized memory read in typed_ast.

The repro conditions are murky, it only works on a particular rev of a particular codebase. The problem manifests itself in one of two ways:

  • SystemError: <built-in function _parse> returned a result with an error set with a traceback ending at line 54 in ast3.py; I suspect it is getting the type_comment from a struct that doesn't have that field and reading nonsense. (Most of the time the memory was freshly allocated and the nonsense happens to look like a NULL pointer which then gets treated as intended, but apparently in some scenarios it returns non-NULL garbage.)

  • Function has duplicate type signatures from make_argument() in transform_args() in mypy/fastparse.py; this for a line that is actually correct; so far all examples I've seen involve *args and I suspect the true cause is a similar scenario as the first bullet, a non-NULL piece of garbage.

ISTR we fixed a similar issue in the past.

I will investigate more next week.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions