nning / david

CoAP server with Rack interface.
MIT License
37 stars 11 forks source link

Starting the HelloWorld example crashes setsockopt in multicast #1

Closed matus-tomlein closed 9 years ago

matus-tomlein commented 9 years ago

When I try to run the HelloWorld example as run Rack::HelloWorld using rackup config.ru, I get the following error:

[2015-02-08 09:48:55] INFO  David 0.4.0 on ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
[2015-02-08 09:48:55] INFO  Starting on [::1]:9292
[2015-02-08 09:48:55] ERROR  Actor crashed!
Errno::EINVAL: Invalid argument - setsockopt(2)
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/david-0.4.0/lib/david/server/multicast.rb:44:in `setsockopt'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/david-0.4.0/lib/david/server/multicast.rb:44:in `multicast_listen_ipv6'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/david-0.4.0/lib/david/server/multicast.rb:11:in `block in multicast_initialize!'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/david-0.4.0/lib/david/server/multicast.rb:11:in `each'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/david-0.4.0/lib/david/server/multicast.rb:11:in `multicast_initialize!'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/david-0.4.0/lib/david/server.rb:32:in `initialize'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `public_send'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:26:in `dispatch'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/calls.rb:63:in `dispatch'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:60:in `block in invoke'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/cell.rb:71:in `block in task'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/actor.rb:357:in `block in task'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks.rb:57:in `block in initialize'
        /Users/matus/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/celluloid-0.16.0/lib/celluloid/tasks/task_fiber.rb:15:in `block in create'
[2015-02-08 09:48:55] ERROR  Actor crashed!

The error is repeated several times.

Am I doing something wrong?

I am on Mac OS X and use david 0.4.0.

nning commented 9 years ago

I could only try it in a OS X 10.9.5 VM (RUBY_PLATFORM also is x86_64-darwin13.0). Which version do you use? Originally, I tested on MRI versions 2.1.4 and newer. Now I installed 2.1.1 in my VM and everything works for me.

However, I changed the way socket options are set with setsockopt (from symbols to constants) and assume this should work now. I already closed the issue, feel free to reopen if it still does not work with the current master.

Thanks for reporting!