[plt-scheme] sandbox & ports closed prematurely

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Jul 1 07:57:20 EDT 2008

On Jul  1, Tom Schouten wrote:
> Hello,
> I ran into strange sandbox evaluator behaviour where an output port gets closed immediately, 
> instead of at evaluator destruction time:
> Welcome to MzScheme v4.0.1.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.
> > (require scheme/sandbox)
> > (sandbox-security-guard (current-security-guard))
> > (define e (make-evaluator 'scheme/base))
> > (define f (e '(open-output-file "/tmp/bla")))
> > (display 123 f)
> display: output port is closed

The default is a little paranoid: every evaluation is performed with a
time and a space limit, which means running under a temporay
custodian.  If you add (sandbox-eval-limits #f) then this will not

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.