Skip to content

Fuzz: out-of-memory in typeck and hir lowering #2302

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

Open
github-actions bot opened this issue Apr 16, 2025 · 0 comments · May be fixed by #2336
Open

Fuzz: out-of-memory in typeck and hir lowering #2302

github-actions bot opened this issue Apr 16, 2025 · 0 comments · May be fixed by #2336
Assignees
Labels
bug Something isn't working

Comments

@github-actions
Copy link

github-actions bot commented Apr 16, 2025

The fuzz-testing workflow has detected a bug.

Auto-Minimized Fuzzing Input That Triggers the Bug: Click this line. Note: If the input is multi-line then the end-of-line characters '\n' (0x0A) and '\r' (0x0D) may affect the reproducibility of the bug. If you fail to repro the bug with the input shown below then you may want to go to the workflow that reported this GitHub bug, download the artifact, and extract the file with the exact minimized input.
pow(0)@pow(5)@ pow(0.)@pow(5)@ pow(.5)@ pow(0)@pow(0)o@ pow(0) @pow(0.) @pow(5) @ pow(0)@ pow(0)p@pow(5)@ pow(5)@pow(5)t@pow(0) @pow(0)@pow(.5)@ pow(5)@ pow(.5)@p
Fuzzing stderr Log (last 62kB), includes the stack trace: Click. The fragment of interest starts with "panicked at".
Failing input:

	fuzz/artifacts/qasm3/oom-a2e788702a85968e356f1e32929c98f2b05b9a66

