mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2021-01-14, 18:28   #1
2147483647
 
Dec 2016

100102 Posts
Default 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 here. 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
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

Last fiddled with by 2147483647 on 2021-01-14 at 19:01 Reason: siqs crash
2147483647 is offline   Reply With Quote
Old 2021-01-14, 20:05   #2
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

4,001 Posts
Default

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:

How I install YAFU . . .

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.
EdH is offline   Reply With Quote
Old 2021-01-14, 22:52   #3
2147483647
 
Dec 2016

2·32 Posts
Default

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.

Last fiddled with by 2147483647 on 2021-01-14 at 23:02
2147483647 is offline   Reply With Quote
Old 2021-01-14, 23:21   #4
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

4,001 Posts
Default

Quote:
Originally Posted by 2147483647 View Post
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.
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.).
EdH is offline   Reply With Quote
Old 2021-01-15, 02:10   #5
Happy5214
 
Happy5214's Avatar
 
"Alexander"
Nov 2008
The Alamo City

2·379 Posts
Default

Quote:
Originally Posted by EdH View Post
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.).
The worst part: they broke binary compatibility in a supposedly "minor" release. Get your versioning together, GMP!

/rant
Happy5214 is offline   Reply With Quote
Old 2021-01-15, 02:18   #6
2147483647
 
Dec 2016

1216 Posts
Default

Quote:
Originally Posted by EdH View Post
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.).
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.

Last fiddled with by 2147483647 on 2021-01-15 at 02:33
2147483647 is offline   Reply With Quote
Old 2021-01-15, 14:28   #7
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3×1,181 Posts
Default

Quote:
Originally Posted by Happy5214 View Post
The worst part: they broke binary compatibility in a supposedly "minor" release. Get your versioning together, GMP!

/rant
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).
jasonp is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
odd segmentation fault ChristianB YAFU 4 2015-09-09 19:38
Segmentation fault in msieve. include Msieve 4 2012-11-14 00:59
Segmentation fault PhilF Linux 5 2006-01-07 17:12
Segmentation Fault on kernel 2.6.8-1.521 Prime Monster Software 9 2004-10-11 22:19
Segmentation Fault sirius56 Software 2 2004-10-02 21:43

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


Tue Oct 19 02:43:11 UTC 2021 up 87 days, 21:12, 0 users, load averages: 1.31, 1.55, 1.73

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.