fedora packages are built with some flags and I experience runtime crashes. A typical example is:
Code : Tout sélectionner
ifactor(10**40+68)
it gives
Code : Tout sélectionner
58283 icas_eval ifactor(10^40+68)
[New Thread 0x7fffe58b2700 (LWP 1813)]
66791 Pollard-rho failure, ntries 15001
86851 sieve on 42975263438364877176697093153181029
Number of primes 333.039
88639 sieve basis OK, size 334 largest prime in basis 5003 large prime 130078 Mtarget 55000
Using 3 square factors per a coefficient in polynomials
1 fixed begin at 113 and 2 variables at 239
First M 6920.5
/usr/include/c++/8/bits/stl_vector.h:932: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = giac::basis_t; _Alloc = std::allocator<giac::basis_t>; std::vector<_Tp, _Alloc>::reference = giac::basis_t&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
While a classic ./configure and make, it gives a good binary, but if I do:
Code : Tout sélectionner
env CXXFLAGS='-g -Wp,-D_GLIBCXX_ASSERTIONS' ./configure
Code : Tout sélectionner
(gdb) bt
#0 0x00007ffff42a853f in raise () from /lib64/libc.so.6
#1 0x00007ffff4292895 in abort () from /lib64/libc.so.6
#2 0x000000000043caa5 in std::__replacement_assert (
__file=0x7ffff7903810 "/usr/include/c++/8/bits/stl_vector.h", __line=932,
__function=0x7ffff7903f40 <std::vector<giac::basis_t, std::allocator<giac::basis_t> >::operator[](unsigned long)::__PRETTY_FUNCTION__> "std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = giac::basis_t; _Alloc = std::allocator<giac::basis_t>; std::vector<_Tp, _Alloc"..., __condition=0x7ffff79037e0 "__builtin_expect(__n < this->size(), true)")
at /usr/include/c++/8/x86_64-redhat-linux/bits/c++config.h:2391
#3 0x00007ffff72df83b in std::vector<giac::basis_t, std::allocator<giac::basis_t> >::operator[] (
this=0x7fffe58af3c0, __n=334) at /usr/include/c++/8/bits/stl_vector.h:932
#4 0x00007ffff72cc8ea in giac::msieve (n_orig=..., pn=..., contextptr=0x7fffffffc710) at ifactor.cc:2520
#5 0x00007ffff72d41cf in giac::pollardsieve (a=..., k=..., do_pollard=@0x7fffe58afc6f: false,
contextptr=0x7fffffffc710) at ifactor.cc:3797
#6 0x00007ffff72d4782 in giac::ifactor2 (n=..., v=..., do_pollard=@0x7fffe58afc6f: false,
contextptr=0x7fffffffc710) at ifactor.cc:3835
Best
Frederic