Skip to content

Assertion failure in _imp.get_frozen_object if data object contains bad marshal data #105979

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
chgnrdv opened this issue Jun 22, 2023 · 2 comments · Fixed by #105980
Closed

Assertion failure in _imp.get_frozen_object if data object contains bad marshal data #105979

chgnrdv opened this issue Jun 22, 2023 · 2 comments · Fixed by #105980
Labels
type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@chgnrdv
Copy link
Contributor

chgnrdv commented Jun 22, 2023

Repro:

import _imp
>>> _imp.get_frozen_object('x', b"6\'\xd5Cu\x12")

Output:

python: Objects/object.c:541: PyObject_Repr: Assertion `!_PyErr_Occurred(tstate)' failed.
Aborted (core dumped)

I'll submit a PR.

Linked PRs

@chgnrdv chgnrdv added the type-crash A hard crash of the interpreter, possibly with a core dump label Jun 22, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 24, 2023
…Python/import.c`) (pythonGH-105980)

(cherry picked from commit cd52803)

Co-authored-by: chgnrdv <[email protected]>
kumaraditya303 pushed a commit that referenced this issue Jun 26, 2023
…`Python/import.c`) (GH-105980) (#106055)

gh-105979: Fix exception handling in `unmarshal_frozen_code` (`Python/import.c`) (GH-105980)
(cherry picked from commit cd52803)

Co-authored-by: chgnrdv <[email protected]>
kumaraditya303 added a commit that referenced this issue Jun 26, 2023
…ython/import.c`) (GH-105980). (#106100)

* [3.11] gh-105979: Fix exception handling in `unmarshal_frozen_code` (`Python/import.c`) (GH-105980).
(cherry picked from commit cd52803)

Co-authored-by: chgnrdv <[email protected]>
@marceltrio
Copy link

Repro:

import _imp
>>> _imp.get_frozen_object('x', b"6\'\xd5Cu\x12")

Output:

python: Objects/object.c:541: PyObject_Repr: Assertion `!_PyErr_Occurred(tstate)' failed.
Aborted (core dumped)

I'll submit a PR.

Linked PRs

@mattip
Copy link
Contributor

mattip commented Nov 24, 2024

When is get_frozen_object called with a data argument? On PyPy we do not have a data argument to the function and everything seems to work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants