mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2017-07-30, 02:03   #419
storflyt32
 
Feb 2013

2×229 Posts
Default

starting SIQS on c72:

201091399516857640326435500949289872243227757344600252243806245006187681

Here the small caps for the C72 makes for some frustration in my opinion, when it comes to possible reporting, even though syntax itself should not matter.

Perhaps a fix could be made here?

Last fiddled with by storflyt32 on 2017-07-30 at 02:05
storflyt32 is offline   Reply With Quote
Old 2017-09-24, 21:36   #420
Stargate38
 
Stargate38's Avatar
 
"Daniel Jackson"
May 2011
14285714285714285714

23·34 Posts
Angry Large numbers crashing Yafu after finishing operations

A problem that seriously needs fixed. Running this from cmd.exe:

Code:
yafu "anyfunction(n)"
results in this:

Code:
Faulting application name: yafu.exe, version: 0.0.0.0, time stamp: 0x5137c9fa
Faulting module name: ntdll.dll, version: 10.0.15063.608, time stamp: 0x8274fd8b
Exception code: 0xc0000374 (heap corruption)
Fault offset: 0x00000000000f775f
Faulting process id: 0x23f0
Faulting application start time: 0x01d33577d6eca7e1
Faulting application path: C:\Users\*\Desktop\Sequences\Yafu\yafu.exe
Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
Report Id: 344ef0f7-ee94-4833-92a3-5c84122aff34
Faulting package full name: 
Faulting package-relative application ID:
Where n is this number: http://www.factordb.com/index.php?id...00000987900980, and anyfunction is any function that will usually succeed to work on large numbers (size, rho, pm1, pp1, ecm, etc.). Running on Windows 10 64-bit, 8GB RAM, 203 GB free space (out of 1 TB total), Intel Core i5-7200 CPU @ 2.50GHz.

Another number that causes the same crash: http://www.factordb.com/index.php?id...00000987898024

Here's the output of the program when I try to run rho() on the 1st number:

Code:
09/24/17 17:22:06 v1.34.5 @ LAPTOP-********, System/Build Info:
Using GMP-ECM 6.3, Powered by GMP 5.1.1
detected Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
detected L1 = 32768 bytes, L2 = 3145728 bytes, CL = 64 bytes
measured cpu frequency ~= 2940.357340
using 20 random witnesses for Rabin-Miller PRP checks

===============================================================
======= Welcome to YAFU (Yet Another Factoring Utility) =======
=======             bbuhrow@gmail.com                   =======
=======     Type help at any time, or quit to quit      =======
===============================================================
cached 78498 primes. pmax = 999983


>> rho: x^2 + 3, starting 65536 iterations on C1233
rho: x^2 + 2, starting 65536 iterations on C1233
rho: x^2 + 1, starting 65536 iterations on C1233


***factors found***


***co-factor***
C1233 = <snip>

ans = <snip>
It seems to succeed in running, but after showing "Factors Found" and ans=<snip>, it crashes. What's causing it to crash like that? It works fine when I type "size(2^11213-1)", or "nextprime(10^1000)".

Last fiddled with by Stargate38 on 2017-09-24 at 21:39 Reason: Clarity
Stargate38 is offline   Reply With Quote
Old 2017-09-25, 17:37   #421
jcrombie
 
jcrombie's Avatar
 
"Jonathan"
Jul 2010
In a tangled web...

110101102 Posts
Default

It's a buffer overflow. Buffer size is 1024 which means 1023 is the max number of digits for your input number n.

driver.c L109

Code:
        indup = (char *)malloc(GSTR_MAXSIZE*sizeof(char));

yafu.h L45

Code:
#define GSTR_MAXSIZE 1024
Cheers
jcrombie is offline   Reply With Quote
Old 2017-09-26, 14:30   #422
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

22·23·37 Posts
Default

Fixes were committed for this problem a while ago... I just verified that everything works fine on this number on win64 with the head revision.
bsquared is offline   Reply With Quote
Old 2017-09-28, 19:36   #423
jcrombie
 
jcrombie's Avatar
 
"Jonathan"
Jul 2010
In a tangled web...

2·107 Posts
Default

So doing some more poking around. (svn 366 in Ubuntu bash for windows). It does crash later on with the indup variable, but here is where it first does something bad.


