Kevin Forchione | 29 Aug 23:10 2014

variable wrong procedure or structure-type shape error?

Hmmmm…. something changed between Racket 6.1 and the latest release that is producing this mysterious
(to me at least!) error in a project of mine that compiles fine with 6.1, but not with the latest version,

Welcome to DrRacket, version [3m].
Language: racket [custom]; memory limit: 512 MB.
link: bad variable linkage;
 reference to a variable that has the wrong procedure or structure-type shape
  reference phase level: 0
  variable module: "/Users/lysseus/Racket/games/lib/matrix.rkt"
  variable phase: 0
  reference in module: "/Users/lysseus/Racket/games/2048/2048-obj.rkt" in: matrix-row

Any idea wheat this error means and why is getting the error? It appears to have been introduced
sometime after version [3m]., which compiled fine.

  Racket Developers list:

Kathi Fisler | 27 Aug 02:42 2014

Call for Participation: SPLASH Educators Symposium

  SPLASH-E Call for Participation
 Tuesday, Oct 21 2014, Portland OR
     In conjunction with the SPLASH conference

SPLASH-E is a forum for software and languages researchers with
activities and interests around computing education.  This year's
SPLASH-E will feature sessions around three themes:

  * Creating (and Assessing) Projects and Courses to Engage Students
  * Design Issues around Drag-and-Drop languages
  * Designing Software Engineering Courses

as well as time dedicated to impromptu discussion around these and
other topics that arise.  Formal presentations will be short (15-20 minutes),
designed to raise questions for discussion rather than to simply present 

The PC is framing discussion questions within each theme, but also
welcomes questions on these topics from the broader SPLASH community.
If you have a research question or idea related to these themes and
plan to attend, drop me a line so we can include your question in the
discussion period.

Come experience an interactive day of discussion on educational
aspects of software systems.  Hope to see you in Portland!

Kathi Fisler
SPLASH-E chair

  Racket Developers list:
Neil Toronto | 16 Aug 14:55 2014

Should `register-finalizer` unwrap impersonators?

Short version: the contract system doesn't allow `register-finalizer` to 
be used in Typed Racket.

Long version: consider the following Typed Racket program, in which 
instances of `os-resource-wrapper` represent an operating system 
resource `os-resource`, which itself is just a counter. It attempts to 
register a finalizer for allocated wrappers, which decrements the counter.

#lang typed/racket

  [register-finalizer  (All (A) (-> A (-> A Any) Void))])

(: os-resource Integer)
(define os-resource 0)

(struct os-resource-wrapper ())

