Karim Belabas on Wed, 05 May 2004 10:42:32 +0200


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

Re: Bug??


* Manish [2004-05-05 08:26]:
> I am not sure if this is a bug in pari or gcc or if I am doing 
> something wrong. 
> While compiling pari with gcc-3.4.0, I see 
> 
> /usr/bin/gcc -c -O2 -DGCC_INLINE -Wall -Wno-implicit -fomit-frame-pointer
> -march=i686   -I. -I../src/headers  -o buch2.o ../src/basemath/buch2.c
> ../src/basemath/buch2.c: In function `buchall':
> ../src/basemath/buch2.c:2925: warning: function called through a non-compatible
> type
> ../src/basemath/buch2.c:2925: note: if this code is reached, the program will
> abort
> 
> and like it says as soon as I type ./gp after the compilation completes
> I get
> 
>   ***   bug in GP (Segmentation Fault), please report
>   ***   Error in the PARI system. End of program.

As for the warning: I presume you are using version 2.1.5 of pari (or
earlier) and line 2925 reads something like

  ((void(*)(long))random_relation)(-1);

A quick fix is to replace the line by

  random_relation(-1,0,0,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

A better fix is to switch to a recent version on the unstable branch, which
has more robust (and much faster) code. ( I.e 2.2.7.alpha, or through cvs
if you don't mind quick bugfix/update cycles. )

As for the Segmentation Fault, I am clueless [ should be quite unrelated
to the above ]. Does the problem occur after compiling a debugging binary ?
( ./Configure -g && make dbg && ./gp.dbg ). If so, can you send a gdb stack
trace, preferably to pari-dev ?

Thanks,

    Karim.
-- 
Karim Belabas                     Tel: (+33) (0)1 69 15 57 48
Dep. de Mathematiques, Bat. 425   Fax: (+33) (0)1 69 15 60 19
Universite Paris-Sud              http://www.math.u-psud.fr/~belabas/ 
F-91405 Orsay (France)            http://pari.math.u-bordeaux.fr/  [PARI/GP]