Code:
(gdb) start "rho(877484898293638023052104720582962643578510448895003171755416652881022744968205909006321114598700673124711123728035672068966232613140006235679085975673852472145646827200551075752843197181882706816865719514469982586217000478926354144250799603994965529803880853450824762752971521224118193753960376301891393101192926388840316250625881493813614892233460561359331216865969501989567443981497045774275728330009070663342501794381419796284396459838813515501752495000759043211299435194600592376010731346519117391525155189419080750570739695440932243221092104479096931342067743261940045350359594857383136058690064263086648379021846102520799840668578959805259098143519261465804895234482565736935726393784481578082352799139967598644435845896872599432271500099738151306839285197805496721860274295357492895339853779099590314381907683406444772510240722257906692458880537643536303492908218887804751173728370918936722489101797694013183200165286773298174514373813888654430311223284916853932725043573719794306565689939993658036417541348636856689499254550820183426479957996179297709365203832600391285463534689263317978692381364040402447596950455387027119957510063323532256359931588898320375778216631685161167849429114006338067958068145809824152612711032053)"
Temporary breakpoint 1 at 0x410062: file top/driver.c, line 101.
Starting program: /home/jcrombie/yafu/debug/yafu "rho(877484898293638023052104720582962643578510448895003171755416652881022744968205909006321114598700673124711123728035672068966232613140006235679085975673852472145646827200551075752843197181882706816865719514469982586217000478926354144250799603994965529803880853450824762752971521224118193753960376301891393101192926388840316250625881493813614892233460561359331216865969501989567443981497045774275728330009070663342501794381419796284396459838813515501752495000759043211299435194600592376010731346519117391525155189419080750570739695440932243221092104479096931342067743261940045350359594857383136058690064263086648379021846102520799840668578959805259098143519261465804895234482565736935726393784481578082352799139967598644435845896872599432271500099738151306839285197805496721860274295357492895339853779099590314381907683406444772510240722257906692458880537643536303492908218887804751173728370918936722489101797694013183200165286773298174514373813888654430311223284916853932725043573719794306565689939993658036417541348636856689499254550820183426479957996179297709365203832600391285463534689263317978692381364040402447596950455387027119957510063323532256359931588898320375778216631685161167849429114006338067958068145809824152612711032053)"
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Temporary breakpoint 1, main (argc=2, argv=0x7ffffffddf28) at top/driver.c:101
101             uint32 insize = GSTR_MAXSIZE;
(gdb) b 1186
Breakpoint 2 at 0x411eae: file top/driver.c, line 1186.
(gdb) c
Continuing.

Breakpoint 2, process_flags (argc=1, argv=0x7ffffffddf30, fobj=0x813450, expression=0x811010 "") at top/driver.c:1186
1186                                    strcpy(expression, argv[i]);
(gdb) p i
$1 = 0
(gdb) p argv[i]
$2 = 0x7ffffffde13f "rho(8774848982936380230521047205829626435785104488950031717554166528810227449682059090063211145987006731247111237280356720689662326131400062356790859756738524721456468272005510757528431971818827068168"...
(gdb) p expression
$3 = 0x811010 ""
(gdb) bt
#0  process_flags (argc=1, argv=0x7ffffffddf30, fobj=0x813450, expression=0x811010 "") at top/driver.c:1186
#1  0x0000000000411008 in process_arguments (argc=2, argv=0x7ffffffddf28, input_exp=0x811010 "", fobj=0x813450) at top/driver.c:660
#2  0x00000000004100dd in main (argc=2, argv=0x7ffffffddf28) at top/driver.c:127
(gdb) n
1187                                    i++;
(gdb) p expression
$4 = 0x811010 "rho(8774848982936380230521047205829626435785104488950031717554166528810227449682059090063211145987006731247111237280356720689662326131400062356790859756738524721456468272005510757528431971818827068168"...
(gdb) p expression[1023]
$5 = 54 '6'
(gdb) p expression[1024]
$6 = 54 '6'
(gdb)
Note: expression is "input_exp" which is size 1024.

Hope this helps.

Cheers.
jcrombie is offline   Reply With Quote
Old 2017-09-28, 20:38   #424
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

1101010011002 Posts
Default

Many apologies because I no doubt have a messed up design flow, but I have been doing all recent work in /branches/wip... whereas it looks like you are using /trunk. There are years worth of bugfixes incorporated into /branches/wip
bsquared is offline   Reply With Quote
Old 2017-09-28, 20:52   #425
jcrombie
 
jcrombie's Avatar
 
"Jonathan"
Jul 2010
In a tangled web...

21410 Posts
Default

Quote:
Originally Posted by bsquared View Post
Many apologies because I no doubt have a messed up design flow, but I have been doing all recent work in /branches/wip... whereas it looks like you are using /trunk. There are years worth of bugfixes incorporated into /branches/wip
Yep, using /trunk. Will definitely have to check out what goodies are in /wip.
jcrombie is offline   Reply With Quote
Old 2017-09-30, 13:49   #426
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

2·19·97 Posts
Default FYI Only

I had an endless loop with the wip version on one of my antiques, but the trunk version handles it fine. I just thought you might like to know:

