Subject:
[ruby-ffi] Re: Null Pointer Issue? Am I Racing with the Garbage Collector?
From:
Scott Gonyea
Date:
11/12/10 1:01 AM
To:
ruby-ffi

Strange.  I replied in my e-mail, but it didn't post.  Hoping it
wasn't plugged up in Google somewhere.  Here's what I wrote:

I'm pretty sure it does.  I ran into another issue, while using the
FFI from Github:

https://gist.github.com/673816

I'm checking the values, all along the way, and I'm not handing it any
nils, but it won't believe me. The ffi 0.6.3 gem won't complain about
this (but it will blow up at a few spots).

Sigh :(  Thank you very much, for your help.

Scott

On Nov 11, 10:21 pm, Wayne Meissner <wmeiss...@gmail.com> wrote:
> Thats interesting.
>
> Does curl use threads internally?  If so, build the ffi gem from
> github and try that.  Earlier versions don't deal well with callbacks
> coming from non-ruby threads.
>
> Also try running it with JRuby.  It handles threads a lot better.
>
> On 12 November 2010 15:25, Scott Gonyea <gon...@gmail.com> wrote:
>
>
>
> >https://gist.github.com/673753
>
> > That will show you the script I'm running, the gdb backtrace, and ruby-
> > prof (if that helps at all).  I basically was benchmarking my library
> > with the one I started branching from.  It's all good, until I start
> > running a whole lot of iterations.  I made some changes, which seems
> > to have made it less frequent... until I up the number of iterations.
>
> >https://github.com/aitrus/curl_ffi/commit/99a231aea24b2d7d63bccaa5c23...
>
> > That was the one fix.  This GSolr junk of mine uses StreamlyFFI and
> > CurlFFI:
>
> > StreamlyFFI:https://github.com/aitrus/streamly_ffi
> > CurlFFI:https://github.com/aitrus/curl_ffi
>
> > Scott