Possible ffi issue on windows - exposed via LibZMQ.zmq_term using ffi-rzmq gem
------------------------------------------------------------------------------

                 Key: JRUBY-6095
                 URL: https://jira.codehaus.org/browse/JRUBY-6095
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.6.4
         Environment: jruby 1.6.4 (ruby-1.9.2-p136) (2011-08-23 17ea768) (Java 
HotSpot(TM) Client VM 1.6.0_21) [Windows XP-x86-java]
            Reporter: Patrik Sundberg
            Assignee: Thomas E Enebo
         Attachments: libzmq.dll

Easy way to replicate is to run examples\v2api\local_lat.rb and 
remote_lat.rb.Neither server not client close down correctly. It uses a 
finalizer to destroy the zmq context and if I stick in some tracer code there I 
can see it never returns from that call.

Every once in a blue moon it does however finish properly on the client side 
(remote_lat.rb), but not reproducible from what I can tell.

Taking a thread dump I see this for the main thread:

"main" prio=6 tid=0x00a87800 nid=0x1864 runnable [0x0022d000]
   java.lang.Thread.State: RUNNABLE
        at com.kenai.jffi.Foreign.invokeIrI(Native Method)
        at com.kenai.jffi.Invoker.invokeIrI(Invoker.java:106)
        at 
org.jruby.ext.ffi.jffi.FastIntPointerMethodOneArg.invoke(FastIntPointerMethodOneArg.java:26)
        at 
org.jruby.ext.ffi.jffi.FastIntPointerMethodOneArg.call(FastIntPointerMethodOneArg.java:44)
        at 
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
        at 
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
        at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
        at org.jruby.ast.IfNode.interpret(IfNode.java:119)
        at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
        at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
        at 
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
        at 
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:328)
        at org.jruby.runtime.BlockBody.call(BlockBody.java:73)
        at org.jruby.runtime.Block.call(Block.java:89)
        at org.jruby.RubyProc.call(RubyProc.java:274)
        at org.jruby.RubyProc.call(RubyProc.java:229)
        at org.jruby.RubyProc$i$0$0$call.call(RubyProc$i$0$0$call.gen:65535)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:211)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:207)
        at org.jruby.RubyClass.finvoke(RubyClass.java:686)
        at 
org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:548)
        at 
org.jruby.RubyBasicObject$Finalizer.callFinalizer(RubyBasicObject.java:1984)
        at 
org.jruby.RubyBasicObject$Finalizer.finalize(RubyBasicObject.java:1974)
        at org.jruby.Ruby.tearDown(Ruby.java:2761)
        - locked <0x1dc6f1c0> (a java.lang.Object)
        at org.jruby.Ruby.tearDown(Ruby.java:2726)
        at org.jruby.Main.internalRun(Main.java:201)
        at org.jruby.Main.run(Main.java:164)
        at org.jruby.Main.run(Main.java:148)
        at org.jruby.Main.main(Main.java:128)

   Locked ownable synchronizers:
        - None


I'm not sure how to debug this. Given I can find no mentions of this elsewhere 
I assume this works on linux/osx, so thinking potentially related to FFI on 
windows in some way.

Attaching the libzmq.dll needed to use the gem on windows (ffi-rzmq). Apart 
from shutdown the gem seem to work just fine on windows from some light 
testing. Invoking the same functions in a C program linked to same DLL works 
fine.

Let me know if I can help out more in figuring this out. I'd really like some 
jruby windows zeromq clients.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to