Crash with polynomial over "Givaro" finite field
I would like to solve a system of equations in a finite field of prime order p (illustrated below with p=229).
The system consists in four equations and has four unknowns a0, a1, a2, a3.
It depends on parameters αi, bi, all in F(p), for i=1,2,3,4.
The four equations are
a0+a1α1+a2α21+a3α31=b1 a0+a1α2+a2α22+a3α32=b2 a0+a1α3+a2α23+a3α33=b3 a0+a1α4+a2α24+a3α34=b4
To do this I have tried with the following examples:
pm = 229
bp = 229
F.<x> = GF(pm, impl='givaro')
R.<a0, a1, a2, a3> = PolynomialRing(F)
def NP(a):
return F(ZZ(a).digits(bp)) # integer to polynomial
eqns = [a0 + a1*NP(2) + a2*NP(2)^2 + a3*NP(2)^3 - NP(78),
a0 + a1*NP(3) + a2*NP(3)^2 + a3*NP(3)^3 - NP(136),
a0 + a1*NP(4) + a2*NP(4)^2 + a3*NP(4)^3 - NP(179),
a0 + a1*NP(5) + a2*NP(5)^2 + a3*NP(5)^3 - NP(166)]
A = matrix(F, [[eqn.coefficient(b) for b in R.gens()] for eqn in eqns])
b = vector(F, [-eqn.constant_coefficient() for eqn in eqns])
X = A.solve_right(b)
print(X)
But it shows erros:
Unhandled SIGSEGV: A segmentation fault occurred.
This probably occurred because a *compiled* module has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Python will now terminate.
------------------------------------------------------------------------
/usr/share/sagemath/bin/sage-python: line 2: 7655 Segmentation fault (core dumped) sage -python "$@"
How can I fix this?
This looks indeed like a bug, could you please try to isolate the problem and provide a minimal example ?
Minimal example posted as an answer.
I get the crash with Sage 8.2, Sage 9.1, Sage 9.2.beta13.