Karim BELABAS on Tue, 10 Sep 2002 03:11:20 +0200 (MEST)


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

Re: yet another rnfkummer() posting


On Mon, 9 Sep 2002, Igor Schein wrote:
>> Just to recap. These two are the only surviving bugs in the "bnfinit & friends"
>
> I believe I found 1 more, extremely complicated and extremely fatal (
> it took me the whole day just to narrow it down):
>
> ? setrand(1);bnf=bnfinit(quadpoly(-7287,y));
> ? v=subgrouplist(bnrinit(bnf,25,1),5,1);
> ? rnfkummer(bnrinit(bnf,25,1),v[19]);
> ? rnfkummer(bnrinit(bnf,25,1),v[20]);
> Segmentation fault
>
> And the session crashes ( after less than 2min on a 1.7GHz machine ).
>
> Note that I have to call bnrinit() 3 times, otherwise, I guess, the
> random seed changes and the problem is not reproducible anymore.
>
> Also, this appears to be a Linux/i386-specific bug, FreeBSD and
> Solaris are not vulnerable ( I haven't tried 64bit ).

This is actually two bugs in one [ both of them relatively old ]:

1) not enough precision in isunit() when computing the "root of 1" part
[ oversight: at the very end of the routine, we computed 2Pi/n to a small
precision, whereas it costs nothing to compute it to the precision of the
number field data ]

2) an error handler ( as from trap() ) could leak out from bestappr_noer()
[ error handlers are PARI's implementation of the catch/try/throw mechanism,
used here to prevent "truncation error" while computing continued
fraction expansions ]

So bestappr_noer() returned, and the later "truncation error" exception that
was raised by isunit() triggered the (now a priori invalid) handler, with
fatal results.

    Karim.
-- 
Karim Belabas                    Tel: (+33) (0)1 69 15 57 48
Dép. de Mathematiques, Bat. 425  Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud             Email: Karim.Belabas@math.u-psud.fr
F-91405 Orsay (France)           http://www.math.u-psud.fr/~belabas/
--
PARI/GP Home Page: http://www.parigp-home.de/