Opened 12 years ago

Closed 11 years ago

#916 closed defect (fixed)

lolevel-tests.scm failure on Linux/PPC (assertion failed: (pair? some-foo))

Reported by: Mario Domenech Goulart Owned by:
Priority: major Milestone: 4.9.0
Component: unknown Version: 4.8.x
Keywords: lolevel tests Cc:
Estimated difficulty:

Description (last modified by Mario Domenech Goulart)

4.8.0rc3 tarball on Linux/PPC:

$ make PLATFORM=linux PREFIX=/home/mario/local/chicken-4.8.0rc3 check

======================================== lolevel tests ...
../chicken lolevel-tests.scm -output-file a.c -verbose -include-path ..
gcc a.c -o a.o -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -I.. -I"/home/mario/local/chicken-4.8.0rc3/include/chicken"
rm a.c
gcc a.o -o a.out -L.. -L"/home/mario/local/chicken-4.8.0rc3/lib"  -Wl,-R"/home/mario/local/chicken-4.8.0rc3/lib" -lchicken -lm -ldl
rm a.o

Error: (lolevel-tests.scm:241) assertion failed: (pair? some-foo)

        Call history:

        lolevel-tests.scm:180: number-of-bytes    
        lolevel-tests.scm:184: make-record-instance       
        lolevel-tests.scm:190: record-instance?   
        lolevel-tests.scm:192: record-instance?   
        lolevel-tests.scm:196: record-instance-type       
        lolevel-tests.scm:200: record-instance-length     
        lolevel-tests.scm:206: record-instance-slot       
        lolevel-tests.scm:208: record-instance-slot-set!          
        lolevel-tests.scm:210: record-instance-slot       
        lolevel-tests.scm:214: record->vector     
        lolevel-tests.scm:222: object-size        
        lolevel-tests.scm:224: object-evict       
        lolevel-tests.scm:226: object-evicted?    
        lolevel-tests.scm:227: object-release     
        lolevel-tests.scm:239: object-become!     
        lolevel-tests.scm:241: ##sys#error              <--
