-
Notifications
You must be signed in to change notification settings - Fork 188
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
oj: pthread_mutex_init is unsupported! #1566
Comments
@deepj Thank you for the report, I filed GR-13707 internally for the Sulong team to resolve this. |
@eregon Any news with this? Since the report is not public so I'm asking. |
I think Sulong aren't planning |
@ohler55 ^^ maybe interesting for you |
For historical reasons or just because I'm familiar with pthread. At once point pthreads had less overhead but that was many years ago. |
I was excited to see how well you ran oj because you site says 3.7 is running 98.90% tests pass of the oj test suite: https://www.graalvm.org/docs/reference-manual/compatibility/#oj It immediately hit this issue locally for me. Is there some way you work around this to test oj? Seems like your results would be 0% otherwise. |
I think the immediate answer is that |
@chrisseaton Just to let you know more details I am on fedora core 29 and I just did a gem install oj --version 3.7.12 (3.8 is out but I hit this and realized you advertised running on 3.7). If you test system does not have libpthread then it sets HAVE_LIBPTHREAD false/undefined and compiles with out it? That is why it works there but fails on my system. I did I understand that correctly? |
It looks more like the configuration test fails and so doesn't set the feature flag.
|
Does truffle have a pthread library or an alternative that supports a mutex of some type? I'd be glad to make changes to improve support. |
This is a bit of a silly issue really - we could easily implement our own |
Sure. Also need to know how to detect truffle is in use or at least some macro. |
I'll put together some notes and get back to you. You'd need to sign the OCA https://www.oracle.com/technetwork/community/oca-486395.html. |
Signed and returned. |
I just remembered, there is a C API for this: rb_nativethread_lock_* functions in
This might be the easiest way. |
I think you are right, that might be the easiest way to move forward. |
On further digging it looks like the issue may be the macro Oj uses to detect the existence of pthread. I changed the |
@ohler55 |
Is there any way of determining truffle is in use? I can special case truffle but I need to know how to detect it. |
@ohler55 The But we'd rather avoid TruffleRuby-specific code in gems if possible. |
I prefer not having Truffle specific code as well but since the normal way of detecting function existence returns the wrong answer I don't see a way around it at this point other than always using the ruby mutex. I'll run some benchmarks to see what impact that has on performance. |
@ohler55 I'm working on a fix to let |
Great. I'll sit tight then. |
The next error once
Which is something we need to fix by either allowing RARRAY_PTRs to go native or finding another way to pass arguments to C extension functions taking |
On the upside, if I do allow RARRAY_PTRs to go native in a quick-and-dirty way just for this case, it does work:
|
@eregon Any idea why you would see that error when you pass 98.8% of the specs in the gem tester? It looks like @chrisseaton was able to run all the tests above (maybe something changed recently in oj source?). |
@enebo I think the output above is actually from the run of the module tester.
So I'd guess it's miscounted in this case, and somehow the tests were skipped with a failed |
@eregon ah ok yeah it does run MRI json tests. Mystery solved! |
Err I should say it runs its tests on builtin json I think to make sure both oj and MRI passes the same set of stuff for json compatibility. |
I think we can fix things to allow
There's a few other minor details that need to be handled (such as finding adjacent objects for |
Support for native We'll try to get nightly builds (#1483), so we can test TruffleRuby in oj's CI before the 20.0 release. |
After solving several issues in #1437 there is a new one
This is reproducible on TruffleRuby 1.0.0 RC12
To reproduce:
Error:
The text was updated successfully, but these errors were encountered: