Skip to content

Python/flowgraph.c:497: _Bool no_redundant_jumps(cfg_builder *): Assertion `0' failed. #114083

Closed

Description

@alex

Bug report

Bug description:

Another crash in the compiler found by the fuzzer:

~/p/cpython ❯❯❯ ./python.exe -c 'compile("if 9<9<9and 9or 9or 9:9", "", "exec")'
:1: SyntaxWarning: invalid decimal literal
:1: SyntaxWarning: invalid decimal literal
:1: SyntaxWarning: invalid decimal literal
Assertion failed: (0), function no_redundant_jumps, file flowgraph.c, line 497.
fish: Job 1, './python.exe -c 'compile("if 9<…' terminated by signal SIGABRT (Abort)

cc: @iritkatriel

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Jan 15, 2024
  2. alex commented on Jan 15, 2024

    @alex
    MemberAuthor

    Full stack for reference:

    
    fuzz_pycompile: Python/flowgraph.c:497: _Bool no_redundant_jumps(cfg_builder *): Assertion `0' failed.
    --
      | ==13546== ERROR: libFuzzer: deadly signal
      | #0 0x4f2869 in __sanitizer_print_stack_trace /src/llvm-project/compiler-rt/lib/msan/msan.cpp:735:3
      | #1 0x472388 in fuzzer::PrintStackTrace() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerUtil.cpp:210:5
      | #2 0x457063 in fuzzer::Fuzzer::CrashCallback() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:233:3
      | #3 0x53fc48 in SignalAction(int, void*, void*) /src/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:998:3
      | #4 0x7d9f29a0641f in libpthread.so.0
      | #5 0x7d9f2981c00a in __libc_signal_restore_set /build/glibc-SzIz7B/glibc-2.31/sysdeps/unix/sysv/linux/internal-signals.h:86:3
      | #6 0x7d9f2981c00a in raise /build/glibc-SzIz7B/glibc-2.31/sysdeps/unix/sysv/linux/raise.c:48:3
      | #7 0x7d9f297fb858 in abort /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:79:7
      | #8 0x7d9f297fb728 in __assert_fail_base /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:92:3
      | #9 0x7d9f2980cfd5 in __assert_fail /build/glibc-SzIz7B/glibc-2.31/assert/assert.c:101:3
      | #10 0xc6b2e8 in no_redundant_jumps cpython3/Python/flowgraph.c:497:25
      | #11 0xc69fb0 in _PyCfg_OptimizedCfgToInstructionSequence cpython3/Python/flowgraph.c:2704:5
      | #12 0xb12816 in optimize_and_assemble_code_unit cpython3/Python/compile.c:7581:9
      | #13 0xb12816 in optimize_and_assemble cpython3/Python/compile.c:7616:12
      | #14 0xb03706 in compiler_mod cpython3/Python/compile.c:1779:24
      | #15 0xb03706 in _PyAST_Compile cpython3/Python/compile.c:555:24
      | #16 0xe44da9 in Py_CompileStringObject cpython3/Python/pythonrun.c:1452:10
      | #17 0xe45144 in Py_CompileStringExFlags cpython3/Python/pythonrun.c:1465:10
      | #18 0x54f518 in fuzz_pycompile cpython3/Modules/_xxtestfuzz/fuzzer.c:550:24
      | #19 0x54f518 in _run_fuzz cpython3/Modules/_xxtestfuzz/fuzzer.c:563:14
      | #20 0x54f518 in LLVMFuzzerTestOneInput cpython3/Modules/_xxtestfuzz/fuzzer.c:704:11
      | #21 0x458603 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
      | #22 0x443d62 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
      | #23 0x44960c in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9
      | #24 0x472b42 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
      | #25 0x7d9f297fd082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/libc-start.c:308:16
      | #26 0x439f2d in _start
    
  3. self-assigned this
    on Jan 15, 2024
  4. added 4 commits that reference this issue on Jan 21, 2024
  5. added a commit that references this issue on Jan 22, 2024
  6. added a commit that references this issue on Feb 11, 2024
  7. 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

Labels

3.13only security fixestype-bugAn unexpected behavior, bug, or errortype-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