make[1]: *** [check] Error 70
make[1]: Leaving directory `/home/mario/src/chicken-4.8.0rc3'
make: *** [check] Error 2
$ gcc --version
gcc (Debian 4.4.5-8) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Change History (12)

comment:1 Changed 12 years ago by sjamaan

FWIW, I tested on NetBSD/MacPPC as well, all tests succeeded there.

Did you test this on one of those flaky compile farms?

comment:2 Changed 12 years ago by Mario Domenech Goulart

No, it was on my old notebook.

comment:3 Changed 12 years ago by felix winkelmann

Milestone: 4.8.0

comment:4 Changed 12 years ago by Mario Domenech Goulart

Weird stuff. Observe:

$ cat lolevel-ppc.scm
(use lolevel)

(define tstvec (vector #f))
(define ev-tstvec (object-evict tstvec))
(object-release ev-tstvec)

(define some-foo '#(1 2 3))
(define some-bar '(1 2 3))
(object-become! (list (cons some-foo '(1 2 3)) (cons some-bar '#(1 2 3))))
(assert (pair? some-foo))

$ ./csc lolevel-ppc.scm -compiler ./chicken -v -I. -L. -include-path . -o lolevel-ppc
./chicken lolevel-ppc.scm -output-file lolevel-ppc.c -verbose -include-path .
gcc lolevel-ppc.c -o lolevel-ppc.o -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -I. -I"/home/mario/local/chicken-2012-09-08/include/chicken"
rm lolevel-ppc.c
gcc lolevel-ppc.o -o lolevel-ppc -L. -L"/home/mario/local/chicken-2012-09-08/lib"  -Wl,-R"/home/mario/local/chicken-2012-09-08/lib" -lchicken -lm -ldl
rm lolevel-ppc.o

$ ./lolevel-ppc 

Error: (lolevel-ppc.scm:10) assertion failed: (pair? some-foo)

        Call history:

        lolevel-ppc.scm:4: object-evict   
        lolevel-ppc.scm:5: object-release         
        lolevel-ppc.scm:9: object-become!         
        lolevel-ppc.scm:10: ##sys#error         <--

Now if I comment the tstvec stuff:

$ cat lolevel-ppc.scm
(use lolevel)

; (define tstvec (vector #f))
; (define ev-tstvec (object-evict tstvec))
; (object-release ev-tstvec)

(define some-foo '#(1 2 3))
(define some-bar '(1 2 3))
(object-become! (list (cons some-foo '(1 2 3)) (cons some-bar '#(1 2 3))))
(assert (pair? some-foo))

$ ./csc lolevel-ppc.scm -compiler ./chicken -v -I. -L. -include-path . -o lolevel-ppc
./chicken lolevel-ppc.scm -output-file lolevel-ppc.c -verbose -include-path .
gcc lolevel-ppc.c -o lolevel-ppc.o -c  -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -Os -fomit-frame-pointer -I. -I"/home/mario/local/chicken-2012-09-08/include/chicken"
rm lolevel-ppc.c
gcc lolevel-ppc.o -o lolevel-ppc -L. -L"/home/mario/local/chicken-2012-09-08/lib"  -Wl,-R"/home/mario/local/chicken-2012-09-08/lib" -lchicken -lm -ldl
rm lolevel-ppc.o

$ ./lolevel-ppc

$ echo $?
0

comment:5 Changed 12 years ago by Mario Domenech Goulart

Resolution: wontfix
Status: newclosed

That test work if I build chicken with gcc 4.7.1.

Looks like some GCC versions have problems on that platform.

See the thread http://lists.nongnu.org/archive/html/chicken-hackers/2012-09/msg00017.html for more information on this topic.

comment:6 Changed 12 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

comment:7 Changed 11 years ago by Mario Domenech Goulart

Description: modified (diff)

I observed the same behavior with gcc 4.7.2 on Linux/x86, CHICKEN master as of 445e245a54b56e232236c3a47ce4905ca79b2007:

$ gcc --version
gcc (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The error is

======================================== lolevel tests ...

Error: assertion failed: (pair? some-foo)

        Call history:

        <syntax>          (cons some-bar (quote #(1 2 3)))
        <syntax>          (quote #(1 2 3))
        <syntax>          (##core#quote #(1 2 3))
        <eval>    (object-become! (list (cons some-foo (quote (1 2 3))) (cons some-bar (quote #(1 2 3)))))
        <eval>    (list (cons some-foo (quote (1 2 3))) (cons some-bar (quote #(1 2 3))))
        <eval>    (cons some-foo (quote (1 2 3)))
        <eval>    (cons some-bar (quote #(1 2 3)))
        <syntax>          (assert (pair? some-foo))
        <syntax>          (##core#if (##core#check (pair? some-foo)) (##core#undefined) (##sys#error "assertion failed" (##cor......
        <syntax>          (##core#check (pair? some-foo))
        <syntax>          (pair? some-foo)
        <syntax>          (##core#undefined)
        <syntax>          (##sys#error "assertion failed" (##core#quote (pair? some-foo)))
        <syntax>          (##core#quote (pair? some-foo))
        <eval>    (pair? some-foo)
        <eval>    (##sys#error "assertion failed" (##core#quote (pair? some-foo)))      <--
make[1]: *** [check] Error 70
make[1]: Leaving directory `/home/mario/src/chicken-core'
make: *** [check] Error 2

I pretty printed some-foo after object-become! and it printed #<unprintable object>

comment:8 Changed 11 years ago by sjamaan

Resolution: wontfix
Status: closedreopened

comment:9 Changed 11 years ago by sjamaan

Reopened (at least for now), as it still happens on Debian Wheezy/x86 as well. We can easily reproduce this now on a new test server.

Note that it ONLY happens with DEBUGBUILD disabled.

comment:10 Changed 11 years ago by sjamaan

Resolution: worksforme
Status: reopenedclosed

Aaaaand... we can't reproduce it today.

Great :(

This bug is too hard to track, so we can't fix it for 4.9.0 (especially considering it might be a GCC bug). Closing the ticket again (for now...)

comment:11 Changed 11 years ago by Mario Domenech Goulart

Resolution: worksforme
Status: closedreopened

comment:12 Changed 11 years ago by Mario Domenech Goulart

Resolution: fixed
Status: reopenedclosed

It turns out to be a problem with CHICKEN, not with GCC. The issue has been observed again on Linux Mint 16 x86-64 (gcc 4.8.1) during the 4.9.0 prerelease phase (master at e42caebcb035dccb9853d728b364ada3089344fa can trigger the problem with that GCC version on "make check").

See details in the message Peter wrote to chicken-hackers: https://lists.nongnu.org/archive/html/chicken-hackers/2014-04/msg00012.html

Fixed by 97849ffc17f20c2e035d6e672fe8871dc0487863

Note: See TracTickets for help on using tickets.