Ján Jančár on Wed, 11 Jul 2018 16:48:32 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: SIGSEGV on isprime


On 11/07/18 16:32, Ján Jančár wrote:
> On 11/07/18 16:03, Ján Jančár wrote:
>> On 10/07/18 23:59, Bill Allombert wrote:
>>> On Tue, Jul 10, 2018 at 06:35:40PM +0200, Ján Jančár wrote:
>>>> ...
>>>> 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.
>>>
>>> Why are you using --enable-tls ? Does it makes a difference ?
>>> Are you using the same compiler ? The same processor ?
>>> This code has not changed between 2.9.5 and 2.10.1, however it is rather
>>> messy, so maybe it is not compiled correctly.
>>> You can also try
>>> ./Configure --kernel=none 
>>>
>>
>> The application I am compiling requires tls, I will test it with the
>> reproducer without tls but even if it works, it will be unusable for me.
>> I am indeed using the same compiler, the only obvious difference I can
>> think of is the processor.
>>
>> I have now tested:
>>
>> --enable-tls --kernel=none      --> works
>> --enable-tls --kernel=none-gmp  --> SEGVs!
>> --enalbe-tls --kernel=auto-none --> works
>>
>> Not sure what to make of this, I will try with a newer version of GMP,
>> 6.0.0 is currently installed(on both machines, where it works and
>> doesn't) but 6.1.2 is available, so I will see if that fixes it.
>>
> 
> 
> I have just tested with GMP 6.1.2 and the same SIGSEGV appears.
> Interestingly enough, when doing
> isprime(0x8d4731c77d346297e54306afea3730a1) in gp(statically or
> dynamically linked) the computation is just fine, no SEGV.
> 

Hmm, doing:

> #include <pari/pari.h>
> #include <stdio.h>
> 
> int main(void) {
>         pari_init(1000000000, 1000000);
>         isprime(stoi(1));
>         GEN order = strtoi("0x8d4731c77d346297e54306afea3730a1");
>         long i = isprime(order);
>         printf("%li\n", i);
>         pari_close();
>         return 0;
> }
> 

Actually fixes the problem, still not sure how.

Cheers,
-- 
Jan
______________________________________________________
   /\  # PGP: 362056ADA8F2F4E421565EF87F4A448FE68F329D
  /__\  # https://neuromancer.sk
 /\  /\  # Eastern Seaboard Phishing Authority
/__\/__\  #

Attachment: signature.asc
Description: OpenPGP digital signature