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

Intermittent EOF running test programs #6445

Closed
aakoshh opened this issue Nov 4, 2024 · 1 comment · Fixed by #6455
Closed

Intermittent EOF running test programs #6445

aakoshh opened this issue Nov 4, 2024 · 1 comment · Fixed by #6455
Labels
bug Something isn't working

Comments

@aakoshh
Copy link
Contributor

aakoshh commented Nov 4, 2024

Aim

Trying to run test_programs with different --inliner-aggressiveness in #6429

Expected Behavior

Tests should either pass or fail with some Noir error message.

Bug

Random tests fail with error messages such as:

thread 'tests::compile_success_empty::test_comptime_module::_0_expects' panicked at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/ops/function.rs:250:5:
Unexpected failure.
code=1
stderr=```"Error: could not deserialize build program: EOF while parsing a value at line 1 column 0\n"```

or on one occasion:

---- tests::execution_success::test_brillig_calls_conditionals::_0_expects stdout ----
thread 'tests::execution_success::test_brillig_calls_conditionals::_0_expects' panicked at /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/ops/function.rs:250:5:
Unexpected failure.
code=1
stderr=``````
bug: Input to brillig function is in a separate subgraph to output
  ┌─ /Users/aakoshh/Work/aztec/noir/test_programs/execution_success/brillig_calls_conditionals/src/main.nr:8:16
  │
8 │         assert(entry_point(x[2]) == 9);
  │                ----------------- There is no path from the output of this brillig call to either return values or inputs of the circuit, which creates an independent subgraph. This is quite likely a soundness vulnerability
  │
  = Call stack:
    1. /Users/aakoshh/Work/aztec/noir/test_programs/execution_success/brillig_calls_conditionals/src/main.nr:8:16
...
Error: could not deserialize build program: trailing characters at line 1 column 2133

These are coming from cli::fs::program::read_program_from_file which are trying to read the file such as this:

`❯ cat /Users/aakoshh/Work/aztec/noir/test_programs/compile_success_empty/attribute_args/target/attribute_args.json
{"noir_version":"0.37.0+13856a121125b1ccca15919942081a5d157d280e","hash":1287190096186239942,"abi":{"parameters":[],"return_type":null,"error_types":{}},"bytecode":"H4sIAAAAAAAA/5XDsQkAAADCMAv+f7PuTgaCFm2dAi5Hj45JAAAA","debug_symbols":"XYxLCoAwDAXvkrUn8Coi0k9aAqEpsRWk9O5+cCFdzhveNPBoa9woBdlhXhqwOFNI0k2tT2CVmCluw3wYJWMZPww1uZ8tZ8bhn1Uc+qr4lF7X134B","file_map":{},"names":["main"],"brillig_names":[]}⏎                                                                                         

One explanation could be that the file is not flushed, but more likely is that we used to run tests like test_foo and test_foo_brillig on the same project, and now we run even more because of the 3 different inliner aggressiveness, and if these are executed in parallel then one might be trying to read the program while the other deletes it to compile it with different flags.

To Reproduce

  1. cargo test -q -p nargo_cli --test execute
  2. Look for Error: could not deserialize build program: in the output

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

nargo version = 0.36.0 noirc version = 0.36.0+2f0cb3e80f3d93a1dee77fffacc397811e300257 (git version hash: 2f0cb3e, is dirty: false)

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 4, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Nov 4, 2024
@aakoshh
Copy link
Contributor Author

aakoshh commented Nov 4, 2024

Fixed in 52d25ac as part of #6429

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