#624 Memory corruption

closed
nobody
Lisp Core (471)
5
2006-07-31
2004-10-18
No

The script below messes up symbol names. Various
variants do not, but I can't get it simpler than this.

-s

divmod(a,b,modulus):=1;
divmodx(a,b,m):=divide(a^b,m)[2];
testing(qq,rr):=
makelist([divmod(qq,rr,4),divmodx(qq,rr,4)],
cnt,1,10);

for p:1 thru 5 do print ([testing(13234,99456),labels]);

....
[[[1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0], [1, 0],
[1, 0], [1, 0], [1, 0]],
[˜(:", !Š@ž, *ˆ8, Ą, œ–, §8LG, ć°3....

Maxima version: 5.9.0.9beta2
Maxima build date: 10:50 7/27/2004
host type: i686-pc-mingw32
lisp-implementation-type: Kyoto Common Lisp
lisp-implementation-version: GCL 2.6.3

Discussion

  • Barton Willis

    Barton Willis - 2004-10-21

    Logged In: YES
    user_id=895922

    With 5.9.1.1cvs, I don't get the garbage.

    (%i3) display2d : false;
    (%o3) FALSE
    (%i4) divmod(a,b,modulus):=1;
    (%o4) divmod(a,b,MODULUS):=1
    (%i5) divmodx(a,b,m):=divide(a^b,m)[2];

    (%o5) divmodx(a,b,m):=DIVIDE(a^b,m)[2]
    (%i6) testing(qq,rr):=
    makelist([divmod(qq,rr,4),divmodx(qq,rr,4)],
    cnt,1,10);

    (%o6) testing(QQ,rr):=MAKELIST([divmod(QQ,rr,4),divmodx
    (QQ,rr,4)],cnt,1,10)
    (%i7) for p:1 thru 5 do print ([testing(13234,99456),labels]);

    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]

    (%i12) build_info();

    Maxima version: 5.9.1.1cvs
    Maxima build date: 12:21 10/20/2004
    host type: i686-pc-mingw32
    lisp-implementation-type: Kyoto Common Lisp
    lisp-implementation-version: GCL 2.6.5

    Barton

     
  • Barton Willis

    Barton Willis - 2004-10-21

    Logged In: YES
    user_id=895922

    With 5.9.1.1cvs, I don't get the garbage.

    (%i3) display2d : false;
    (%o3) FALSE
    (%i4) divmod(a,b,modulus):=1;
    (%o4) divmod(a,b,MODULUS):=1
    (%i5) divmodx(a,b,m):=divide(a^b,m)[2];

    (%o5) divmodx(a,b,m):=DIVIDE(a^b,m)[2]
    (%i6) testing(qq,rr):=
    makelist([divmod(qq,rr,4),divmodx(qq,rr,4)],
    cnt,1,10);

    (%o6) testing(QQ,rr):=MAKELIST([divmod(QQ,rr,4),divmodx
    (QQ,rr,4)],cnt,1,10)
    (%i7) for p:1 thru 5 do print ([testing(13234,99456),labels]);

    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    Warning: MODULUS being set to 4, a non-prime.
    [[[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]],
    [%i7,%o6,%i6,%o5,%i5,%o4,%i4,%o3,%i3,%o2,%i2,%o1,%
    i1]]

    (%i12) build_info();

    Maxima version: 5.9.1.1cvs
    Maxima build date: 12:21 10/20/2004
    host type: i686-pc-mingw32
    lisp-implementation-type: Kyoto Common Lisp
    lisp-implementation-version: GCL 2.6.5

    Barton

     
  • Robert Dodier

    Robert Dodier - 2006-07-31

    Logged In: YES
    user_id=501686

    Not observed in 5.9.3cvs with Clisp 2.38 nor GCL 2.6.7.
    Closing this report as "works for me" taking into account
    also the negative report for 5.9.1.1cvs.

     
  • Robert Dodier

    Robert Dodier - 2006-07-31
    • status: open --> closed
    • labels: --> Lisp Core
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks