NilFoundation / zkLLVM

Zero-Knowledge Proof Systems Circuit Compiler
https://docs.nil.foundation/zkllvm
278 stars 48 forks source link

[Possible bug] bls verification proof generation ends with segmentation fault #504

Open manylov opened 7 months ago

manylov commented 7 months ago

Describe the bug Using https://github.com/NilFoundation/zkllvm-template/tree/nkaskov-update-cmake template, running circuit and input from here https://github.com/Resolfinity/zkllvm-casper-experiments/tree/main/5.bls-400-pubkeys doing proof-generator-single-threaded , i got error

proof-generator-single-threaded     --circuit="template.crct"     --assignment-table="template.tbl"     --proof="proof.bin"
[2024-01-17 11:17:19.608139] [0x00007fdc96e57740] [info]    Preprocessing public data...

[2024-01-17 11:17:25.511385] [0x00007fdc96e57740] [info]    Preprocessing private data...

[2024-01-17 11:17:25.539853] [0x00007fdc96e57740] [info]    Generating proof (zero gates)...

[2024-01-17 11:17:25.539865] [0x00007fdc96e57740] [info]    Proof generated

[2024-01-17 11:17:25.539869] [0x00007fdc96e57740] [info]    Writing proof to "proof.bin"...

[2024-01-17 11:17:25.539920] [0x00007fdc96e57740] [info]    Proof written

[2024-01-17 11:17:25.545646] [0x00007fdc96e57740] [info]    Proof is verified

[2024-01-17 11:17:25.545650] [0x00007fdc96e57740] [info]    Writing proof to "proof.bin"
Segmentation fault (core dumped)

it happened after proof.bin was built and written to the file system.

To Reproduce How to reproduce the behavior:

  1. compile circuit from https://github.com/Resolfinity/zkllvm-casper-experiments/tree/main/5.bls-400-pubkeys
  2. use public-input.json from https://github.com/Resolfinity/zkllvm-casper-experiments/blob/main/5.bls-400-pubkeys/main-input.json
  3. run assigner with -e bls12381
  4. run proof-generator-single-threaded --circuit="template.crct" --assignment-table="template.tbl" --proof="proof.bin"

Expected behavior No error in the end?

Toolchain versions

  1. zkllvm from apt install

Backtrace If you have the backtrace - please attach it as text or file. It will help us a lot with the debug.