Projects

Ticket #808 (closed defect: fixed)

Opened 19 months ago

Last modified 19 months ago

sinatra does not load

Reported by: macruby@… Owned by: lsansonetti@…
Priority: critical Milestone: MacRuby 0.7
Component: MacRuby Keywords:
Cc: macruby@…

Description

macruby-0.6 > require 'sinatra'
TypeError: compared with non class/module

Change History

Changed 19 months ago by joshua.ballanco@…

This is due to Sinatra's use of Rack#release.

Changed 19 months ago by lsansonetti@…

Changed 19 months ago by lsansonetti@…

The #release problem has been fixed in r4374, however, sinatra fails a bit later in what seems to be the same #caller problem described in 806. It looks like sinatra was changed in the master repository, though, which avoids this.

Changed 19 months ago by macruby@…

  • cc macruby@… added

Cc Me!

Changed 19 months ago by macruby@…

Thanks. Is there a reason why this exception provides no backtrace?

$ macruby -rubygems -e' begin; require "sinatra"; rescue => e; p [e,e.backtrace]; end '
[#<TypeError: compared with non class/module>, []]

Changed 19 months ago by macruby@…

Using sinatra master (for caller fix) and yesterday's nightly (for Rack.release fix), I am still unable to get a simple sinatra app working:

$ cat test.rb 
require 'rubygems'
require 'sinatra'

get '/' do
  'hi'
end

$ macruby test.rb 
== Sinatra/1.0 has taken the stage on 4567 for development with backup from WEBrick
[2010-07-24 19:02:49] INFO  WEBrick 1.3.1
[2010-07-24 19:02:49] INFO  ruby 1.9.2 (2008-06-03) [universal-darwin10.0]
[2010-07-24 19:02:49] INFO  WEBrick::HTTPServer#start: pid=92127 port=4567
Assertion failed: ((b->flags & flags) == (flags & ~VM_BLOCK_THREAD)), function rb_vm_prepare_block, file dispatcher.cpp, line 1341.
Abort trap

Not sure if webrick is supposed to work, that might be the issue.

Changed 19 months ago by macruby@…

Looks like the assertion that's failing was part of the r4374 commit. r4374 is also causing the following error for me now (again with no backtrace, so I cannot track down the source):

undefined method `__hidden__retain' for #<Gem::Version "3.0.4"> (NoMethodError)

Changed 19 months ago by lsansonetti@…

There is no backtrace because the exception comes from rubygems which has been AOT compiled. In trunk we do enable much more optimizations which seem to affect symbolication. I suspect the inliner does not honor the dwarf metadata, but I need to investigate. In any case, this is a well known problem of trunk which will be fixed in the final release. In the meantime, you can specify the VM_DISABLE_RBO environment variable to 1 before running macruby, to force JIT compilation.

$ VM_DISABLE_RBO=1 macruby -e ...

You're right, the assertion problem was due to a wrong commit, has been fixed in r4379 and should appear in tomorrow's nightly build. As for the hiddenretain exception, I believe my fix does not 100% work on 10.6 environments, so we will look :)

Changed 19 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.7

I committed a better fix for the #release problem as r4381 and we tested it successfully on 10.6. We were also able to run a basic hello world sinatra app ( http://www.macruby.org/trac/browser/ControlTower/trunk/sample/sinatra_hello.ru?rev=4382) in ControlTower, the webserver we are currently working on.

I'm closing this bug, since the #caller bug seems to only appear when trying to load sinatra from the command line, and is covered by #806.

Note: See TracTickets for help on using tickets.