Skip to content
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

nargo crashes generating ACIR if SSA IDs are normalised #6521

Closed
aakoshh opened this issue Nov 14, 2024 · 0 comments · Fixed by #6740
Closed

nargo crashes generating ACIR if SSA IDs are normalised #6521

aakoshh opened this issue Nov 14, 2024 · 0 comments · Fixed by #6740
Labels
bug Something isn't working

Comments

@aakoshh
Copy link
Contributor

aakoshh commented Nov 14, 2024

Aim

I was investigating #6520 and tried commenting out the printing of the SSA pass but leaving the call to ssa.normalize_ids(); in. Then I tried to compile fold_2_to_17 and saw the application crash in a different way, this time during ACIR gen.

Expected Behavior

With the printing commented out I expected the program to compile.

Bug

~/Work/aztec/noir/test_programs/execution_success/fold_2_to_17RUST_BACKTRACE=1 cargo run -q -p nargo_cli --  --program-dir . compile --show-ssa
warning: unused variable: `msg`
   --> compiler/noirc_evaluator/src/ssa.rs:441:24
    |
441 |     fn print(mut self, msg: &str) -> Self {
    |                        ^^^ help: if this is intentional, prefix it with an underscore: `_msg`
    |
    = note: `#[warn(unused_variables)]` on by default

The application panicked (crashed).
Message:  internal error: entered unreachable code: Expected an associated final index for call to acir function f1 with args [Id(0)]
Location: compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs:805

This is a bug. We may have already fixed this in newer versions of Nargo so try searching for similar issues at https://github.com/noir-lang/noir/issues/.
If there isn't an open issue for this bug, consider opening one at https://github.com/noir-lang/noir/issues/new?labels=bug&template=bug_report.yml

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 13 frames hidden ⋮                              
  14: noirc_evaluator::ssa::acir_gen::Context::convert_ssa_call::hfd35c09554e8433a
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs:805
  15: noirc_evaluator::ssa::acir_gen::Context::convert_ssa_instruction::h4b2f3c2b8a885846
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs:717
  16: noirc_evaluator::ssa::acir_gen::Context::convert_acir_main::hef8c2c04c27b0b71
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs:436
  17: noirc_evaluator::ssa::acir_gen::Context::convert_ssa_function::hd80ddd3b0a145ae1
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs:392
  18: noirc_evaluator::ssa::acir_gen::<impl noirc_evaluator::ssa::ssa_gen::program::Ssa>::into_acir::h09067afd42cb908a
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs:303
  19: noirc_evaluator::ssa::optimize_into_acir::{{closure}}::h88300a1e6ec66447
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_evaluator/src/ssa.rs:148
  20: noirc_evaluator::ssa::time::hceddfb481aadb799
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_evaluator/src/ssa.rs:156
  21: noirc_evaluator::ssa::optimize_into_acir::h24c31af36eb31fe9
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_evaluator/src/ssa.rs:147
  22: noirc_evaluator::ssa::create_program::h64f2e22eabd71bdd
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_evaluator/src/ssa.rs:230
  23: noirc_driver::compile_no_check::ha6d81709b83a6d4f
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_driver/src/lib.rs:595
  24: noirc_driver::compile_main::h0ce627c503b459a8
      at /Users/aakoshh/Work/aztec/noir/compiler/noirc_driver/src/lib.rs:342
  25: nargo::ops::compile::compile_program_with_debug_instrumenter::hbf9b46a47d3e0908
      at /Users/aakoshh/Work/aztec/noir/tooling/nargo/src/ops/compile.rs:92
  26: nargo::ops::compile::compile_program::h8dd2615617770064
      at /Users/aakoshh/Work/aztec/noir/tooling/nargo/src/ops/compile.rs:67
  27: nargo::cli::compile_cmd::compile_programs::{{closure}}::h315d5e3fb51b7747
      at /Users/aakoshh/Work/aztec/noir/tooling/nargo_cli/src/cli/compile_cmd.rs:183
...                

To Reproduce

  1. cd test_programs/execution_success/fold_2_to_17
  2. Comment out println!("{msg}\n{}", self.ssa); in SsaBuilder::print.
  3. cargo run -q -p nargo_cli -- --program-dir . compile --show-ssa

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

nargo version = 0.38.0 noirc version = 0.38.0+efd763cb77b3709948ef54ae534cbc3f1a8de0e9 (git version hash: a42c643, is dirty: true)

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@aakoshh aakoshh added the bug Something isn't working label Nov 14, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Nov 14, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Dec 9, 2024
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
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant