-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Trying to run examples under XP #2
Comments
Thanks for reporting the issue! I think you found a bug in ffi-rzmq From what I can look up It looks like valloc is linux only. This is issue is likely from You could try uninstalling the ffi-rzmq gem removing that line, then building it from github (just run rake gem:package in the ffi-rzmq directory after you clone it off github, then install the custom gem from the pkg folder). Let me know how it goes, I don't have windows, so I can't test it myself. If that fixes it, try submitting a but to ffi-rzmq, chuck's good about fixes. |
Thanks for your tip, Andrew! Indeed, commenting out valloc and bcopy (as well as redefining :size_t) resolved this particular issue. Now, I've got to the point where I'm "Sending 1 Potato", but nothing comes out just yet. ;) I recall that trying your example on OSX under 1.9.1 got me the same result at first. But after I installed 1.9.2, example run on OSX. Under Windows, I have 1.9.2, but it's still stuck "Sending 1 Potato". Any suggestions how I can troubleshoot further? |
Glad I could help! Are you sure you're running the latest FFI lib built custom using the FFI gem from github? gem install ffi installs an old one with broken threading. It sounds like that's what you're hitting (receive will block ALL threads with the bad FFI). BTW, I've been running my ZMQ stuff under rubinius lately, works really well. |
Oh, also rubinius doesn't need the FFI gem installed, neither does jruby. |
OK, I now tried it with JRuby, and it worked! However, my target environment is WinXP/MRI, so I just have to make it work for 1.9.2. Yes, in my excitement I totally forgot about the need to install custom ffi gem (that's what stalled my progress on OSX too). Now, trying to install the gem that you have in your master failed to build native extensions under Windows/MRI 1.9.2p0: Y:\Dev\apps\win\learn-ruby-zeromq\gems>gem install *.gem C:/Dev/ruby/bin/ruby.exe extconf.rb make Gem files will remain installed in C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/ffi-0.6.3 for inspection. Trying to clone and install ffi HEAD from Github exploded with different trace: gem.bat install --local pkg/ffi-0.6.3 C:/Dev/ruby/bin/ruby.exe extconf.rb make Gem files will remain installed in C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/ffi-0.6.3 for inspection. Any idea what may be wrong with this? |
Hmm, not quite sure. Maybe try the FFI guys see what they say? Not sure if this is feasible, but rubinius probably would have fewer issues, and is mostly MRI compatible these days. |
Just installed ffi gem from your master under Cygwin (Guthub HEAD still won't build) and got Potatoes sent and received under Cygwin/MRI 1.9.2 now. So, now the only problematic environment that remains is plain WinXP/MRI 1.9.2, which unfortunately is my target. This still fails since both your ffi gem and github HEAD fail to build, with different backtraces. Since the root cause seems to be FFI gem, I'm off to bug FFI guys about it. ;) Thanks for all your help and also helpful examples that I'm sure to follow once I've bent my target environment into submission! |
So far I had no success setting up environment to run your examples under Windows XPSP3 (32bit). I have successfully built zeromq-2.0.10 - with Visual Studio from Windows package and from sources under Cygwin. So, I have zeromq library working and in path.
Here are the Rubies that I tried (since it is indicated that either JRuby or 1.9.2 are adequate, I only tried those):
Ruby 1.9.2-p0 (Rubyinstaller)
JRuby 1.5.2
Ruby 1.9.2-p0 (built from source under Cygwin)
Unfortunately, trying to run example from https://github.com/andrewvc/learn-ruby-zeromq/ fails with a following trace:
Y:\Dev\apps\win\learn-ruby-zeromq\001_Socket_Types>jruby -v
jruby 1.5.2 (ruby 1.8.7 patchlevel 249) (2010-08-20 1c5e29d) (Java HotSpot(TM) Client VM 1.6.0_20) [x86-java]
Y:\Dev\apps\win\learn-ruby-zeromq\001_Socket_Types>gem list
columnize (0.3.1)
ffi (0.6.3)
ffi-rzmq (0.6.0)
rake (0.8.7)
rspec (1.3.0)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3.2)
sources (0.0.1)
zmqmachine (0.3.2)
Y:\Dev\apps\win\learn-ruby-zeromq\001_Socket_Types>jruby 001_push_pull.rb
C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/site_ruby/shared/ffi/ffi.rb:112:in
create_invoker': Function 'valloc' not found in [msvcrt] (FFI::NotFoundError) from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/site_ruby/shared/ffi/library.rb:98:in
attach_function'from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/site_ruby/shared/ffi/library.rb:96:in
each' from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/site_ruby/shared/ffi/library.rb:96:in
attach_function'from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/gems/1.8/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq/wrapper.rb:11
from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/gems/1.8/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq/wrapper.rb:31:in
require' from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/gems/1.8/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq.rb:71
from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/gems/1.8/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq.rb:70:in
each' from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/gems/1.8/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq.rb:70 from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/gems/1.8/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq.rb:36:in
require'from C:/Documents and Settings/bezrodnykh/.pik/rubies/JRuby-152/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from 001_push_pull.rb:2
$ ruby -v
ruby 1.9.2dev (2009-07-18 trunk 24186) [i386-cygwin]
$ gem list
ffi (0.6.3)
ffi-rzmq (0.6.0)
rake (0.8.7)
rubygems-update (1.3.7)
zmqmachine (0.3.2)
vb@vb-mac /y/dev/apps/win/learn-ruby-zeromq/001_Socket_Types
'$ ruby 001_push_pull.rb
/home/bezrodnykh/.rvm/gems/ruby-1.9.2-preview1/gems/ffi-0.6.3/lib/ffi/library.rb:129:in
attach_function': Function 'valloc' not found in [msvcrt.dll] (FFI::NotFoundError) from /home/bezrodnykh/.rvm/gems/ruby-1.9.2-preview1/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq/wrapper.rb:11:in
module:LibC'from /home/bezrodnykh/.rvm/gems/ruby-1.9.2-preview1/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq/wrapper.rb:3:in
<top (required)>' from /home/bezrodnykh/.rvm/gems/ruby-1.9.2-preview1/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq.rb:71:in
require'from /home/bezrodnykh/.rvm/gems/ruby-1.9.2-preview1/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq.rb:71:in
block in <top (required)>' from /home/bezrodnykh/.rvm/gems/ruby-1.9.2-preview1/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq.rb:70:in
each'from /home/bezrodnykh/.rvm/gems/ruby-1.9.2-preview1/gems/ffi-rzmq-0.6.0/lib/ffi-rzmq.rb:70:in
<top (required)>' from 001_push_pull.rb:2:in
require'from 001_push_pull.rb:2:in `
Any advice/suggestion/hint to help me moving forward?
The text was updated successfully, but these errors were encountered: