[#119132] Segfault using ruby C on MacOS (Intel Catalina and M2 Sonoma) — "martin.kufner--- via ruby-core" <ruby-core@...>
Hey guys,
4 messages
2024/09/12
[#119133] Re: Segfault using ruby C on MacOS (Intel Catalina and M2 Sonoma)
— "martin.kufner--- via ruby-core" <ruby-core@...>
2024/09/12
I just saw, that the #includes dont show up in the c file ...
[#119145] [Ruby master Misc#20728] Propose Eileen Uchitelle as a core committer — "kddnewton (Kevin Newton) via ruby-core" <ruby-core@...>
Issue #20728 has been reported by kddnewton (Kevin Newton).
14 messages
2024/09/12
[#119312] [Ruby master Bug#20762] `make test-basic` with -DRGENGC_FORCE_MAJOR_GC is always failure — "hsbt (Hiroshi SHIBATA) via ruby-core" <ruby-core@...>
Issue #20762 has been reported by hsbt (Hiroshi SHIBATA).
6 messages
2024/09/27
[ruby-core:119261] [Ruby master Feature#20750] Expose ruby_thread_has_gvl_p in ruby/thread.h
From:
"kbrock (Keenan Brock) via ruby-core" <ruby-core@...>
Date:
2024-09-19 16:39:39 UTC
List:
ruby-core #119261
Issue #20750 has been updated by kbrock (Keenan Brock).
File 0001-rb_thread_call_with_gvl-is-lenient-when-it-has-alrea.patch added
File 0002-Don-t-check-GVL-before-calling-into-with_gvl_callbac.patch added
Hello,
Here is the new proposed patch for your review.
https://github.com/ruby/ruby/pull/11649
I do not know if we try and keep changes as small as possible (to avoid introducing bugs)
Or if we refactor along the way.
----------------------------------------
Feature #20750: Expose ruby_thread_has_gvl_p in ruby/thread.h
https://bugs.ruby-lang.org/issues/20750#change-109850
* Author: kbrock (Keenan Brock)
* Status: Open
----------------------------------------
Hello All,
I'm hoping we can make `ruby_thread_has_gvl_p` a public method and no longer experimental.
I saw the following code in a gem that was not compiling with ruby 3.3:
``` c
// int ruby_thread_has_gvl_p(void); // <== line of concern
if (ruby_thread_has_gvl_p()) {
method_call(&context);
}
else {
rb_thread_call_with_gvl(method_call, &context);
}
```
400 unique projects on github added the line listed above to fix compilation. [1]
Some of the projects detected the method first in `extconf.rb`, but a majority just referenced it.
`ffi` used to have the detection code but dropped it since the method was in all supported ruby versions.
It feels like this method is now part of the undocumented public interface.
My suggestion is to add the method to the real public interface in `ruby/thread.h`.
PR with possible solution: https://github.com/ruby/ruby/pull/11619
Also included a patch if that is easier
Thank you for your consideration,
Keenan
Timeline:
- Dec 30 2008 - `rb_thread_call_with_gvl` introduced via 9c04a06 [2]
- Jan 12 2009 - `ruby_thread_has_gvl_p` introduced via 6f09fc2 [4]
- Jul 18 2012 - `rb_thread_call_with_gvl` made public via e9a91d2 [3]
Current references to code: `rb_thread_call_with_gvl` [5] `ruby_thread_has_gvl_p` [6]:
[1]: https://github.com/search?q=ruby_thread_has_gvl_p+language%3AC++NOT+is%3Afork++NOT+is%3Aarchived&type=code
[2]: https://github.com/ruby/ruby/commit/9c04a0647fb99f7554cb2e04385ddbb970631e02
[3]: https://github.com/ruby/ruby/commit/e9a91d2c95dfe22ad0487952f7a1053ef9a5fd16
[4]: https://github.com/ruby/ruby/commit/6f09fc2efd1915c4337ce6dded52a8a8771c3222
[5]: https://github.com/ruby/ruby/blob/master/thread.c#L1878
[6]: https://github.com/ruby/ruby/blob/master/thread.c#L1923
---Files--------------------------------
11618.patch (3.18 KB)
0001-rb_thread_call_with_gvl-is-lenient-when-it-has-alrea.patch (1.26 KB)
0002-Don-t-check-GVL-before-calling-into-with_gvl_callbac.patch (2.91 KB)
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/