scipr-lab / libsnark

C++ library for zkSNARKs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmentation fault in cyggmp-10!.gmpn_add_n_coreisbr () from /usr/bin/cyggmp-10.dll

xuzhitong opened this issue · comments

commented

Windows 10 with g++ 9.3.0 under Cygwin 2.905 on x86-64 for ALT_BN128 curve choices (-DWITH_PROCPS=OFF and GTestdisabled)
The "Segmentation fault" happend when generated the keypair:

(enter) Call to r1cs_gg_ppzksnark_generator     [             ] (1597630943.3479s x0.00 from start)
  (enter) Call to r1cs_constraint_system::swap_AB_if_beneficial [             ] (1597630943.3501s x0.00 from start)
    (enter) Estimate densities                  [             ] (1597630943.3504s x0.00 from start)
      * Non-zero A-count (estimate): 15
      * Non-zero B-count (estimate): 15
    (leave) Estimate densities                  [0.0006s x0.00] (1597630943.3511s x0.00 from start)
    Swap is not beneficial, not performing
  (leave) Call to r1cs_constraint_system::swap_AB_if_beneficial [0.0013s x0.00] (1597630943.3514s x0.00 from start)
  (enter) Call to r1cs_to_qap_instance_map_with_evaluation      [             ] (1597630943.3518s x0.00 from start)
    (enter) Compute evaluations of A, B, C, H at t      [             ] (1597630943.3524s x0.00 from start)
    (leave) Compute evaluations of A, B, C, H at t      [0.0003s x0.00] (1597630943.3527s x0.00 from start)
  (leave) Call to r1cs_to_qap_instance_map_with_evaluation      [0.0011s x0.00] (1597630943.3529s x0.00 from start)
  * QAP number of variables: 17
  * QAP pre degree: 18
  * QAP degree: 20
  * QAP number of input variables: 1
  (enter) Compute query densities               [             ] (1597630943.3534s x0.00 from start)
  (leave) Compute query densities               [0.0001s x0.00] (1597630943.3535s x0.00 from start)
  (enter) Compute gamma_ABC for R1CS verification key   [             ] (1597630943.3537s x0.00 from start)
  (leave) Compute gamma_ABC for R1CS verification key   [0.0001s x0.00] (1597630943.3538s x0.00 from start)
  (enter) Compute L query for R1CS proving key  [             ] (1597630943.3540s x0.00 from start)
  (leave) Compute L query for R1CS proving key  [0.0001s x0.00] (1597630943.3541s x0.00 from start)
  (enter) Generating G1 MSM window table        [             ] (1597630943.3542s x0.00 from start)

Thread 1 "range" received signal SIGSEGV, Segmentation fault.
0x00000003f8ddd4c9 in cyggmp-10!.gmpn_add_n_coreisbr () from /usr/bin/cyggmp-10.dll

The fault happend on the below code

alt_bn128_G1 alt_bn128_G1::random_element()
{
   return (scalar_field::random_element().as_bigint()) * G1_one;
}

I can't find the cause of the preblem,please help to check it.Thanks!