wip:
Code:
09/30/17 09:10:29 v1.34.5 @ math45, System/Build Info: 
Using GMP-ECM, Powered by GMP
detected Intel(R) Core(TM)2 CPU         T7200  @ 2.00GHz
detected L1 = 32768 bytes, L2 = 4194304 bytes, CL = 64 bytes
measured cpu frequency ~= 1994.994480
using 20 random witnesses for Rabin-Miller PRP checks

===============================================================
======= Welcome to YAFU (Yet Another Factoring Utility) =======
=======             bbuhrow@gmail.com                   =======
=======     Type help at any time, or quit to quit      =======
===============================================================
cached 78498 primes. pmax = 999983


>> fac: factoring 53328191978809684351724837484130927400835653355931902186862139553960230045046366226081
fac: using pretesting plan: normal
fac: using tune info for qs/gnfs crossover
div: primes less than 10000
div: found prime factor = 7
div: found prime factor = 11
div: found prime factor = 13
div: found prime factor = 31
div: found prime factor = 61
div: found prime factor = 101
div: found prime factor = 107
div: found prime factor = 109
div: found prime factor = 251
div: found prime factor = 281
div: found prime factor = 1021
div: found prime factor = 1061
div: found prime factor = 3181
div: found prime factor = 4241
div: found prime factor = 4441
div: found prime factor = 6883
div: found prime factor = 9859
rho: x^2 + 3, starting 1000 iterations on C44 
rho: x^2 + 2, starting 1000 iterations on C44 
rho: found prp5 factor = 12721
rho: x^2 + 2, starting 1000 iterations on C40 
rho: found prp5 factor = 12421
rho: x^2 + 2, starting 1000 iterations on C36 
rho: found prp5 factor = 41341
rho: x^2 + 2, starting 1000 iterations on C32 
rho: found prp5 factor = 23981
rho: x^2 + 2, starting 1000 iterations on C27 
rho: found prp6 factor = 296981
rho: x^2 + 2, starting 1000 iterations on C22 
rho: found prp5 factor = 47743
rho: x^2 + 2, starting 1000 iterations on C17 
rho: x^2 + 1, starting 1000 iterations on C17 
fac: ecm effort reduced from 5.23 to 4.07: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 22.26
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 368.26
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 379.09
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 379.09
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 252.73
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 379.09
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 379.09
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 379.09
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 379.09
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 379.09
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 379.09
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 390.58
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 379.09
fac: ecm effort reduced from 0.31 to 0.24: input has snfs form
...
trunk:
Code:
09/30/17 09:23:01 v1.34.5 @ math45, System/Build Info: 
Using GMP-ECM 7.0.3, Powered by GMP 6.1.1
detected Intel(R) Core(TM)2 CPU         T7200  @ 2.00GHz
detected L1 = 32768 bytes, L2 = 4194304 bytes, CL = 64 bytes
measured cpu frequency ~= 1994.995680
using 1 random witnesses for Rabin-Miller PRP checks

===============================================================
======= Welcome to YAFU (Yet Another Factoring Utility) =======
=======             bbuhrow@gmail.com                   =======
=======     Type help at any time, or quit to quit      =======
===============================================================
cached 78498 primes. pmax = 999983


>> fac: factoring 53328191978809684351724837484130927400835653355931902186862139553960230045046366226081
fac: using pretesting plan: normal
fac: no tune info: using qs/gnfs crossover of 95 digits
div: primes less than 10000
div: found prime factor = 7
div: found prime factor = 11
div: found prime factor = 13
div: found prime factor = 31
div: found prime factor = 61
div: found prime factor = 101
div: found prime factor = 107
div: found prime factor = 109
div: found prime factor = 251
div: found prime factor = 281
div: found prime factor = 1021
div: found prime factor = 1061
div: found prime factor = 3181
div: found prime factor = 4241
div: found prime factor = 4441
div: found prime factor = 6883
div: found prime factor = 9859
rho: x^2 + 3, starting 1000 iterations on C44 
rho: found prp5 factor = 41341
rho: x^2 + 3, starting 1000 iterations on C40 
rho: found prp5 factor = 12421
rho: x^2 + 3, starting 1000 iterations on C36 
rho: found prp5 factor = 23981
rho: x^2 + 3, starting 1000 iterations on C31 
rho: found prp5 factor = 12721
rho: x^2 + 3, starting 1000 iterations on C27 
rho: found prp5 factor = 47743
rho: x^2 + 3, starting 1000 iterations on C23 
rho: found prp6 factor = 296981
rho: x^2 + 3, starting 1000 iterations on C17 
rho: x^2 + 2, starting 1000 iterations on C17 
rho: x^2 + 1, starting 1000 iterations on C17 
fac: trivial ECM work to do... skipping to sieve method
pretesting / qs ratio was 26.72
Total factoring time = 0.0195 seconds


***factors found***

