mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   YAFU (https://www.mersenneforum.org/forumdisplay.php?f=96)
-   -   Yafu segmentation fault (https://www.mersenneforum.org/showthread.php?t=26401)

2147483647 2021-01-14 18:28

Yafu segmentation fault
 
I upgraded to Linux Mint 20.1 yesterday and I just tried to rebuild yafu and I'm getting a segmentation fault (in fact, the old binary that worked on mint 19.1 also segfaults now). I'm using the latest snapshot on sourceforge (r395) and the old binary was r378. To build, I mostly followed the instructions [URL="https://starreloaders.com/edhall/AliWin/AliqueitLinstall.html"]here[/URL]. I'm using gmp 6.2.1, gmp-ecm 7.0.4, and msieve r1036.

Stack trace from gdb after running factor(10^100+1):

[CODE]#0 0x00005555555b78cd in mpz_set_64 (dest=0x7fffffffd370, src=73)
at arith/arith0.c:81
#1 0x0000555555588b6b in zTrial (fobj=0x555555766bd0) at factor/trialdiv.c:66
#2 0x000055555557ec84 in do_work (method=state_trialdiv,
fwork=0x7fffffffd4b0, b=0x7fffffffd640, fobj=0x555555766bd0)
at factor/factor_common.c:949
#3 0x00005555555823f8 in factor (fobj=0x555555766bd0)
at factor/factor_common.c:2408
#4 0x0000555555570ddf in feval (func=7, nargs=1, fobj=0x555555766bd0)
at top/calc.c:1326
#5 0x0000555555570616 in calc (in=0x7fffffffdda0, fobj=0x555555766bd0)
at top/calc.c:1077
#6 0x000055555556fab9 in process_expression (input_exp=0x5555557642a0 "ans",
fobj=0x555555766bd0) at top/calc.c:660
#7 0x0000555555565608 in main (argc=1, argv=0x7fffffffdfa8)
at top/driver.c:301[/CODE]

Does anyone know how to fix this?

Edit: It seems like a bug with a successful trial division. When I try to a factor a number with no small prime factors, it works fine.

Edit 2: siqs(95442572017298574098337713301010381254972520112407276434678638815347074607638583667) also crashes in the same place:

[CODE]#0 0x00005555555b78cd in mpz_set_64 (dest=0x7ffff58e25d0, src=250663328318941)
at arith/arith0.c:81
#1 0x000055555558402b in sp_shanks_loop (N=0x7ffff7933088,
fobj=0x555555766bd0) at factor/squfof.c:145
#2 0x000055555559157b in trial_divide_Q_siqs (report_num=2, parity=1 '\001',
poly_id=0, bnum=8, sconf=0x5555557792d0, dconf=0x7ffff7933010)
at factor/qs/tdiv.c:218
#3 0x00005555555942a1 in check_relations_siqs_16 (blocknum=8,
parity=1 '\001', sconf=0x5555557792d0, dconf=0x7ffff7933010)
at factor/qs/tdiv_scan.c:967
#4 0x00005555555a1f8f in process_poly (ptr=0x555555779d88)
at factor/qs/SIQS.c:954
#5 0x00005555555a1b79 in worker_thread_main (thread_data=0x555555779d88)
at factor/qs/SIQS.c:813
#6 0x00007ffff7f15609 in start_thread (arg=<optimised out>)
at pthread_create.c:477
#7 0x00007ffff7ce7293 in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95[/CODE]

EdH 2021-01-14 20:05

You probably need to update Msieve, especially if your GMP is now 6.2.0. A better (more up to date) source for instructions is now:

[URL="https://www.mersenneforum.org/showthread.php?t=23087"]How I install YAFU . . .[/URL]

found here on the forum. You can find some references to the segmentation fault issue further in the thread. It's quite possible this is the one you're experiencing.

Please, keep us informed as to your progress.

2147483647 2021-01-14 22:52

I just tried downgrading back to GMP 6.1.2 and rebuilding everything, and I still get the same segfaults.

Edit: I fixed it. Apparently I already GMP 6.2.0 installed system-wide from apt, and yafu was using those libraries instead of the ones it was built with. If I set LD_LIBRARY_PATH to the path of the GMP 6.1.2 libraries, it works.

EdH 2021-01-14 23:21

[QUOTE=2147483647;569307]I just tried downgrading back to GMP 6.1.2 and rebuilding everything, and I still get the same segfaults.

Edit: I fixed it. Apparently I already GMP 6.2.0 installed system-wide from apt, and yafu was using those libraries instead of the ones it was built with. If I set LD_LIBRARY_PATH to the path of the GMP 6.1.2 libraries, it works.[/QUOTE]
Thanks for keeping us updated on your progress. I suppose at some point you may wish to upgrade Msieve and YAFU to work with GMP-6.2.0, but if you're happy with it currently, I guess there's no hurry. You can actually make alternate directories of Msieve and YAFU and build them against the newer GMP. I sometimes have several YAFU folders on a mcahine when trying different builds (e.g. YAFU-old, YAFUwin, YAFUtrunk, YAFUnew, etc.).

Happy5214 2021-01-15 02:10

[QUOTE=EdH;569309]Thanks for keeping us updated on your progress. I suppose at some point you may wish to upgrade Msieve and YAFU to work with GMP-6.2.0, but if you're happy with it currently, I guess there's no hurry. You can actually make alternate directories of Msieve and YAFU and build them against the newer GMP. I sometimes have several YAFU folders on a mcahine when trying different builds (e.g. YAFU-old, YAFUwin, YAFUtrunk, YAFUnew, etc.).[/QUOTE]

The worst part: they broke binary compatibility in a supposedly "minor" release. Get your versioning together, GMP!

/rant

2147483647 2021-01-15 02:18

[QUOTE=EdH;569309]Thanks for keeping us updated on your progress. I suppose at some point you may wish to upgrade Msieve and YAFU to work with GMP-6.2.0, but if you're happy with it currently, I guess there's no hurry. You can actually make alternate directories of Msieve and YAFU and build them against the newer GMP. I sometimes have several YAFU folders on a mcahine when trying different builds (e.g. YAFU-old, YAFUwin, YAFUtrunk, YAFUnew, etc.).[/QUOTE]

I did use the latest versions of everything (at least, they were the latest versions I could find) when I built with GMP 6.2.1 and got segfaults. Oh, maybe I didn't actually need to downgrade to GMP 6.1.2, and I just needed to set LD_LIBRARY_PATH to the location of GMP 6.2.1? Let's see...

Edit: Nope, still crashes.

jasonp 2021-01-15 14:28

[QUOTE=Happy5214;569318]The worst part: they broke binary compatibility in a supposedly "minor" release. Get your versioning together, GMP!

/rant[/QUOTE]
To be fair, it's not their fault when users muck about with undocumented internals to their structures, which I did (in this one place only, hopefully).


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

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