justinethier / cyclone

:cyclone: A brand-new compiler that allows practical application development using R7RS Scheme. We provide modern features and a stable system capable of generating fast native binaries.
http://justinethier.github.io/cyclone/
MIT License
823 stars 42 forks source link

Minor GC error in windows msys build #448

Closed justinethier closed 3 years ago

justinethier commented 3 years ago

Noticed the following error in last night's windows msys2 CI build:

make unit-tests
make[1]: Entering directory '/d/a/cyclone-bootstrap/cyclone-bootstrap'
./cyclone unit-tests.scm && ./unit-tests
gc_move: bad tag obj=0xffff5950 obj.tag=255
make[1]: *** [Makefile:140: unit-tests] Error 1

Have not seen any other cases of this recently and am not aware of an issue with the minor GC moving objects. Will need to keep an eye on this to see if it reoccurs, and to find a root cause.

arthurmaciel commented 3 years ago

@justinethier, I am on Linux but I faced a similar error:

(import (scheme base)
        ;; (scheme write)
        )

(define (fib n)
  (if (< n 2)
      n
      (+ (fib (- n 1)) (fib (- n 2)))))

(display (fib 20))

On v0.25:

cyclone /tmp/b.scm
Error: Unbound variable(s): 
(display)

On v0.26:

cyclone /tmp/b.scm
gc_move: bad tag obj=0x7fffc6f3f3c0 obj.tag=145

If I uncomment (scheme write), both versions compile and run ok.

justinethier commented 3 years ago

Thanks for the head's up @arthurmaciel ! There a good chance this was broken by a recent change. I'll see if I can reproduced here.

Just curious, do you see this error each time you recompile the program or is the problem intermittent?

arthurmaciel commented 3 years ago

@justinethier, I see this error every single time I recompile the program.

justinethier commented 3 years ago

The issue here is that calls in cyclone.scm were modified to include an extra parameter to support changes to the scheme libraries, but a compiled cyclone.c was never checked into the bootstrap repo. So we had a low-level C issue!

The compiled file has been checked in and I am no longer seeing this crash.

@arthurmaciel Please let me know if you do happen to see any more instances of this with a fresh installation from bootstrap master.