Jason Moxham on Sat, 04 Jul 2009 02:07:42 +0200


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

Re: Some bugs?


----- Original Message ----- From: "Jason Moxham" <jason@njkfrudils.plus.com>
To: <pari-dev@list.cr.yp.to>
Sent: Saturday, July 04, 2009 12:35 AM
Subject: Re: Some bugs?


----- Original Message ----- From: "Bill Allombert" <Bill.Allombert@math.u-bordeaux1.fr>
To: <pari-dev@list.cr.yp.to>
Sent: Friday, July 03, 2009 11:41 PM
Subject: Re: Some bugs?


On Fri, Jul 03, 2009 at 05:54:01PM +0100, Jason Moxham wrote:
----- Original Message ----- From: "Bill Allombert"
<Bill.Allombert@math.u-bordeaux1.fr>
To: <pari-dev@list.cr.yp.to>
Sent: Friday, July 03, 2009 4:47 PM
Subject: Re: Some bugs?


and here is parisvn with MSVC32 no GMP
break> bnfinit(x^2+105)
Time disc. factorisation: 0
Treating p^k = 2^2
Time round4: 0
get_red_G: starting LLL, prec = 4 (4 + 0)
Time LLL basis: 0
Time mult. table: 0
Time matrices: 0
Time nfinit & rootsof1: 0
R1 = 0, R2 = 1
D = 420
LIMC = 20, LIMC2 = 20
Time factor base: 0
Time sub factorbase (3 elements): 0
KCZ = 7, KC = 10, n = 15
1 2 3 4 5 6 7
#### Looking for 15 relations (small norms)
 ***   at top-level: bnfinit(x^2+105)
 ***                 ^----------------
 *** bnfinit: bug in PARI/GP (Segmentation Fault), please report
*** Break loop: type <Return> three times, or Control-d, to go back to
GP)

So this is a problem with the function small_norm.
Maybe you could use debugger to pin-point it ?
(there is a definite possibility that small_norm has a bug which does
manifest itself on Linux).

Cheers,
Bill.


I don't know how to use the windows CL debugger , so doing it the old fashioned way.
in buch2.c from line 2120 we have

   BOUND *= 1 + 1e-6;
   k = N; y[N] = z[N] = 0; x[N] = 0;
   for (av2 = avma;; avma = av2, step(x,y,inc,k))            // POSITION 1

{ // POSITION 5
     do
     { /* look for primitive element of small norm, cf minim00 */
       int fl = 0;
       double p;
       if (k > 1)
       {
         long l = k-1;
         z[l] = 0;
         for (j=k; j<=N; j++) z[l] += q[l][j]*x[j];
         p = (double)x[k] + z[k];
         y[l] = y[k] + p*p*v[k];
         if (l <= skipfirst && !y[1]) fl = 1;
         x[l] = (long)floor(-z[l] + 0.5);
         k = l;
       }
       for(;; step(x,y,inc,k))
       {
         if (!fl)
         {
           p = (double)x[k] + z[k];
           if (y[k] + p*p*v[k] <= BOUND) break;

           step(x,y,inc,k);

           p = (double)x[k] + z[k];
           if (y[k] + p*p*v[k] <= BOUND) break;
         }
         fl = 0; inc[k] = 1;
         if (++k > N) goto ENDIDEAL;
       }
     } while (k > 1);

     /* element complete */                    //        POSITION 2
if (zv_content(x) !=1) continue; /* not primitive */ // POSITION 3
     gx = ZM_zc_mul(IDEAL,x);                // POSITION 4
     if (ZV_isscalar(gx)) continue;


the code goes thru pos 1 thru to pos 2 then 3 does not go to 4 but goes back to 1 , it never gets to pos 5 there is no exit condition on the for loop so it must crash in step(x,y,inc,k) , whether this the cause , I dont know ?

I'll keep looking
Jason




I've got a solution , although I'm not if this addresses the underlying cause.

In buch2.c there is a inline function called step if we rename this to step_buch2local and all the calls to it , then it works.

Why does this work?

There is another inline function called step in bibli1.c , and it does't like two functions with the same name , they are both inlined , but perhaps the name scope is still global? , I'm getting a little out of my knowledge range here :)

I try a web search , see if I can come up with something.

Jason