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

ICE: unreachable code #4497

Closed
nventuro opened this issue Mar 6, 2024 · 4 comments
Closed

ICE: unreachable code #4497

nventuro opened this issue Mar 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@nventuro
Copy link
Contributor

nventuro commented Mar 6, 2024

Aim

I run into an ICE while performing routine development.

Expected Behavior

I expected to not run into an ICE?

Bug

I get the following error message:

The application panicked (crashed).
Message:  internal error: entered unreachable code: Expected all allocate instructions to be removed before acir_gen
Location: compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs:498

I produced a relatively minimal example, in which calling a trivial unconstrained function triggers the ICE, and calling a copy of that function that is constrained does not.

To Reproduce

The example can be found in this commit.

  1. git checkout a3b17b9472677e967651886f1fd2cff4d9f76ef8
  2. cd noir-projects/noir-contracts/
  3. nargo compile --package ice_contract --silence-warnings
  4. cry

If the call to view_notes is commented out and the call to view_notes_constrained is uncommented, there's no compilation error. Both functions are identical except for the unconstrained modifier.

Project Impact

Blocker

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Installation Method

Compiled from source

Nargo Version

nargo version = 0.24.0 noirc version = 0.24.0+edaef211ea08832b1aaabcfc8b3f2419c3a2184c (git version hash: edaef211ea08832b1aaabcfc8b3f2419c3a2184c, is dirty: false)

NoirJS Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@Savio-Sou
Copy link
Collaborator

@nventuro would you be able to come up with a minimal reproduction that relies less on Aztec.nr? That'd be super helpful to ease our further debugging.

@nventuro
Copy link
Contributor Author

nventuro commented Mar 8, 2024

I was unable - I tried replicating this by creating a second crate and calling a function declared there, but doing so I ended up triggering a different ICE: see #4517.

The original example shown here does not rely that much on aztec-nr however, even though there's a contract etc., no library code is called.

@Savio-Sou
Copy link
Collaborator

Savio-Sou commented Mar 11, 2024

Ah sorry I meant also and perhaps more importantly Aztec macros, not just Aztec.nr.

As there could be the possibility that the bug lies within the macros, it'd be great to get a macro-less reproduction to better identify where the problem lies.

@TomAFrench
Copy link
Member

Closing this as this seems to be more of an aztec_macros issue than Noir.

@TomAFrench TomAFrench closed this as not planned Won't fix, can't repro, duplicate, stale Apr 20, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Apr 20, 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
Archived in project
Development

No branches or pull requests

3 participants