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

Compiler panic when performing multiplication between i127 items. #4125

Closed
pventuzelo opened this issue Jan 23, 2024 · 2 comments
Closed

Compiler panic when performing multiplication between i127 items. #4125

pventuzelo opened this issue Jan 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@pventuzelo
Copy link

pventuzelo commented Jan 23, 2024

Aim

We (https://github.com/FuzzingLabs) find that the compiler panics and crashes when we perform a multiplication between i127 items.

Expected Behavior

No crash.

Bug

This crash occurs specifically during the multiplication of i127 items; employing different types or operators will avoid this crash. The panic arises in the "from" function, suggesting that the compiler attempts to inexplicably cast the i127 item to another type.

The panic crash occurs with the latest compiler version of the main branch. The error message is as follows:

The application panicked (crashed).
Message:  Cannot convert i128 as a string to a field element
Location: /home/afredefon/.nargo/noir-lang/noir/acvm-repo/acir_field/src/generic_ark.rs:105

To Reproduce

  1. Create a Noir project with the following command: nargo new test_issue
  2. Paste the code below into the file main.nr
  3. Compile the project using the following command: nargo compile
fn main() {
    // Crashes if we perform multiplication between two i127 items; the values of the items and the result of the multiplication seem to not matter.
    let var1: i127 = 1 * 1;

    // This crashes as well because of the multiplication in the assert statement.
    let var2 = 1;
    assert(var2 * var2 == 1);

    // Same crash when we cast to i127 in the multiplication operation.
    let var3: Field = 45;
    assert((var3 as i127) * (var3 as i127) == 1);

    // No crash with other operators.
    let var4: i127 = 1 / 1;

    // No crash with other types, even with u127.
    let var5: Field = 1 * 1;
}

Installation Method

None

Nargo Version

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@pventuzelo pventuzelo added the bug Something isn't working label Jan 23, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jan 23, 2024
@pventuzelo pventuzelo changed the title Compilerpanic when performing multiplication between i127 items. Compiler panic when performing multiplication between i127 items. Jan 23, 2024
@Savio-Sou
Copy link
Collaborator

Might be fixed as a part of #4162.

@TomAFrench
Copy link
Member

Closing as i127 is not longer a valid type

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