[racket-dev] Fwd: Sandbox evaluation problem - files with comment boxes

From: Nadeem Abdul Hamid (nadeem at acm.org)
Date: Mon Jan 26 21:27:31 EST 2015

Ah, I am still struggling with this sandbox problem! (previous message to
'users' below) I'm starting to feel like maybe there's a bug in 6.1.1, or
else something changed in recent versions that I'm missing. The following
screenshots show the entire contents of the BSL file that I'm trying to
load using make-module-evaluator, with gracket v6.1.1 failing the second
time you try to load the file (or another one) that contains a comment box,
while racket v6.1.1 and gracket 6.0 don't have this behavior:



--- nadeem

---------- Forwarded message ----------
From: Nadeem Abdul Hamid <nadeem at acm.org>
Date: Sun, Jan 25, 2015 at 10:35 PM
Subject: Sandbox evaluation problem - files with comment boxes
To: users <users at racket-lang.org>

I'm trying to create a simple sandbox evaluator (to load in programs in
*SL). I have the following code:

#lang racket
(require racket/sandbox)
(define E
  (parameterize ([sandbox-path-permissions
                  '([write "/var/folders"]
                    [exists "/"]
                    [read "/"])]
    (make-module-evaluator (string->path "test-file.rkt"))))

This works fine as long as test-file.rkt does *not* contain a comment box.
If the file contains a comment box, then the following error occurs:

dynamic-require: unknown module
  module name: #<resolved-module-path:"/Applications/Racket

I thought maybe parameterizing sandbox-namespace-specs with 'framework
might do something:

(require racket/sandbox racket/gui)
(define E
  (parameterize ([sandbox-path-permissions
                  '([write "/var/folders"]
                    [exists "/"]
                    [read "/"])]
                  (list make-gui-namespace 'framework)]
    (make-module-evaluator (string->path "lab01-insulin.rkt"))))

But it results in:
   namespace-attach-module: a different instance of the same module is
already in the destination namespace
  module name: "/Applications/Racket

Any suggestions?


--- nadeem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20150126/04564eaa/attachment.html>

Posted on the dev mailing list.