Comments (2)
Nevermind, I just noticed that my box has 1.9.2 and not 1.9.3. Sorry :-)
from celluloid-io.
First, nit-pick: Ruby makes your life easy:
255.times do
...
end
As for your actual issue, what happens when you use threads and normal ruby
sockets?
Regards,
Ben Langfeld
On 19 September 2012 15:11, Florian Weingarten [email protected]:
Hey guys! When I run the following code:
#!/usr/bin/ruby1.9.1
require 'rubygems'
require 'celluloid/io'class Client
include Celluloid::IO
def initialize(host, port) @socket = TCPSocket.new(host, port) end
def read() @socket.readpartial(100) end
endfor i in 0..255 do
client = Client.new("127.0.0.1", 1234)
puts client.read()
endI get a segfault:
/var/lib/gems/1.9.1/gems/celluloid-io-0.12.0/lib/celluloid/io/reactor.rb:16: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]-- control frame ----------
c:0020 p:---- s:0060 b:0060 l:000059 d:000059 CFUNC :(null)
c:0019 p:---- s:0058 b:0058 l:000057 d:000057 CFUNC :new
c:0018 p:0019 s:0055 b:0055 l:000054 d:000054 METHOD /var/lib/gems/1.9.1/gems/celluloid-io-0.12.0/lib/celluloid/io/reactor.rb:16
c:0017 p:---- s:0052 b:0052 l:000051 d:000051 FINISH
c:0016 p:---- s:0050 b:0050 l:000049 d:000049 CFUNC :new
c:0015 p:0051 s:0047 b:0047 l:000046 d:000046 METHOD /var/lib/gems/1.9.1/gems/celluloid-io-0.12.0/lib/celluloid/io/mailbox.rb:10
c:0014 p:---- s:0043 b:0043 l:000042 d:000042 FINISH
c:0013 p:---- s:0041 b:0041 l:000040 d:000040 CFUNC :new
c:0012 p:0011 s:0038 b:0038 l:001750 d:000037 BLOCK /var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:142
c:0011 p:---- s:0036 b:0036 l:000035 d:000035 FINISH
c:0010 p:---- s:0034 b:0034 l:000033 d:000033 CFUNC :call
c:0009 p:0025 s:0031 b:0031 l:000030 d:000030 METHOD /var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:171
c:0008 p:0013 s:0028 b:0027 l:000026 d:000026 METHOD /var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:182
c:0007 p:0025 s:0024 b:0022 l:000021 d:000021 METHOD /var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:78
c:0006 p:0025 s:0016 b:0016 l:002688 d:000015 BLOCK ./client.rb:13
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 FINISH
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :each
c:0003 p:0044 s:0008 b:0008 l:002688 d:000c58 EVAL ./client.rb:12
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISHc:0001 p:0000 s:0002 b:0002 l:002688 d:002688 TOP
-- Ruby level backtrace information ----------------------------------------
./client.rb:12:in<main>' ./client.rb:12:in
each'
./client.rb:13:inblock in <main>' /var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:78:in
new'
/var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:182:inactor_options' /var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:171:in
mailbox_factory'
/var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:171:incall' /var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:142:in
block in mailbox_class'
/var/lib/gems/1.9.1/gems/celluloid-0.12.0/lib/celluloid.rb:142:innew' /var/lib/gems/1.9.1/gems/celluloid-io-0.12.0/lib/celluloid/io/mailbox.rb:10:in
initialize'
/var/lib/gems/1.9.1/gems/celluloid-io-0.12.0/lib/celluloid/io/mailbox.rb:10:innew' /var/lib/gems/1.9.1/gems/celluloid-io-0.12.0/lib/celluloid/io/reactor.rb:16:in
initialize'
/var/lib/gems/1.9.1/gems/celluloid-io-0.12.0/lib/celluloid/io/reactor.rb:16:in `new'
zsh: segmentation fault ./client.rbWhen I change 255 to 254, everything works as expected.
Am I missing something or is this is a bug?
Thanks!
Flo—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26.
from celluloid-io.
Related Issues (20)
- Test suite timeouts revamp.
- C::IO::TCPSocket.new dies with IO::EAGAINWaitReadable on JRuby v9.0.3.0. HOT 12
- [Feature request] Access to socket option within UDPSocket and TCPSocket HOT 3
- "it shouldn't crash" crashes HOT 2
- Celluloid::IO behaves like a Celluloid Actor failures HOT 24
- #wait_readable and #wait_writable have different signature than the ruby methods HOT 3
- bundle install fails, missing culture/sync
- Establishing a connection in TCPSocket is not happening asynchronously HOT 2
- server-side closing of an SSLSocket doesn't cause an event HOT 1
- Does it work with ruby 2.1, 2.2, 2.3? HOT 1
- Provide an actor-level select which can accept multiple sockets
- Rubinius crashes with IO::EINPROGRESSWaitWritable when opening Celluloid::IO::TCPSocket
- tests fail randomly (about 28% of times) HOT 2
- Not bundling with ruby < 2.2 HOT 6
- strange behavour with encoding bytes in examples HOT 2
- Review of net-http-celluloid-io gem modifications HOT 2
- Run celluloid backported mode.
- test fail of actor_spec
- help with server-side disconnects in slack-ruby-client HOT 6
- Resolv::ResolvError: DNS result has no information for ... under load HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from celluloid-io.