Using version 9.1 of sage, the function _ntl_rep_abs(), implemented in: /sage/src/sage/rings/padics/padic_ZZ_pX_CR_element.pyx,
crashes for some padic eisenstein-extension elements with high valuation.
This also causes sage to crash upon trying to coerce those elements into the appropriate integer-ring.
examples for elements on which _ntl_rep_abs() crashes:
sage: T.<a> = Qp(5).extension(x^2-5)
sage: Z = T.integer_ring()
sage: d = T(a^107 + O(a^200))
sage: d = T(a^107 + O(a^145))
sage: d = T(a^112 + O(a^200))
For each of the above elements, d._ntl_rep_abs() crashes, and therefore Z(d) (the coercion of d into the integer ring, which uses _ntl_rep_abs) also crashes.
Attached is a crash-log file for one of those cases.
On the contrary, the following are elements on which _ntl_rep_abs() and Z(d) do not crash:
sage: T.<a> = Qp(5).extension(x^2-5)
sage: Z = T.integer_ring()
sage: d = T(a + a^107 + O(a^200))
sage: d = T(a^107 + O(a^144))
sage: d = T(a^110 + O(a^200))
Looking into the code, it seems that the problematic line in _ntl_rep_abs is: "ans.x = dummy.unit".
It seems that dummy.unit is somehow violated when executing the line "dummy._internal_lshift(self.ordp)", which in turn provokes execution of: "ZZ_pX_MulMod_pre(self.unit, self.unit, tmpP, mod[0])". From this point onward, dummy.unit seems to be violated - calling: dummy.unit_part() crashes (as it contains a line which is similar to the problematic one).
Using version 9.1 of sage, the function _ntl_rep_abs(), implemented in: /sage/src/sage/rings/padics/padic_ZZ_pX_CR_element.pyx, crashes for some padic eisenstein-extension elements with high valuation.
This also causes sage to crash upon trying to coerce those elements into the appropriate integer-ring.
examples for elements on which _ntl_rep_abs() crashes:
For each of the above elements, d._ntl_rep_abs() crashes, and therefore Z(d) (the coercion of d into the integer ring, which uses _ntl_rep_abs) also crashes.
Attached is a crash-log file for one of those cases.
On the contrary, the following are elements on which _ntl_rep_abs() and Z(d) do not crash:
Looking into the code, it seems that the problematic line in _ntl_rep_abs is: "ans.x = dummy.unit". It seems that dummy.unit is somehow violated when executing the line "dummy._internal_lshift(self.ordp)", which in turn provokes execution of: "ZZ_pX_MulMod_pre(self.unit, self.unit, tmpP, mod[0])". From this point onward, dummy.unit seems to be violated - calling: dummy.unit_part() crashes (as it contains a line which is similar to the problematic one).
CC: @xcaruso
Component: padics
Keywords: NTL
Author: Noa Viner
Issue created by migration from https://trac.sagemath.org/ticket/29931