Karim BELABAS on Thu, 27 Mar 2003 19:46:18 +0100 (MET)

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

Re: argument checking for polhensellift

On Wed, 12 Feb 2003, Bill Allombert wrote:
> With both 2.1.4 and 2.2.5 and 8Mb of stack:
> ? polhensellift((x^4+x^2+3*x+1)*Mod(1,5),factormod(x^4+x^2+3*x+1,5)[,1],5,3)
>   ***   bug in GP (Segmentation Fault), please report

Amazing.  This routine is an empty (inefficient) frontend: it does nothing
but (expensive) argument checking for 40 lines, and then a single useful call
in the last line (to hensel_lift_fact).

No other PARI routine goes to such length. And it's still trivial to break it
(badly). OK, I'm adding yet more silly checks.

Besides, polhensellift() only allows lifting to Qp, not over an arbitrary
unramified extension, whereas the underlying hensel_lift_fact is completely
generic and wouldn't care at all [ there's an extra argument missing: the
defining polynomial for the extension, which is hardcoded as 'X' in
polhensellift(). ]

It's also completely useless since factorpadic(pol, p, prec) would produce
more or less the same output, possibly faster.

Lesson: never again allow direct frontends for internal PARI routines under GP.
It's really too cumbersome / dangerous.  install() is a saner mechanism.

Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425   Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud              http://www.math.u-psud.fr/~belabas/
F-91405 Orsay (France)            http://www.parigp-home.de/  [PARI/GP]