Skip to content

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

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
alex opened this issue Jan 15, 2024 · 1 comment · Fixed by #114408
Closed

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

alex opened this issue Jan 15, 2024 · 1 comment · Fixed by #114408
Assignees
Labels
3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@alex
Copy link
Member

alex commented Jan 15, 2024

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

@alex alex added type-bug An unexpected behavior, bug, or error type-crash A hard crash of the interpreter, possibly with a core dump labels Jan 15, 2024
@alex
Copy link
Member Author

alex commented Jan 15, 2024

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

@iritkatriel iritkatriel self-assigned this Jan 15, 2024
@iritkatriel iritkatriel added the 3.13 bugs and security fixes label Jan 17, 2024
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Jan 21, 2024
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Jan 21, 2024
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Jan 21, 2024
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Jan 21, 2024
iritkatriel added a commit that referenced this issue Jan 22, 2024
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
2 participants