Ján Jančár on Tue, 10 Jul 2018 18:35:43 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: SIGSEGV on isprime
- From: Ján Jančár <johny@neuromancer.sk>
- Date: Tue, 10 Jul 2018 18:35:40 +0200
- Autocrypt: addr=johny@neuromancer.sk; prefer-encrypt=mutual; keydata= xsFNBFcX5G8BEADL/1dQwl6DhgvrknSrVJ6+RZWvhucFVpyKGpvOt8eqFS0mzrxdf9rgf0zg awCktOjbbCrMi9LchiV5OaLu+5+QvxwXjYX5l+7ArrdbmeLj8Db34Gnib2EsQr3QKj5seAkt HO2Qw9UBeIHug6Hgi0rEilqwTo6meptLzTbr1RRabX+94fMGWV+N4BTuzC2ZgHTO8cP5a+ME gK+lGbXllYng9OO4NiwPmS7s+NMQQr+Q6SA8exicTE9nzqWabAuMsW/M0x8niSyeMYbVBKcA WcA0ANiy5HMEmz1Gnlmt8Ww+F46sWmkEjEuMf21ScX6P6/ES+nBN3mynKU+maPN3+WwkKG4D BEqZZJ1KkOn6JSYVdfi4PokXz+4AYZAUgfCRCbYzPv/QUn8ax2o/N2KLNJ/CIUZcRe9J+LQm G+n3BFdeh+M6gq1/grNrCJBGW+gl9TECzB4fS5fHPE0bgX/TT6q16J6lTU3WEzbwaki3j88n T131hWwiAzAORYG0AnV78Bx/sLIMMXP0meng6Alo7hNXIHPw70AqWq3grpFnyLMe0MekYDev PKxoRbTOOoO+DKNZ4JsakfBPjaL1j3w17Uy4WhRzWV7ZVbCXMyZPFNoSvCE7IjFPJMc6dM1i nOWl54Pn8JAy/YIi59ZdVc1uH3svLv62QYG51jqKi48JnIuPQwARAQABzSFKYW4gSmFuY2Fy IDxqb2hueUBuZXVyb21hbmNlci5zaz7CwY4EEwEKADgWIQQ2IFatqPL05CFWXvh/SkSP5o8y nQUCWoCTdwIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRB/SkSP5o8ynT1/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tue, 10 Jul 2018 18:35:43 +0200
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=neuromancer.sk; s=20173101; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AJvZFHkqL97XTlIF3Qf+s+6TVoTQ6rdPG10IVK2Gya8=; b=e29Q1JF0H7Y+MiLWKWB3YZDk7g KFr/eIXCi6r5I7HvyunyeyTLYYo5U7slkvywVcbCUh/fxRSTCMmHOaLVOzkjYqFx1kGbM/9C0l/NQ aY7ibazhgxPpFQ8SwMuL7+FWufctTXa4L34nAQuUOGFr9FE7ca/n5dmXroWkKXA3hAu9y3j2MZq+f A+Z39B6OBXJ1UJ5pv1wlmhPJ+DsRe2YLGXseP7nkH4IQwlLuhRbZZTAE8DLFF7WChcQFNz+RE+iRN kGuzES2kDOtJhw3Y8padvPRuSwZg/dzOQhLFxQSjswuDUjqD6YlX+Cpghy1m+MTP+hjAkwgxUlVM7 8qPdMgWA==;
- Openpgp: preference=signencrypt
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
Hi all,
While running pari on some grid computing machines I keep encountering
this mysterious error, which only happens when working on certain
machines and not on others.
To reproduce, I compiled the following:
> #include <pari/pari.h>
> #include <stdio.h>
>
> int main(void) {
> pari_init(1000000000, 1000000);
> GEN order = strtoi("0x8d4731c77d346297e54306afea3730a1");
> long i = isprime(order);
> printf("%li\n", i);
> pari_close();
> return 0;
> }
with:
gcc -o t test.c -lrt -lpari
on:
Linux 3.16.0-5-amd64 #1 SMP Debian
3.16.51-3+deb8u1+zs2 (2018-01-12) x86_64 GNU/Linux
where it run just fine.
However when run(and compiled) on:
Linux 4.9.0-6-amd64 #1 SMP Debian
4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux
It SIGSEGVs in isprime():
> Program received signal SIGSEGV, Segmentation fault.
> 0x00002aaaab1f771c in red_montgomery (T=0x2aaae879e6a0, N=0x2aaae879efe0, inv=2796584439883844767) at ../src/kernel/gmp/mp.c:1013
> 1013 while (Td < (GEN)av) { t = subllx(*++Td, *++Nd); *Td = t; }
> (gdb) bt
> #0 0x00002aaaab1f771c in red_montgomery (T=0x2aaae879e6a0, N=0x2aaae879efe0, inv=2796584439883844767) at ../src/kernel/gmp/mp.c:1013
> #1 0x00002aaaab33a0ac in _sqr_montred (E=0x2aaae879ef38, x=0x2aaae879e6d0) at ../src/basemath/arith1.c:3311
> #2 0x00002aaaab33a138 in _mul2_montred (E=0x2aaae879ef38, x=0x2aaae879e6d0) at ../src/basemath/arith1.c:3326
> #3 0x00002aaaab39d641 in gen_pow_fold_i (x=0x2aaae879eef0, N=0x2aaae879efa0, E=0x2aaae879ef38, sqr=0x2aaaab33a068 <_sqr_montred>, msqr=0x2aaaab33a10d <_mul2_montred>)
> at ../src/basemath/bb_group.c:254
> #4 0x00002aaaab33abf3 in Fp_pow (A=0x2aaaabaa3998 <readonly_constants+56>, K=0x2aaae879efa0, N=0x2aaae879efe0) at ../src/basemath/arith1.c:3508
> #5 0x00002aaaab5ca498 in bad_for_base (S=0x7fffffffe210, a=0x2aaaabaa3998 <readonly_constants+56>) at ../src/basemath/prime.c:95
> #6 0x00002aaaab5cbaf2 in BPSW_psp (N=0x2aaae879efe0) at ../src/basemath/prime.c:570
> #7 0x00002aaaab5cca58 in isprime (x=0x2aaae879efe0) at ../src/basemath/prime.c:846
> #8 0x0000000000400788 in main ()
> (gdb) info locals
> __value = 8722076062158158581
> __arg1 = 144115188075855878
> __arg2 = 10180160215563133591
> __temp = 18446744073709551615
> av = 46913531930272
> Te = 0x2aaae867e688
> Td = 0x2aaae867e6a0
> Ne = 0x2aaae867efe8
> Nd = 0x2aaae867f000
> scratch = 0x2aaae867e680
> i = 2
> j = 2
> m = 9020403664262637533
> t = 8722076062158158581
> d = 4
> k = 2
> carry = 1
> hiremainder = 4978068440930021014
> overflow = 1
> (gdb) info args
> T = 0x2aaae867e6a0
> N = 0x2aaae867efe0
> inv = 2796584439883844767
> (gdb) quit
I compiled pari 2.9.5 / 2.10.1 / current git master, with
./Configure --enable-tls -g
and the error happens in all of the versions.
Any ideas on what might be causing this? ldd of the binary on both
machines shows the same libraries are used, so it is very mysterious to
me that it works on one and not on the other.
Cheers,
--
Jan
______________________________________________________
/\ # PGP: 362056ADA8F2F4E421565EF87F4A448FE68F329D
/__\ # https://neuromancer.sk
/\ /\ # Eastern Seaboard Phishing Authority
/__\/__\ #