Skip to content

Assertion failure in Objects/call.c:342: !_PyErr_Occurred(tstate) failed #112388

Description

@bradlarsen

Crash report

What happened?

I found some crashes when adding an additional fuzz target in #111721.

# This script fails with a C assertion failure when assertions are enabled.
#
# I ran this through Python built from source with assertions enabled:
#
#     ./configure --with-assertions --prefix "$PWD/debugbuild"
#     make -j12 altinstall
#     ./debugbuild/bin/python/crash2.py
#
# I ran this on ARM64 macOS:
#
#     Darwin dialectic.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64

# Input found via the fuzz target added in https://github.com/python/cpython/pull/111721, then manually minimized
s = b"with(0,,):\n\x01"

# This line fails with a C assertion failure:
#
#     fuzz_pycompile: Objects/call.c:342: PyObject *_PyObject_Call(PyThreadState *, PyObject *, PyObject *, PyObject *): Assertion `!_PyErr_Occurred(tstate)' failed.
#
compile(s, 's', 'exec')

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Output from running 'python -VV' on the command line:

Python 3.13.0a1+ (heads/main:3701f3bc10, Nov 24 2023, 23:05:42) [Clang 15.0.0 (clang-1500.0.40.1)]

Linked PRs

Activity

  1. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Nov 25, 2023
  2. bradlarsen commented on Nov 25, 2023

    @bradlarsen
    ContributorAuthor

    See also #112387

  3. carsonRadtke commented on Nov 25, 2023

    @carsonRadtke
    Contributor

    $ git bisect determined the issue was introduced in 81f4e11.

    It appears the "invalid non-printable character" error was identified, but not promptly emitted to the user. Then when the "expected an indented block" error comes around, we see we are about to overwrite an error and we abort.

  4. hugovk commented on Nov 25, 2023

    @hugovk
    Member

    Thanks for the report and bisecting.

    cc @pablogsal

  5. added 3 commits that reference this issue on Nov 25, 2023
  6. added 2 commits that reference this issue on Nov 27, 2023
  7. pablogsal commented on Nov 27, 2023

    @pablogsal
    Member

    Thanks for the report!

  8. added 2 commits that reference this issue on Nov 27, 2023
  9. added a commit that references this issue on Feb 11, 2024
  10. added a commit that references this issue on Sep 2, 2024
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

    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