[#103241] [Ruby master Bug#17777] 2.6.7 fails to build on macOS: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 — eregontp@...
Issue #17777 has been reported by Eregon (Benoit Daloze).
17 messages
2021/04/05
[#103305] [Ruby master Feature#17785] Allow named parameters to be keywords — marcandre-ruby-core@...
Issue #17785 has been reported by marcandre (Marc-Andre Lafortune).
21 messages
2021/04/08
[#103342] [Ruby master Feature#17790] Have a way to clear a String without resetting its capacity — jean.boussier@...
Issue #17790 has been reported by byroot (Jean Boussier).
14 messages
2021/04/09
[#103388] [ANN] Multi-factor Authentication of bugs.ruby-lang.org — SHIBATA Hiroshi <hsbt@...>
Hello,
5 messages
2021/04/12
[#103414] Re: [ANN] Multi-factor Authentication of bugs.ruby-lang.org
— Martin J. Dürst <duerst@...>
2021/04/13
Is there a way to use this multi-factor authentication for (like me)
[#103547] List of CI sites to check — Martin J. Dürst <duerst@...>
Hello everybody,
4 messages
2021/04/22
[#103596] [Ruby master Feature#17830] Add Integer#previous and Integer#prev — rafasoaresms@...
Issue #17830 has been reported by rafasoares (Rafael Soares).
9 messages
2021/04/26
[ruby-core:103172] [Ruby master Bug#17643] Ruby 3 embedded - no GC methods?
From:
cfis@...
Date:
2021-04-02 08:39:02 UTC
List:
ruby-core #103172
Issue #17643 has been updated by cfis (Charlie Savage).
@nobu - Sorry that I missed your feedback.
I updated the code to call ruby_options, but that just hangs the interpreter. It thinks it is going to run a ruby script, but that is not correct. I have attached a screenshot of the call stack.
What I want to do is initialize the interpreter so I can later run code in it. As part of the initialization I'd like to set GC.stress to true.
I updated the embedding code to look like this (copied from Ruby's main function):
```c
int argc = 0;
char* argv = nullptr;
char** pArgv = &argv;
ruby_sysinit(&argc, &pArgv);
{
RUBY_INIT_STACK;
ruby_init();
ruby_run_node(ruby_options(argc, pArgv));
}
initialized__ = true; // <----- this is never called
```
That doesn't work. Could you point me in the direction of what does work? Thanks!
----------------------------------------
Bug #17643: Ruby 3 embedded - no GC methods?
https://bugs.ruby-lang.org/issues/17643#change-91245
* Author: cfis (Charlie Savage)
* Status: Rejected
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
The following code works on Ruby 2.x, but not on Ruby 3.0.0.
``` c
// Initialize Ruby VM
int argc = 0;
char* argv = (char*)malloc(1);
argv[0] = 0;
char** pArgv = &argv;
ruby_sysinit(&argc, &pArgv);
ruby_init();
ruby_init_loadpath();
// Try to call GC.start
int state;
VALUE result = rb_eval_string_protect("GC.start", &state);
VALUE err = rb_errinfo();
VALUE rubyMessage = rb_funcall(err, rb_intern("message"), 0);
char* message = RSTRING_PTR(rubyMessage);
message is "undefined method `start' for GC:Module"
```
This is true for all the GC methods (stop, stress, etc). Note if you create a Ruby script that contains GC.start and run it using the Ruby interpreter all is well.
Is there some new special way Ruby 3 needs to be embedded?
Note I tested this on mingw, MSVC and gcc (Fedora). All the same. Like I said above, this code works fine on Ruby 2.7 and earlier.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>