(: alloc-os-resource (-> os-resource-wrapper))
(define (alloc-os-resource)
   (set! os-resource (add1 os-resource))
   (define w (os-resource-wrapper))
   (register-finalizer w (λ (w) (set! os-resource (sub1 os-resource))))

(define w (alloc-os-resource))
(printf "os-resource = ~v~n" os-resource)
(sleep 1)  ; give finalizers a chance to run
(printf "os-resource = ~v~n" os-resource)

I get this output:

   os-resource = 1
   os-resource = 0

The finalizer is being run while the program still has a pointer to the 
wrapper object. I think it's because the wrapper object is being 
impersonated when it's sent across the contract barrier, and the 
*impersonator* is getting the finalizer. (Or it's a chaperone, or an 
impostor, or a charlatan, or whatever. Let's go with impersonator.)

In my specific case, the OS resources are OpenGL objects; e.g. vertex 
object arrays. The call to `register-finalizer` *must* be in Typed 
Racket code because the wrapper contains an (Instance GL-Context<%>), 
which can't have a contract put on it, so it can't pass from untyped to 
typed code.

Is there any reason for `register-finalizer` to behave this way? Does it 
ever make sense to register a finalizer on an impersonator?

Neil ⊥
  Racket Developers list:
Stephen Chang | 15 Aug 20:33 2014

internal-definition-context-seal doesn't seem to do anything

The docs say that if I make an internal definition context with
syntax-local-make-definition-context, I have to seal it with
internal-definition-context-seal, otherwise an exception gets raised.
But I can't get this to happen. Does someone have an example that
causes the exception to get thrown?

For example, this program from the racket tests produces the same
result if I comment out the seal line. Other tests behave similarly.

(define-syntax (bind stx)
  (syntax-case stx ()
    [(_ handle def)
     (let ([def-ctx (syntax-local-make-definition-context)]
           [ctx (cons (gensym 'intdef)
                      (let ([orig-ctx (syntax-local-context)])
                        (if (pair? orig-ctx)
           [kernel-forms (list #'define-values)])
       (let ([def (local-expand #'def ctx kernel-forms def-ctx)])
         (syntax-case def ()
           [(define-values (id) rhs)
              (syntax-local-bind-syntaxes (list #'id) #f def-ctx)
              (internal-definition-context-seal def-ctx)
                  (define-values (id) rhs)
                  (define-syntax handle (quote-syntax id))))]
           [_ (error "no")])))]))

(define-syntax (nab stx)
  (syntax-case stx ()
    [(_ handle)
     (syntax-local-value #'handle)]))

(let ()
  (bind h (define q 5))
  (define q 8)
  (nab h))
  Racket Developers list:

Ryan C | 11 Aug 22:30 2014

Sandboxed evaluations throwing error from command line, but not from DrRacket

Howdy all,

I've been having an issue with sandboxed evaluations when requiring certain libraries, such as pict or 2htdp/image. I create a module evaluator and provide #:allow-for-require '(pict 2htdp/image etc.). I have this wrapped in a hand-in server type setup. When I start servlet.rkt in DrRacket, everything runs hunky-dory. When I run "racket servlet.rkt", the server spins up fine but when I try "(require pict) (circle 10)" (which works on the DrRacket-initialized one) I get an exception stating that file-read access 'exists' denied for C:\...(current directory)\racket.exe. Then I tried adding (current-directory) to the #:allow-read list, and it complains about C:\Python\racket.exe. If I continue allowing read paths, I see it effectively scans a ton of folders looking for this executable. Yet, when the servlet is started from DrRacket, this is never an issue. Any idea what the source of this discrepancy might be?

  Racket Developers list:
Matthew Flatt | 12 Aug 06:16 2014

SGC as default

I've changed the Racket CGC implementation --- which is mostly used
only to build the normal Racket variant --- to use SGC by default,
instead of the Boehm GC. The intent of the switch is to make the more
portable GC the default.

If you have an existing build in a repo checkout, then `make` is likely
to fail, because the makefile dependencies are not precise enough to
deal with the switch. You can discard your old build directory, or it
might work to simply delete


If you're using CGC and want to continue using the Boehm GC, then
provide `--disable-sgc` to `configure`. I've tuned SGC to bring its
performance closer to the Boehm GC, but it's still slower.

  Racket Developers list:

Chris | 3 Aug 03:33 2014

Documentation Update for 6.1

> Hi,
> In trying to look up the documentation for some of the new features in the release it looks like the
documentation on is still for 6.0.1
> I was able to just use the local documentation, so it’s not a big deal. I just wanted to make sure it
didn’t fall through the cracks of the release.
> Thanks for 6.1, by the way, it seems very solid.
> -Chris

  Racket Developers list:
Roman Klochkov | 2 Aug 20:22 2014

Performance: bytes->string/locale

Tested on Racket 6.0.1


(define str (string->bytes/locale "abcdefghабвгде"))
   (for ([i 1000000])
      (bytes->string/locale str)))

   (for ([i 1000000])
      (bytes->string/utf-8 str)))

Windows 7 x32:

> (enter! "test.rkt")
cpu time: 859 real time: 908 gc time: 78
cpu time: 641 real time: 667 gc time: 16

Seems OK

$ uname -a
Linux veles 3.14-1-686-pae #1 SMP Debian 3.14.12-1 (2014-07-11) i686 GNU/Linux

$ /usr/racket/bin/racket
Welcome to Racket v6.0.1.
> (enter! "test.rkt")
cpu time: 3072 real time: 3075 gc time: 52
cpu time: 552 real time: 551 gc time: 8

Locale in both cases utf-8, so bytes->string/utf-8 and bytes->string/locale returns the same, but bytes->string/locale in Linux 6 times slower.
Is it fixable?

Roman Klochkov
  Racket Developers list:
Ryan Culpepper | 1 Aug 20:24 2014

Release Announcement for v6.1, second draft

The release announcement draft that I have so far is below.  Please
mail me new items and/or edits.

Racket v6.1 raises an exception when a local variable is used before
its definition, instead of producing an #<undefined> value. (Thanks
to Claire Alvis.)

Since programs are rarely intended to produce #<undefined>, raising an
exception provides earlier and better feedback to programmer.
Module-level variables have always triggered an exception when used
too early, and this change makes local bindings --- including fields
within a class --- behave the same.

This is a backward-incompatible change to Racket. Aside from exposing
a few bugs, the change mainly affects programs that include

   (define undefined (letrec ([x x]) x))

to obtain the #<undefined> value. There is now no #<undefined> value
in the old sense, but the `racket/undefined` library (which was
introduced in the previous release) provides `undefined` for use in
place of the pattern above when an "undefined" value is still needed.


* Plumbers generalize the flush-on-exit capability of primitive
   output ports to enable arbitrary flushing actions and to give
   programmers control over the timing of flushes (i.e., a composable
   `atexit`).  New functions include `current-plumber`,
   `plumber-add-flush!`, and `plumber-flush-all`.

* contracts: the contract system's random testing facility has been
   strengthened so that it can easily find simple mistakes in
   contracted data structure implementations (e.g. an accidental
   reverse of a conditional in a heap invariant check).

* redex: the semantics of mis-match patterns (variables followed by
   _!_) inside ellipses has changed in a backwards incompatible way;
   they semantics is now much clearer and now potentially even
   useful. This change simplifies the patterns' semantics and
   increases the usefulness of these patterns.

* check-random is an addition to the preferred unit testing
   framework in the teaching languages. It enables the testing of
   students' functions that use random-number generation. (Thanks to
   David Van Horn (UMaryland) for proposing this idea.)

* Upgraded and normalized versions of graphics libraries and
   dependencies (Pango, Cairo, GLib, etc.) that are bundled with
   Racket on Windows and Mac OS X. For example, FreeType support is
   consistently enabled.

* The Typed Racket standard library includes contracted exports from
   the Racket standard library, such as racket/format's formatting

* Typed Racket now supports asynchronous channels using the
   `typed/racket/async-channel' library.

* The openssl library supports forward secrecy via DHE and ECDHE
   cipher suites (thanks to Edward Lee) and Server Name Indication
   (thanks to Jay Kominek).

  Racket Developers list:

Antonio Menezes Leitao | 31 Jul 19:58 2014

Scribble bug?


Scribble doesn't correctly render scaled bitmaps when the scale produces ratios in the width or height of the pict.

The following scribble program:

#lang scribble/base
<at> (require pict)
<at> (bitmap "foo.jpg")

generates an html file that includes:

<img style="vertical-align: 0px; margin: -3px -3px -3px -3px;" src="pict.png" alt="image" width="1587" height="977"/>

However, the following scribble program that scales the image:

#lang scribble/base
<at> (require pict)
<at> (scale-to-fit  (bitmap "foo.jpg") 1024 1024)

generates an html that includes:

<img style="vertical-align: 0px; margin: -3px -3px -3px -3px;" src="pict.png" alt="image" width="1030" height="1003790/1581"/>

Note the fraction, which Chrome does not parse correctly. The result is as an incredibly stretched image.

  Racket Developers list:
Evgeny Odegov | 31 Jul 11:54 2014

Seg fault

Today some conditions met on my machine and DrRacket began to crash almost
immediately after run. So I reproduced it many times.

The results of last several crashes:

*  Seg fault (internal error) at 31a3a4c
   Seg fault (internal error) at 31a3a4c
   Seg fault (internal error) at 31a3a4c

*  Seg fault (internal error) at 25863a4c
   Seg fault (internal error) at 25863a4c
   Seg fault (internal error) at 25863a4c

*  Seg fault (internal error) at 29e93a4c
   Seg fault (internal error) at 29e93a4c
   Seg fault (internal error) at 29e93a4c

*  Seg fault (internal error) at 4223a4c
   Seg fault (internal error) at 4223a4c
   Seg fault (internal error) at 4223a4c

*  Seg fault (internal error) at 1c55392ac
   Seg fault (internal error) at 1c55392ac
   Seg fault (internal error) at 1c55392ac

*  Seg fault (internal error) at 256b41fc
   Seg fault (internal error) at 256b41fc
   Seg fault (internal error) at 256b41fc

Racket version: (32 bit x86)
OS: Windows 7 Prof 64 bit

I also decided to try current snapshot
The crashes are repeated:

*  Seg fault (internal error) at 2b9c3a4c
   Seg fault (internal error) at 2b9c3a4c
   Seg fault (internal error) at 2b9c3a4c

*  Seg fault (internal error) at 28b53a4c
   Seg fault (internal error) at 28b53a4c
   Seg fault (internal error) at 28b53a4c

  Racket Developers list: