[racket-dev] a few bugs

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Mon Mar 28 20:08:12 EDT 2011

A simple experiment with parallelism and syntax exposed several Racket
bugs.  All of these programs start with this header:

#lang racket

(require racket/future)
(current-directory "collects/racket/private")
(current-namespace (make-base-namespace))

(define (big) (expand (read-syntax #f (open-input-file "for.rkt"))))

(define (go1)
  (let loop ([s (big)])
    (syntax-case s ()
      [(a . b) (loop #'a) (loop #'b)]
      [_ (display 1)])))

Then, if we do:

(define (gon)
  (for ([i (in-range 1000)]) (go1)))

(define l (list (future gon) (future gon)))
(map touch l)

we get this error:
  make-vector: expected argument of type <non-negative exact integer>;
given 831868466

If we do:

(define l (list (future go1) (future go1)))
(map touch l)

Then we sometime get segfaults, and sometimes run to completion.

If we just do:

(go1)

Then it runs correctly in Racket, but consistently segfaults in
DrRacket, like this:

  Seg fault (internal error during gc) at 0x8147c64
  SIGSEGV SEGV_ACCERR SI_CODE 2 fault on 0x8147c64

This is all with the latest Git, *with --enable-places* (although
places aren't used).
-- 
sam th
samth at ccs.neu.edu


Posted on the dev mailing list.