mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   YAFU (https://www.mersenneforum.org/forumdisplay.php?f=96)
-   -   yafu bugs (https://www.mersenneforum.org/showthread.php?t=16667)

Dubslow 2014-09-19 00:39

[code]
gcc -g -march=native -mtune=native -DUSE_SSE41 -DUSE_NFS -O3 -fomit-frame-pointer -Wall -I. -Iinclude -I/usr/local/include -c -o factor/qs/tdiv_med_32k.o factor/qs/tdiv_med_32k.c
factor/qs/tdiv_med_32k.c: In function ‘tdiv_medprimes_32k’:
factor/qs/tdiv_med_32k.c:68:12: warning: variable ‘fb’ set but not used [-Wunused-but-set-variable]
sieve_fb *fb;
^
gcc -g -march=native -mtune=native -DUSE_SSE41 -DUSE_NFS -O3 -fomit-frame-pointer -Wall -I. -Iinclude -I/usr/local/include -c -o factor/qs/tdiv_med_64k.o factor/qs/tdiv_med_64k.c
factor/qs/tdiv_med_64k.c: In function ‘tdiv_medprimes_64k’:
factor/qs/tdiv_med_64k.c:68:12: warning: variable ‘fb’ set but not used [-Wunused-but-set-variable]
sieve_fb *fb;
^
gcc -g -march=native -mtune=native -DUSE_SSE41 -DUSE_NFS -O3 -fomit-frame-pointer -Wall -I. -Iinclude -I/usr/local/include -c -o factor/qs/tdiv_resieve_32k.o factor/qs/tdiv_resieve_32k.c
factor/qs/tdiv_resieve_32k.c: In function ‘resieve_medprimes_32k’:
factor/qs/tdiv_resieve_32k.c:70:19: warning: variable ‘fullfb_ptr’ set but not used [-Wunused-but-set-variable]
fb_element_siqs *fullfb_ptr, *fullfb = sconf->factor_base->list;
^
factor/qs/tdiv_resieve_32k.c:68:12: warning: variable ‘fb’ set but not used [-Wunused-but-set-variable]
sieve_fb *fb;
^
gcc -g -march=native -mtune=native -DUSE_SSE41 -DUSE_NFS -O3 -fomit-frame-pointer -Wall -I. -Iinclude -I/usr/local/include -c -o factor/qs/tdiv_resieve_64k.o factor/qs/tdiv_resieve_64k.c
factor/qs/tdiv_resieve_64k.c: In function ‘resieve_medprimes_64k’:
factor/qs/tdiv_resieve_64k.c:70:19: warning: variable ‘fullfb_ptr’ set but not used [-Wunused-but-set-variable]
fb_element_siqs *fullfb_ptr, *fullfb = sconf->factor_base->list;
^
factor/qs/tdiv_resieve_64k.c:68:12: warning: variable ‘fb’ set but not used [-Wunused-but-set-variable]
sieve_fb *fb;
^
gcc -g -march=native -mtune=native -DUSE_SSE41 -DUSE_NFS -O3 -fomit-frame-pointer -Wall -I. -Iinclude -I/usr/local/include -c -o factor/qs/med_sieve_32k.o factor/qs/med_sieve_32k.c
In file included from factor/qs/med_sieve_32k.c:23:0:
factor/qs/med_sieve_32k.c: In function ‘med_sieveblock_32k’:
factor/qs/sieve_macros_32k.h:68:2: error: ‘asm’ operand has impossible constraints
__asm__ ( \
^
factor/qs/med_sieve_32k.c:70:2: note: in expansion of macro ‘SIEVE_13b_ASM’
SIEVE_13b_ASM;
^
factor/qs/sieve_macros_32k.h:8:2: error: ‘asm’ operand has impossible constraints
__asm__ ( \
^
factor/qs/med_sieve_32k.c:189:2: note: in expansion of macro ‘SIEVE_GT_BLOCKSIZE_ASM’
SIEVE_GT_BLOCKSIZE_ASM;
^
make: *** [factor/qs/med_sieve_32k.o] Error 1[/code]

bsquared 2014-09-19 03:31

Hrrrm. I guess I have been sloppy in the things I have checked in. Apologies. Paper writing and Real Life (tm) have kept me away from yafu for a while now. After I'm back from Brazil I will finally have time (I hope!) to start looking at some things again.

Oh, and welcome back Dubslow!

wombatman 2014-09-19 04:10

No worries! Good luck with the work!

Dubslow 2014-09-19 19:50

Hmm, after backtracking in an attempt to find the commit with the bug (and get a working elf) I got this at revision 321:
[code]gcc -g -O3 -fomit-frame-pointer -Wall -I. -Iinclude -I../gmp/include -I../gmp-ecm/include/linux factor/qs/msieve/lanczos.o factor/qs/msieve/lanczos_matmul0.o factor/qs/msieve/lanczos_matmul1.o factor/qs/msieve/lanczos_matmul2.o factor/qs/msieve/lanczos_pre.o factor/qs/msieve/sqrt.o factor/qs/msieve/savefile.o factor/qs/msieve/gf2.o top/driver.o top/utils.o top/stack.o top/calc.o top/test.o top/mpz_prp_prime.o factor/factor_common.o factor/rho.o factor/squfof.o factor/trialdiv.o factor/tune.o factor/qs/filter.o factor/qs/tdiv.o factor/qs/tdiv_small.o factor/qs/tdiv_med_32k.o factor/qs/tdiv_med_64k.o factor/qs/tdiv_resieve_32k.o factor/qs/tdiv_resieve_64k.o factor/qs/tdiv_large.o factor/qs/tdiv_scan.o factor/qs/large_sieve.o factor/qs/med_sieve_32k.o factor/qs/med_sieve_64k.o factor/qs/new_poly.o factor/qs/poly_roots_32k.o factor/qs/poly_roots_64k.o factor/qs/update_poly_roots_32k.o factor/qs/update_poly_roots_64k.o factor/qs/siqs_test.o factor/tinyqs/tinySIQS.o factor/qs/siqs_aux.o factor/qs/smallmpqs.o factor/qs/SIQS.o factor/gmp-ecm/ecm.o factor/gmp-ecm/pp1.o factor/gmp-ecm/pm1.o factor/nfs/nfs.o arith/arith0.o arith/arith1.o arith/arith2.o arith/arith3.o top/eratosthenes/count.o top/eratosthenes/offsets.o top/eratosthenes/primes.o top/eratosthenes/roots.o top/eratosthenes/linesieve.o top/eratosthenes/soe.o top/eratosthenes/tiny.o top/eratosthenes/worker.o top/eratosthenes/soe_util.o top/eratosthenes/wrapper.o -o yafu -L../gmp/lib/linux/x86_64 -L../gmp-ecm/lib/linux/x86_64 -lm -lpthread -lecm -lgmp
factor/factor_common.o: In function `schedule_work':
/home/bill/yafu/dev/factor/factor_common.c:1624: undefined reference to `snfs_find_form'
collect2: error: ld returned 1 exit status
make: *** [x86_64] Error 1
[/code]

Edit: It turns out svn's update command is [b]terrible[/b] and not to be trusted. I tried to compile in my old dev folder, and that was a mistake:

I got the original error above. I tried rewinding by `svn up -r (n-1)`, got back to when we were doing snfs things, and still got the same error.

Said screw this, deleted all the code, and reran `svn up -r 309` (I think it was 309, something), and volià, the error I had gotten (even with this commit) disappeared.

So in an effort to be useful, I tried to compile [i]upwards[/i] this time, since clearly svn update wasn't good at rewinding. I got the error mentioned above, and at that point bash'd my way through compiling the other revisions and recording the errors. Right before I uploaded here I realized that the most recent revision had no errors. To be sure, I deleted all the code again and ran `svn up -r 336`, and suddenly it compiles!! So my old dev dir apparently was too complex for svn update to handle. Piece of crap.

So yeah, my original post is worthless. :davieddy:

bsquared 2014-09-19 20:25

[QUOTE=Dubslow;383455]

So yeah, my original post is worthless. :davieddy:[/QUOTE]

Haha! Well, not completely worthless because things like this tend to motivate me to make time to do stuff with yafu again. Also, thank you for posting this update before I spent a bunch of time debugging :smile:.

Dubslow 2014-09-19 20:51

[QUOTE=bsquared;383460]Haha! Well, not completely worthless because things like this tend to motivate me to make time to do stuff with yafu again. Also, thank you for posting this update before I spent a bunch of time debugging :smile:.[/QUOTE]

If you still feel like it... using internal ECM still fails for me, and I've never figured out why.

[code]pm1: starting B1 = 150K, B2 = gmp-ecm default on C90
PE:=;0/30 curves on C90, B1=2K, B2=gmp-ecm default
# stage2_CM not ready for disc=112
*** Error in `/home/bill/yafu/./yafu': double free or corruption (out): 0x00007fffffffcf60 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7aa16)[0x7ffff70fda16]
/lib/x86_64-linux-gnu/libc.so.6(+0x7b793)[0x7ffff70fe793]
/home/bill/yafu/./yafu[0x46af19]
/home/bill/yafu/./yafu[0x48e94c]
/home/bill/yafu/./yafu[0x45fd92]
/home/bill/yafu/./yafu[0x45b194]
/home/bill/yafu/./yafu[0x43e08f]
/home/bill/yafu/./yafu[0x43e9b8]
/home/bill/yafu/./yafu[0x41f515]
/home/bill/yafu/./yafu[0x421e31]
/home/bill/yafu/./yafu[0x41574c]
/home/bill/yafu/./yafu[0x416586]
/home/bill/yafu/./yafu[0x41685b]
/home/bill/yafu/./yafu[0x404a05]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7ffff70a4995]
/home/bill/yafu/./yafu[0x405be1]
======= Memory map: ========
00400000-004e8000 r-xp 00000000 08:04 18355486 /home/bill/yafu/yafu
006e7000-006f0000 rwxp 000e7000 08:04 18355486 /home/bill/yafu/yafu
006f0000-00729000 rwxp 00000000 00:00 0 [heap]
7ffff6e6d000-7ffff6e82000 r-xp 00000000 08:04 12452207 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6e82000-7ffff7082000 ---p 00015000 08:04 12452207 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7082000-7ffff7083000 rwxp 00015000 08:04 12452207 /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff7083000-7ffff7226000 r-xp 00000000 08:04 12455235 /lib/x86_64-linux-gnu/libc-2.17.so
7ffff7226000-7ffff7425000 ---p 001a3000 08:04 12455235 /lib/x86_64-linux-gnu/libc-2.17.so
7ffff7425000-7ffff7429000 r-xp 001a2000 08:04 12455235 /lib/x86_64-linux-gnu/libc-2.17.so
7ffff7429000-7ffff742b000 rwxp 001a6000 08:04 12455235 /lib/x86_64-linux-gnu/libc-2.17.so
7ffff742b000-7ffff742f000 rwxp 00000000 00:00 0
7ffff742f000-7ffff7432000 r-xp 00000000 08:04 12455232 /lib/x86_64-linux-gnu/libdl-2.17.so
7ffff7432000-7ffff7631000 ---p 00003000 08:04 12455232 /lib/x86_64-linux-gnu/libdl-2.17.so
7ffff7631000-7ffff7632000 r-xp 00002000 08:04 12455232 /lib/x86_64-linux-gnu/libdl-2.17.so
7ffff7632000-7ffff7633000 rwxp 00003000 08:04 12455232 /lib/x86_64-linux-gnu/libdl-2.17.so
7ffff7633000-7ffff772f000 r-xp 00000000 08:04 12455352 /lib/x86_64-linux-gnu/libm-2.17.so
7ffff772f000-7ffff792f000 ---p 000fc000 08:04 12455352 /lib/x86_64-linux-gnu/libm-2.17.so
7ffff792f000-7ffff7930000 r-xp 000fc000 08:04 12455352 /lib/x86_64-linux-gnu/libm-2.17.so
7ffff7930000-7ffff7931000 rwxp 000fd000 08:04 12455352 /lib/x86_64-linux-gnu/libm-2.17.so
7ffff7931000-7ffff7948000 r-xp 00000000 08:04 12455161 /lib/x86_64-linux-gnu/libpthread-2.17.so
7ffff7948000-7ffff7b47000 ---p 00017000 08:04 12455161 /lib/x86_64-linux-gnu/libpthread-2.17.so
7ffff7b47000-7ffff7b48000 r-xp 00016000 08:04 12455161 /lib/x86_64-linux-gnu/libpthread-2.17.so
7ffff7b48000-7ffff7b49000 rwxp 00017000 08:04 12455161 /lib/x86_64-linux-gnu/libpthread-2.17.so
7ffff7b49000-7ffff7b4d000 rwxp 00000000 00:00 0
7ffff7b4d000-7ffff7bd9000 r-xp 00000000 08:04 1180492 /usr/local/lib/libgmp.so.10.2.0
7ffff7bd9000-7ffff7dd9000 ---p 0008c000 08:04 1180492 /usr/local/lib/libgmp.so.10.2.0
7ffff7dd9000-7ffff7ddb000 rwxp 0008c000 08:04 1180492 /usr/local/lib/libgmp.so.10.2.0
7ffff7ddb000-7ffff7dfc000 r-xp 00000000 08:04 12455147 /lib/x86_64-linux-gnu/ld-2.17.so
7ffff7ec4000-7ffff7fc6000 rwxp 00000000 00:00 0
7ffff7ff5000-7ffff7ffa000 rwxp 00000000 00:00 0
7ffff7ffa000-7ffff7ffc000 r-xp 00000000 00:00 0 [vdso]
7ffff7ffc000-7ffff7ffd000 r-xp 00021000 08:04 12455147 /lib/x86_64-linux-gnu/ld-2.17.so
7ffff7ffd000-7ffff7fff000 rwxp 00022000 08:04 12455147 /lib/x86_64-linux-gnu/ld-2.17.so
7ffffffde000-7ffffffff000 rwxp 00000000 00:00 0 [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

Program received signal SIGABRT, Aborted.
0x00007ffff70b81d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff70b81d5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff70bb388 in __GI_abort () at abort.c:90
#2 0x00007ffff70f37bb in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ffff71f0368 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:199
#3 0x00007ffff70fda16 in malloc_printerr (action=3, str=0x7ffff71f04b8 "double free or corruption (out)", ptr=<optimized out>) at malloc.c:4923
#4 0x00007ffff70fe793 in _int_free (av=<optimized out>, p=0x7fffffffcf50, have_lock=0) at malloc.c:3779
#5 0x000000000046af19 in __ecm_mpres_clear ()
#6 0x000000000048e94c in ec_point_clear ()
#7 0x000000000045fd92 in ecm ()
#8 0x000000000045b194 in ecm_factor ()
#9 0x000000000043e08f in ecm_do_one_curve (ptr=ptr@entry=0x708270) at factor/gmp-ecm/ecm.c:625
#10 0x000000000043e9b8 in ecm_loop (fobj=fobj@entry=0x6fa450) at factor/gmp-ecm/ecm.c:129
#11 0x000000000041f515 in do_work (method=method@entry=state_ecm_15digit, fwork=fwork@entry=0x7fffffffdca0, b=b@entry=0x7fffffffdc30, fobj=fobj@entry=0x6fa450) at factor/factor_common.c:1001
#12 0x0000000000421e31 in factor (fobj=fobj@entry=0x6fa450) at factor/factor_common.c:2269
#13 0x000000000041574c in feval (func=<optimized out>, nargs=1, fobj=fobj@entry=0x6fa450) at top/calc.c:1325
#14 0x0000000000416586 in calc (in=in@entry=0x7fffffffe4b0, fobj=fobj@entry=0x6fa450) at top/calc.c:1076
#15 0x000000000041685b in process_expression (input_exp=input_exp@entry=0x6f8010 "ans", fobj=fobj@entry=0x6fa450) at top/calc.c:659
#16 0x0000000000404a05 in main (argc=<optimized out>, argv=<optimized out>) at top/driver.c:286[/code]
(I have written ext_ecm=10 to yafu.ini, so it's not any sort of urgent.)

Edit:
[code]using 1 random witnesses for Rabin-Miller PRP checks[/code] :huh:

Dubslow 2014-09-19 22:03

Also
[code]fac: factoring 226689758635284240031399566323277067595029029774936106540183307543782723689956275361391841279
fac: using pretesting plan: normal
fac: using tune info for qs/gnfs crossover
div: primes less than 10000
rho: x^2 + 3, starting 1000 iterations on C93
rho: x^2 + 2, starting 1000 iterations on C93
rho: x^2 + 1, starting 1000 iterations on C93
pm1: starting B1 = 150K, B2 = gmp-ecm default on C93
ecm: 32/32 curves on C93, B1=2K, B2=gmp-ecm default
ecm: 80/80 curves on C93, B1=11K, B2=gmp-ecm default
ecm: 88/88 curves on C93, B1=50K, B2=gmp-ecm default, ETA: 0 sec

starting SIQS on c93: 226689758635284240031399566323277067595029029774936106540183307543782723689956275361391841279
using sse2 with med_sieve
using sse2 with tdiv_medprimes

==== sieving in progress ( 8 threads): 82576 relations needed ====
==== Press ctrl-c to abort and save state ====
84333 rels found: 22223 full + 62110 from 1067592 partial, (1446.52 rels/sec)

failure to equate relation
Q = 950427493112945742115787117226260552896921855321562467831556286127779898481167514210729044032, RHS = 33558080211429295285379201052923376271308994242405480027732213924491392601501871969511488
failure to equate relation
Q = 81784555926951402260026657588322779310363333617532541673838278167392440222835473189713190416, RHS = 73503861187891982333949829951464231966165882362008609361933664265567205070369920587374096
SIQS elapsed time = 772.5983 seconds.
Total factoring time = 777.0427 seconds


***factors found***

P35 = 16956731259073122994054792066768843
P59 = 13368718013620002217171981146915145127058002848678126068253[/code]

wombatman 2014-09-19 23:08

I figured I would try and narrow down where the error I'm getting occurs. It happens after the SIQS process finishes collecting relations and tries to process them.

The error occurs after: [CODE]lanczos halted after 1220 iterations (dim = 77039)
recovered 16 nontrivial dependencies
Lanczos elapsed time = 20.3170 seconds.
Sqrt elapsed time = 0.2000 seconds.
SIQS elapsed time = 21.4962 seconds.[/CODE]

The actual error is:
[CODE]Fault Module Name: StackHash_f6e3
Fault Module Version: 6.1.7601.18247
Fault Module Timestamp: 521eaf24
Exception Code: c0000374
Exception Offset: 00000000000c4102
[/CODE]

bsquared 2014-09-20 00:02

[QUOTE=Dubslow;383468]Also
[code]fac: factoring 226689758635284240031399566323277067595029029774936106540183307543782723689956275361391841279
fac: using pretesting plan: normal
fac: using tune info for qs/gnfs crossover
div: primes less than 10000
rho: x^2 + 3, starting 1000 iterations on C93
rho: x^2 + 2, starting 1000 iterations on C93
rho: x^2 + 1, starting 1000 iterations on C93
pm1: starting B1 = 150K, B2 = gmp-ecm default on C93
ecm: 32/32 curves on C93, B1=2K, B2=gmp-ecm default
ecm: 80/80 curves on C93, B1=11K, B2=gmp-ecm default
ecm: 88/88 curves on C93, B1=50K, B2=gmp-ecm default, ETA: 0 sec

starting SIQS on c93: 226689758635284240031399566323277067595029029774936106540183307543782723689956275361391841279
using sse2 with med_sieve
using sse2 with tdiv_medprimes

==== sieving in progress ( 8 threads): 82576 relations needed ====
==== Press ctrl-c to abort and save state ====
84333 rels found: 22223 full + 62110 from 1067592 partial, (1446.52 rels/sec)

failure to equate relation
Q = 950427493112945742115787117226260552896921855321562467831556286127779898481167514210729044032, RHS = 33558080211429295285379201052923376271308994242405480027732213924491392601501871969511488
failure to equate relation
Q = 81784555926951402260026657588322779310363333617532541673838278167392440222835473189713190416, RHS = 73503861187891982333949829951464231966165882362008609361933664265567205070369920587374096
SIQS elapsed time = 772.5983 seconds.
Total factoring time = 777.0427 seconds


***factors found***

P35 = 16956731259073122994054792066768843
P59 = 13368718013620002217171981146915145127058002848678126068253[/code][/QUOTE]

I assume you're referring to the "does not equate" bit? That seems to happen from time to time with the double large prime variation. The routine throws away relations that fail in this way so it shouldn't matter in the end. I should probably just disable that printf.

Dubslow 2014-09-20 01:56

Awww crud -- don't kill me, but it turns out those errors were legitimate.


When I wiped the code and installed fresh from svn, it also apparently wiped out my modification to the makefile where I had NFS=1 by default, so that the compile that I reported as successful didn't have NFS enabled. When I just tried to recompile it thusly, the asm errors came back.

[code]gcc -march=native -mtune=native -O3 -fomit-frame-pointer -Wall -I. -Iinclude -I../gmp/include -I../gmp-ecm/include/linux -c -o factor/qs/med_sieve_32k.o factor/qs/med_sieve_32k.c
In file included from factor/qs/med_sieve_32k.c:23:0:
factor/qs/med_sieve_32k.c: In function ‘med_sieveblock_32k’:
factor/qs/sieve_macros_32k.h:68:2: error: ‘asm’ operand has impossible constraints
__asm__ ( \
^
factor/qs/med_sieve_32k.c:70:2: note: in expansion of macro ‘SIEVE_13b_ASM’
SIEVE_13b_ASM;
^
factor/qs/sieve_macros_32k.h:8:2: error: ‘asm’ operand has impossible constraints
__asm__ ( \
^
factor/qs/med_sieve_32k.c:189:2: note: in expansion of macro ‘SIEVE_GT_BLOCKSIZE_ASM’
SIEVE_GT_BLOCKSIZE_ASM;
^
make: *** [factor/qs/med_sieve_32k.o] Error 1[/code]

Wait no, it's when I add the -march=native compiler flag. -mtune=native compiles fine though. That's strange regardless, since -march=native used to work...
Edit: And that's probably because I'm still using the same old Sandy Bridge, so no AVX2 support. I guess you just need some [strike]macros[/strike]defines.

Dubslow 2014-09-20 03:01

Okay, another problem. I just ran tune(), got a crossover of 97 digits, but when I run yafu from ~/aliqueit, it insists on SIQSing a C119. I copied yafu.ini to the same dir, it's identical to the .ini in the yafu dir (where yafu chooses NFS just fine), but it's still SIQSing. I'm hoping it's a simple PEBKAC, but... what gives?


All times are UTC. The time now is 22:03.

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