[racket] Using parameters in register-finalizer

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Fri Oct 17 15:22:06 EDT 2014

Hi all,

It appears that finalizers for register-finalizer are run in a special
thread that has an empty thread cell table, but it seems like this makes
certain parameters like `current-output-port` return #f instead of the
documented value.

Is that the expected behavior?

Welcome to Racket v6.1.1.1.
-> (require ffi/unsafe)
   (let () (define x (box 3)) (register-finalizer x (lambda (x) (displayln "hi"))))
-> (collect-garbage)
-> displayln: contract violation
  expected: output-port?
  given: #f
  argument position: 2nd
  other arguments...:
   "hi"

Cheers,
Asumu

Posted on the users mailing list.