Output of `std::fmt::Debug`:

	[47, 47, 32, 79, 112, 101, 110, 81, 65, 83, 77, 32, 51, 46, 48, 32, 115, 116, 97, 110, 100, 97, 114, 100, 32, 103, 97, 1, 0, 0, 0, 0, 0, 0, 18, 114, 121, 10, 47, 47, 10, 47, 47, 32, 78, 111, 116, 101, 58, 32, 116, 104, 101, 32, 103, 97, 45, 207, 128, 47, 52, 41, 59, 125, 10, 47, 47, 58, 32, 105, 110, 118, 101, 114, 115, 101, 32, 111, 102, 32, 115, 113, 114, 116, 40, 90, 41, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 110, 100, 97, 114, 100, 32, 103, 97, 116, 101, 32, 108, 105, 98, 114, 97, 114, 121, 10, 47, 47, 10, 47, 47, 32, 78, 111, 116, 101, 58, 32, 116, 104, 101, 32, 103, 97, 45, 207, 128, 47, 52, 41, 59, 125, 10, 47, 47, 58, 32, 105, 110, 118, 101, 114, 115, 101, 32, 111, 102, 32, 115, 113, 114, 116, 40, 90, 41, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 115, 0, 0, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 108, 101, 109, 101, 110, 116, 97, 116, 105, 111, 110, 115, 10, 47, 47, 32, 104, 97, 118, 101, 32, 115, 111, 109, 101, 32, 115, 99, 111, 112, 101, 32, 102, 111, 114, 32, 104, 111, 119, 32, 116, 104, 101, 121, 32, 104, 97, 110, 100, 108, 101, 32, 116, 104, 101, 32, 102, 105, 108, 101, 32, 105, 110, 116, 101, 114, 110, 97, 108, 78, 111, 116, 101, 58, 32, 116, 104, 101, 32, 103, 97, 45, 207, 128, 47, 52, 41, 59, 125, 10, 47, 47, 58, 32, 105, 110, 118, 101, 114, 115, 101, 32, 111, 102, 32, 115, 113, 114, 116, 40, 90, 41, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 53, 48, 46, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 32, 115, 113, 114, 116, 40, 90, 41, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 110, 100, 97, 114, 100, 32, 103, 97, 116, 101, 32, 108, 105, 98, 114, 97, 114, 121, 10, 47, 47, 10, 47, 47, 32, 78, 111, 116, 101, 58, 32, 116, 104, 101, 32, 103, 97, 45, 207, 128, 47, 52, 41, 59, 125, 10, 47, 47, 58, 32, 105, 110, 118, 101, 114, 115, 101, 32, 111, 102, 32, 115, 113, 114, 116, 40, 90, 41, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 108, 101, 109, 101, 110, 116, 97, 116, 105, 111, 110, 115, 10, 47, 47, 32, 104, 97, 118, 101, 32, 115, 111, 109, 101, 32, 115, 99, 111, 112, 101, 32, 102, 111, 114, 32, 104, 111, 119, 32, 116, 104, 101, 121, 32, 104, 97, 110, 100, 108, 101, 32, 116, 104, 101, 32, 102, 105, 108, 101, 32, 105, 110, 116, 101, 114, 110, 97, 108, 78, 32, 102, 105, 108, 101, 32, 105, 110, 116, 101, 114, 110, 97, 108, 78, 111, 116, 101, 58, 32, 116, 104, 101, 32, 103, 97, 45, 207, 128, 47, 52, 41, 59, 125, 10, 47, 47, 58, 32, 105, 110, 118, 101, 114, 115, 101, 32, 111, 102, 32, 115, 113, 114, 116, 40, 90, 41, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 108, 101, 109, 101, 110, 116, 97, 116, 105, 111, 110, 115, 10, 47, 47, 32, 104, 97, 118, 101, 32, 115, 111, 109, 101, 32, 115, 99, 111, 112, 101, 32, 102, 111, 114, 32, 104, 111, 119, 32, 116, 104, 101, 121, 32, 104, 97, 110, 100, 108, 101, 32, 116, 104, 101, 32, 102, 105, 108, 101, 32, 105, 110, 116, 101, 114, 110, 97, 108, 78, 32, 102, 105, 108, 101, 32, 105, 110, 116, 101, 114, 110, 97, 108, 78, 111, 116, 101, 58, 32, 116, 104, 101, 32, 103, 97, 45, 207, 128, 47, 52, 41, 59, 125, 10, 47, 47, 58, 32, 105, 110, 118, 101, 114, 115, 101, 32, 111, 102, 32, 115, 113, 114, 116, 40, 90, 41, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 108, 101, 109, 101, 110, 116, 97, 116, 105, 111, 110, 115, 10, 47, 47, 32, 104, 97, 118, 101, 32, 115, 111, 109, 101, 32, 115, 99, 111, 112, 101, 32, 102, 111, 114, 32, 104, 111, 119, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 110, 100, 97, 114, 100, 32, 103, 97, 116, 101, 32, 108, 105, 98, 114, 97, 114, 121, 10, 47, 47, 10, 47, 47, 32, 78, 111, 116, 101, 58, 32, 116, 104, 101, 32, 103, 97, 45, 207, 128, 47, 52, 41, 59, 125, 10, 47, 47, 58, 32, 105, 110, 118, 101, 114, 115, 101, 32, 111, 102, 32, 115, 113, 114, 116, 40, 90, 41, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 115, 44, 32, 98, 117, 116, 32, 105, 109, 112, 108, 101, 109, 101, 110, 116, 97, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 105, 99, 97, 116, 105, 111, 110, 32, 100, 101, 102, 105, 110, 101, 100, 44, 32, 97, 115, 32, 97, 114, 101, 32, 116, 104, 101, 32, 117, 110, 105, 116, 97, 114, 121, 32, 97, 99, 116, 105, 111, 110, 116, 105, 111, 110, 115, 10, 47, 47, 32, 104, 97, 118, 101, 32, 115, 111, 109, 101, 32, 115, 99, 111, 112, 101, 32, 102, 111, 114, 32, 104, 111, 119, 32, 116, 104, 101, 121, 32, 104, 97, 110, 100, 108, 101, 32, 116, 104, 101, 32, 102, 105, 108, 101, 32, 105, 110, 116, 101, 114, 110, 97, 108, 78, 111, 116, 101, 58, 32, 116, 104, 101, 32, 103, 97, 45, 207, 128, 47, 52, 41, 59, 125, 10, 47, 47, 58, 32, 105, 110, 118, 101, 114, 115, 101, 32, 111, 102, 32, 115, 113, 114, 116, 40, 90, 41, 10, 103, 97, 116, 101, 32, 115, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 101, 99, 105, 102, 100, 103, 32, 97, 32, 123, 32, 105, 110, 118, 32, 64, 32, 112, 111, 119, 40, 48, 46, 53, 41, 32, 47, 32, 51, 46, 48, 32, 115, 112, 114, 97, 114, 121, 46, 114, 115, 116, 96, 32, 100, 111, 99, 117, 109, 101, 110, 116, 97, 116, 105, 111, 47, 108, 97, 110, 103, 117, 97, 103, 101, 47, 115, 116, 97, 110, 100, 97, 114, 100, 95, 108, 105, 98, 114, 97, 114, 121, 46, 114, 115, 116, 96, 32, 100, 111, 99, 32, 103, 97, 116, 101, 10, 103, 97, 116, 123, 32, 99, 116, 114, 108, 32, 64, 32, 103, 112, 104, 97, 115, 101, 40, 206, 187, 41, 32, 97, 59, 32, 125, 10, 10, 47, 47, 32, 80, 97, 40, 45, 206, 187, 47, 50, 41, 59, 32, 117, 108, 105]