P1 = 7
P2 = 11
P2 = 13
P2 = 31
P2 = 61
P3 = 101
P3 = 107
P3 = 109
P3 = 251
P3 = 281
P4 = 1021
P4 = 1061
P4 = 3181
P4 = 4241
P4 = 4441
P4 = 6883
P4 = 9859
P5 = 41341
P5 = 12421
P5 = 23981
P5 = 12721
P5 = 47743
P6 = 296981
P9 = 176939197
P9 = 195914501

ans = 1
No stoppage - just for info.

Thanks for all.
EdH is offline   Reply With Quote
Old 2017-09-30, 18:02   #427
jcrombie
 
jcrombie's Avatar
 
"Jonathan"
Jul 2010
In a tangled web...

2·107 Posts
Default

Hi Ed,

Just tried my freshly compiled wip version with your number,


Code:
09/30/17 11:46:56 v1.35-beta @ Octacore, System/Build Info:
Using GMP-ECM 7.0.4, Powered by GMP 6.1.2
detected AMD FX(tm)-8150 Eight-Core Processor
detected L1 = 16384 bytes, L2 = 8388608 bytes, CL = 64 bytes
measured cpu frequency ~= 3611.975750
using 1 random witnesses for Rabin-Miller PRP checks

===============================================================
======= Welcome to YAFU (Yet Another Factoring Utility) =======
=======             bbuhrow@gmail.com                   =======
=======     Type help at any time, or quit to quit      =======
===============================================================
cached 78498 primes. pmax = 999983


>> factor(53328191978809684351724837484130927400835653355931902186862139553960230045046366226081)
fac: factoring 53328191978809684351724837484130927400835653355931902186862139553960230045046366226081
fac: using pretesting plan: normal
fac: using tune info for qs/gnfs crossover
div: primes less than 10000
fmt: 1000000 iterations
rho: x^2 + 3, starting 1000 iterations on C44
rho: x^2 + 3, starting 1000 iterations on C40
rho: x^2 + 3, starting 1000 iterations on C36
rho: x^2 + 3, starting 1000 iterations on C31
rho: x^2 + 3, starting 1000 iterations on C27
rho: x^2 + 3, starting 1000 iterations on C23
rho: x^2 + 3, starting 1000 iterations on C17
rho: x^2 + 2, starting 1000 iterations on C17
rho: x^2 + 1, starting 1000 iterations on C17
Total factoring time = 0.0247 seconds


***factors found***

P1 = 7
P2 = 11
P2 = 13
P2 = 31
P2 = 61
P3 = 101
P3 = 107
P3 = 109
P3 = 251
P3 = 281
P4 = 1021
P4 = 1061
P4 = 3181
P4 = 4241
P4 = 4441
P4 = 6883
P4 = 9859
P5 = 41341
P5 = 12421
P5 = 23981
P5 = 12721
P5 = 47743
P6 = 296981
P9 = 176939197
P9 = 195914501
1
>>
Notice the version is "v1.35-beta", so maybe that is why I'm getting the different result.


@Ben,

Loving your program!! Just had to modify the maxa in snfs.c to 10000 and handle the "exit(0)" in msieve library and now it's apparently unstoppable as it digests a big batchfile.
jcrombie is offline   Reply With Quote
Old 2017-09-30, 22:07   #428
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

368610 Posts
Default

Quote:
Originally Posted by jcrombie View Post
Hi Ed,

Just tried my freshly compiled wip version with your number,


Notice the version is "v1.35-beta", so maybe that is why I'm getting the different result.
...
The odd thing is, that both of my examples are clean downloads from today. Both are revision 366. Yet, my builds say 1.34.5 and yours says 1.35-beta.

I just noticed that on a different machine, YAFU compiled from 366 wip is 1.35-beta. The other difference is that that machine has 7.0.4 and 6.1.2 (GMP/ECM), as does yours. I'm going to update GMP & ECM and see what turns up.
EdH is offline   Reply With Quote
Old 2017-09-30, 22:24   #429
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

22×23×37 Posts
Default

Quote:
Originally Posted by jcrombie View Post


@Ben,

Loving your program!! Just had to modify the maxa in snfs.c to 10000 and handle the "exit(0)" in msieve library and now it's apparently unstoppable as it digests a big batchfile.
Glad to hear it!
bsquared is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
Where to report bugs Matt Software 1 2007-02-20 19:13
Possible Prime95 bugs JuanTutors Software 9 2006-09-24 21:22
RMA 1.7 beta bugs TTn 15k Search 2 2004-11-24 22:11
RMA 1.6 fixes LLR bugs! TTn 15k Search 16 2004-06-16 01:22

All times are UTC. The time now is 14:29.

Thu Apr 15 14:29:26 UTC 2021 up 7 days, 9:10, 0 users, load averages: 2.53, 2.73, 2.52

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.