On Wed, Feb 24, 2010 at 12:02 AM, Robert Gleeson <rob / flowof.info> wrote:

> Josh --
>
> Let me know how it goes :-) If you need any help you can get back to me
> here, or on IRC (irc.freenode.net / "robgleeson")
>
> Since a child process is spawned by DIa::Sandbox#run, and you want to
> capture a return value from your block i'd suggest using IO.pipe if you
> haven't thought of that already.
>
> Thanks,
> Rob
> --
> Posted via http://www.ruby-forum.com/.
>
>
Hi, Robert. I seem to be having difficulty. I tried to hello world, but I'm
getting a NullPointerError

http://img341.imageshack.us/img341/3522/picture12nc.png

I'm using RVM, and tried it with 1.8.6 and 7, and 1.9.1
I'm on OS X 10.5.6

When I run it in TextMate, it gives this backtrace
FFI::NullPointerError: invalid memory read at address=0x0
method get_string    in pointer.rb at line 57
method read_string    in pointer.rb at line 57
method run    in sandbox.rb at line 58
method fork    in sandbox.rb at line 56
method run    in sandbox.rb at line 56
at top level    in test1.rb at line 7


Here is the code:
require 'rubygems'
require 'dia'

sandbox = Dia::Sandbox.new(Dia::Profiles::NO_OS_SERVICES) do
  puts 'hello world'
end
sandbox.run