Reproduce with:

	cargo fuzz run -O --features=do_fuzz --sanitizer=none qasm3 fuzz/artifacts/qasm3/oom-a2e788702a85968e356f1e32929c98f2b05b9a66

Minimize test case with:

	cargo fuzz tmin -O --features=do_fuzz --sanitizer=none qasm3 fuzz/artifacts/qasm3/oom-a2e788702a85968e356f1e32929c98f2b05b9a66

────────────────────────────────────────────────────────────────────────────────

Error: Fuzz target exited with exit status: 71

Stack backtrace:
   0: anyhow::error::<impl anyhow::Error>::msg
   1: cargo_fuzz::project::FuzzProject::exec_fuzz
   2: cargo_fuzz::main
   3: std::sys::backtrace::__rust_begin_short_backtrace
   4: std::rt::lang_start::{{closure}}
   5: std::rt::lang_start_internal
   6: main
   7: <unknown>
   8: __libc_start_main
   9: _start
The branch/commit the bug has been found in: Click. If the developers fail to repro the bug in the latest main then the branch/commit info below can help them to make sure that they are using the correct way to repro. If the bug is reproducible in the branch/commit below, but not in latest main, then the bug is likely fixed already or is not in the main branch.
Branch: * iadavis/qasm-fuzz

commit e69eb7b8c2639ac4ba9eed6e0ffb6fbb1ff7e342
Author: Ian Davis <[email protected]>
Date:   Wed Apr 16 10:50:02 2025 -0700

    Adding more compilation and samples for fuzzing

Other Info

  • Workflow (contains the run artifacts).
  • Workflow Agent System Info: ubuntu-latest: Linux fv-az1781-260 6.8.0-1021-azure #25-Ubuntu SMP Wed Jan 15 20:45:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux.
  • Bug Reporting Timestamp: 2025.04.16 20:04 UTC (UTC - 8:00 = PST. UTC - 7:00 = PDT).
  • Playground reproduction
@github-actions github-actions bot added the bug Something isn't working label Apr 16, 2025
@idavis idavis assigned idavis and orpuente-MS and unassigned swernli Apr 16, 2025
@idavis idavis changed the title Fuzz: "==4398== ERROR: libFuzzer: out-of-memory (used: 4212Mb; limit: 4096Mb)" (ubuntu-latest) Fuzz: out-of-memory in typeck and hir lowering Apr 17, 2025
@swernli swernli self-assigned this Apr 22, 2025
swernli added a commit that referenced this issue Apr 24, 2025
This change updates the `Ty::Arrow` enum variant to use `Rc` which allows sharing of instances of callable types within the type infrastructure. To allow mutability during type inference, the underlying `Arrow` struct now uses `RefCell` for it's contained type and relies on runtime borrow checking for mutability.

Fixes #2302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants