[racket-dev] strange memory corruption with drracket

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Wed Oct 31 21:33:06 EDT 2012

With my latest fix to handling of the `Any` type, the following small
program (also at https://gist.github.com/3991023) crashes drracket (I
can't provoke the bug with plain racket):

#lang racket/load

(module m typed/racket
  (define: v : Any (exn "" (current-continuation-marks)))
  (provide v))

(module n racket
  (require 'm)

(require 'n)

I regularly get segmentation faults, but I've also seen errors
complaining that `make-struct-field-accessor` is not getting the
correct kind of value, instead getting #<bad-value> or #<module-code>
or other assorted unlikely results, like this:

make-struct-field-accessor: contract violation
   (and/c struct-accessor-procedure? (lambda (p)
(procedure-arity-includes? p 2)))
  given: #<variable-code>
  argument position: 1st
  other arguments...:

There's a stack trace from a segfault at the gist link above. The
relevant code is in typed-racket/utils/any-wrap.rkt.
sam th
samth at ccs.neu.edu

Posted on the dev mailing list.