mersenneforum.org GMP-ECM with gwnum failure
 Register FAQ Search Today's Posts Mark Forums Read

 2020-05-20, 20:03 #1 mathwiz   Mar 2019 5·13 Posts GMP-ECM with gwnum failure Got this failure today. I cannot tell if this is a bug in GMP-ECM or GWNUM, or some combination? Code: \$ echo "(7^2048+1)/4119427741479153633869060968771666377359362" | ./ecm -v -c 100 11e7 GMP-ECM 7.0.4 [configured with GMP 6.2.0, GWNUM 29.8, --enable-asm-redc] [ECM] Tuned for x86_64/k8/params.h Due to incompatible licenses, this binary file must not be distributed. Input number is (7^2048+1)/4119427741479153633869060968771666377359362 (1689 digits) Found number: 1*7^2048 + 1 Using mpz_mod Using B1=110000000, B2=900514153782, polynomial Dickson(30), sigma=0:16110665023593047747 dF=199680, k=2, d=2081310, d2=13, i0=40 Expected number of curves to find a factor of n digits: 35 40 45 50 55 60 65 70 75 80 34 133 600 3065 17462 108584 733594 5340128 4.2e+07 3.5e+08 Using gwnum_ecmStage1(1, 7, 2048, 1, 110000000, 1) ecm: Fgw.c:399: gw_ecm_stage1: Assertion siz_x <= (unsigned long) ((gw_x)->_mp_alloc)' failed. Aborted
 2020-05-20, 20:43 #2 Prime95 P90 years forever!     Aug 2002 Yeehaw, FL 6,833 Posts I believe the bug is in Fgw.c The lines: Code:  mpz_init2 (gw_x, (gw_n+1)*gw_log_2(gw_b)+64); mpz_init2 (gw_z, (gw_n+1)*gw_log_2(gw_b)+64); are not allocating enough space. This is an overkill solution: Code:  mpz_init2 (gw_x, (gw_n+1)*(gw_log_2(gw_b)+1)+64); mpz_init2 (gw_z, (gw_n+1)*(gw_log_2(gw_b)+1)+64); A proper solution would use floats to calculate gw_log_2
2020-05-20, 22:37   #3
mathwiz

Mar 2019

10000012 Posts

Quote:
 Originally Posted by Prime95 I believe the bug is in Fgw.c The lines: Code:  mpz_init2 (gw_x, (gw_n+1)*gw_log_2(gw_b)+64); mpz_init2 (gw_z, (gw_n+1)*gw_log_2(gw_b)+64); are not allocating enough space. This is an overkill solution: Code:  mpz_init2 (gw_x, (gw_n+1)*(gw_log_2(gw_b)+1)+64); mpz_init2 (gw_z, (gw_n+1)*(gw_log_2(gw_b)+1)+64);` A proper solution would use floats to calculate gw_log_2
Wow! Amazing how quickly you tracked that down. Thanks for your help.

The fix does seem to be working locally. I don't know if the GMP-ECM developers monitor this forum; perhaps they should be made aware of the proposed fix?

 2020-05-21, 09:49 #4 Prime95 P90 years forever!     Aug 2002 Yeehaw, FL 6,833 Posts The developers report the problem is fixed in revision 3084

 Similar Threads Thread Thread Starter Forum Replies Last Post enzocreti enzocreti 22 2019-03-14 18:35 Jean PennĂ© Software 25 2010-11-01 15:18 Unregistered Information & Answers 3 2010-09-12 19:52 Cyclamen Persicum Software 1 2007-01-02 20:53 ATH GMP-ECM 8 2006-07-17 18:02

All times are UTC. The time now is 02:52.

Sat May 30 02:52:53 UTC 2020 up 66 days, 25 mins, 1 user, load averages: 1.11, 1.13, 1.22