Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query ruby thread and GVL states instead of relying on our call frame for callbacks #584

Merged
merged 4 commits into from Jan 25, 2019

Commits on Jan 25, 2019

  1. Query ruby thread and GVL states instead of relying on our call frame…

    … for callbacks
    
    This fixes ffi#527 and other interoperability issues that can happen,
    when a callback is called without a valid call frame.
    
    The change is enabled for ruby-2.3+ only, since it requires the
    functions ruby_native_thread_p() and ruby_thread_has_gvl_p().
    
    The creation of a call frame is not (yet) removed, because
    it still carries callback expections around.
    larskanis committed Jan 25, 2019
    Copy the full SHA
    547cfee View commit details
    Browse the repository at this point in the history
  2. Add tests for calls between Fiddle and FFI

    This is particular interesting because FFI stores thread local call info
    on the stack, which is retrieved when a callback is received.
    This is something that Fiddle doesn't do, but a callback should be handled
    gracefully nevertheless.
    
    The test "from fiddle to ffi" fails without the previous commit.
    
    These tests succeed on MRI and on JRuby (provided
    jruby/jruby#4518 will be merged).
    larskanis committed Jan 25, 2019
    Copy the full SHA
    0a83b23 View commit details
    Browse the repository at this point in the history
  3. Add a test case for embedded ruby use and issue ffi#527

    Since the problem is a dead lock (inside pthread_cond_wait, on Linux), the test
    case has to spawn a separate process which can be killed on failure.
    kugel- authored and larskanis committed Jan 25, 2019
    Copy the full SHA
    544b721 View commit details
    Browse the repository at this point in the history
  4. Fix embed-test on Windows

    Windows doesn't resolve symbols of external DLLs, if called with
    CURRENT_PROCESS. Instead the DLL has to be named explicit.
    
    Add an expectation to the spec while being over it.
    larskanis committed Jan 25, 2019
    Copy the full SHA
    8ef745b View commit details
    Browse the repository at this point in the history