mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > GMP-ECM

Reply
 
Thread Tools
Old 2020-05-20, 20:03   #1
mathwiz
 
Mar 2019

5·13 Posts
Default 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
mathwiz is offline   Reply With Quote
Old 2020-05-20, 20:43   #2
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

6,833 Posts
Default

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
Prime95 is offline   Reply With Quote
Old 2020-05-20, 22:37   #3
mathwiz
 
Mar 2019

10000012 Posts
Default

Quote:
Originally Posted by Prime95 View Post
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?
mathwiz is offline   Reply With Quote
Old 2020-05-21, 09:49   #4
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

6,833 Posts
Default

The developers report the problem is fixed in revision 3084
Prime95 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
GWNUM enzocreti enzocreti 22 2019-03-14 18:35
LLR V3.8.2 using gwnum 26.2 is available! Jean Penné Software 25 2010-11-01 15:18
GWNUM? Unregistered Information & Answers 3 2010-09-12 19:52
GWNUM as DLL? Cyclamen Persicum Software 1 2007-01-02 20:53
compiling gwnum 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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.