Bill Allombert on Sun, 19 Feb 2023 17:59:43 +0100

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

Re: Segmentation Fault in Pari/GP from gp2c-run

On Sun, Feb 19, 2023 at 07:57:32AM -0800, Edmond Griffin wrote:
> Hello,
>     I am working on an old conjecture of Erdos-Turan using Pari/GP.  Although the computations are simple, the number of them is very large.  To speed things up, I hoped to convert my .gp code into C using gp2c. I am having difficulty doing so.
>    I believe both gp and gp2c were built successfully on my machine - a quad core i7 MacBook Pro.  When I compile and run the code using gp2c-run I get no warnings of undeclared or unused variables.  I do get the following warning before gp starts:
> ld: warning: -undefined dynamic_lookup may not work with chained fixups
>    Then when I call my function (extDnkc) I get
> ? extDnkc(15,6,0,"/Volumes/BinPolyData/Diffs/")    
>   ***   user warning: 
>   ***   at top-level: extDnkc(15,6,0,"/Volumes/BinPolyData/Diffs/")
>   ***                 ^---------------------------------------------
>   *** extDnkc: bug in PARI/GP (Segmentation Fault), please report.
> Can you suggest a course of action?
>     fName = strjoin([fPath,strprintf("D_%d_%d_TN.csv", n, k)]);
>     iferr(fIn=fileopen(fName,"r"), ERR, 
>         warning(strprintf("Bad input file: %s",fName)); return,errname(ERR)=="e_FILE");

Indeed, there is a bug in PARI that cause warning() to be miscompiled by gp2c.
I suggest to replace warning() by print() until we fix it.
Sorry for the trouble!