JRuby FFI::Library#callback typo?

Segfault on MRI using stdcall callbacks has been traced to outdated
FFI::Library#callback code as worked here

http://groups.google.com/group/ruby-ffi/browse_thread/thread/1712f5507b15b467

…with the updated “callback” code tested with

Looking at line 142 of

http://github.com/jruby/jruby/blob/master/lib/ruby/site_ruby/shared/ffi/library.rb

it appears that the options hash needs to be passed to
FFI::CallbackInfo.new in order for the calling convention to be able to
be set to something besides :default.

Typo?

Jon


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Wed, Dec 16, 2009 at 8:53 AM, Jon [email protected] wrote:

it appears that the options hash needs to be passed to FFI::CallbackInfo.new in order for the calling convention to be able to be set to something besides :default.

Typo?

Yeah, looks that way. We really should be sharing the FFI Ruby bits
better so we can fix bugs like this in one place. I’m not sure how
that sharing is happening right now.

So do we need a bug filed for this or what?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Wed, 16 Dec 2009 11:11:51 -0600
Charles Oliver N. [email protected] wrote:

  • Charlie
    I’d have filed a bug already except for one small thing.

I originally saw the failure on MRI 1.9.1 and 1.8.6 but not on JRuby
1.4.0 which has the old FFI::Library#callback but didn’t cause a
segfault. Weird as I’d expect something as fundamental as getting
calling convention wrong for a function would blow up everywhere.

While the JRuby’s current master version for callback seems wrong due to
not passing the options hash, I think the failure needs to be confirmed
with both 1.4.0 and latest master before saying it’s a bug for JRuby. I
wish I had more time to check into it. Sorry.

Jon


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I’d have filed a bug already except for one small thing.

I originally saw the failure on MRI 1.9.1 and 1.8.6 but not on JRuby 1.4.0 which has the old FFI::Library#callback but didn’t cause a segfault. Weird as I’d expect something as fundamental as getting calling convention wrong for a function would blow up everywhere.

While the JRuby’s current master version for callback seems wrong due to not passing the options hash, I think the failure needs to be confirmed with both 1.4.0 and latest master before saying it’s a bug for JRuby. I wish I had more time to check into it. Sorry.

I’ll file a bug if needed if only just for tracking purposes so it
doesn’t get lost in a ML post. Let me know what you want.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Jon,

On Wed, Dec 16, 2009 at 6:43 PM, Jon [email protected] wrote:

I’ll file a bug if needed if only just for tracking purposes so it doesn’t get lost in a ML post. Let me know what you want.

I’d say, go for it! It’s much easier to close the bug later on if
needed rather then to remember one particular mail thread with the bug
description! :slight_smile:

If in doubt, file bugs - that’s my motto. :slight_smile: That way, no information
would be lost.

Thanks,
–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

If in doubt, file bugs - that’s my motto. :slight_smile: That way, no information
would be lost.

http://jira.codehaus.org/browse/JRUBY-4362


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email