[ruby-talk:443047] Dir.glob not accessible from CRuby or stand alone apps

Greetings!

I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and quickly
noticed that whenever I called Dir.glob via a CRuby rb_funcall function
call, it immediately caused a segfault. Later on I discovered by checking
the Dir class official documentation that all of the 3.x series now call
some mysterious Primitive constant instead of relying directly on a CRuby
function to perform the task. Here is a small extract of the official
documentation:

# File dir.rb, line 133
def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true)
  Primitive.dir_s_glob(pattern, flags, base, sort)
end

I've always failed to use Primitive in my Ruby test code. Ruby cannot find
it anywhere.

Calling Dir.glob in an IRB sessions works fine as well as running a Ruby
test code on a machine that has Ruby already installed there.

Now I have to ask you guys if you know how we are supposed to call Dir#glob
and Dir# methods from stand alone apps without asking our target
customers to install Ruby on their machines.

Thank you in advance for any assistance!

Kyonides

I think that this would be excellent to open as a ticket at
bugs.ruby-lang.org.

-a

···

On Wed, Oct 12, 2022 at 4:46 PM kyonides eupator <kyonides@gmail.com> wrote:

Greetings!

I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and quickly
noticed that whenever I called Dir.glob via a CRuby rb_funcall function
call, it immediately caused a segfault. Later on I discovered by checking
the Dir class official documentation that all of the 3.x series now call
some mysterious Primitive constant instead of relying directly on a CRuby
function to perform the task. Here is a small extract of the official
documentation:

# File dir.rb, line 133
def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true)
  Primitive.dir_s_glob(pattern, flags, base, sort)
end

I've always failed to use Primitive in my Ruby test code. Ruby cannot find
it anywhere.

Calling Dir.glob in an IRB sessions works fine as well as running a Ruby
test code on a machine that has Ruby already installed there.

Now I have to ask you guys if you know how we are supposed to call
Dir#glob and Dir# methods from stand alone apps without asking our target
customers to install Ruby on their machines.

Thank you in advance for any assistance!

Kyonides

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

Believe me when I tell you that I tried to submit a bug ticket concerning
the Dir.glob issue in stand alone apps but bugs.ruby-lang.org double factor
authentication feature kept telling me that Google Authenticator's codes
were invalid or had expired. I tried it over 20 times in a row to no avail.
:frowning:

···

On Wed, Oct 12, 2022, 15:33 Austin Ziegler <halostatue@gmail.com> wrote:

I think that this would be excellent to open as a ticket at
bugs.ruby-lang.org.

-a

On Wed, Oct 12, 2022 at 4:46 PM kyonides eupator <kyonides@gmail.com> > wrote:

Greetings!

I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and quickly
noticed that whenever I called Dir.glob via a CRuby rb_funcall function
call, it immediately caused a segfault. Later on I discovered by checking
the Dir class official documentation that all of the 3.x series now call
some mysterious Primitive constant instead of relying directly on a CRuby
function to perform the task. Here is a small extract of the official
documentation:

# File dir.rb, line 133
def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true)
  Primitive.dir_s_glob(pattern, flags, base, sort)
end

I've always failed to use Primitive in my Ruby test code. Ruby cannot
find it anywhere.

Calling Dir.glob in an IRB sessions works fine as well as running a Ruby
test code on a machine that has Ruby already installed there.

Now I have to ask you guys if you know how we are supposed to call
Dir#glob and Dir# methods from stand alone apps without asking our target
customers to install Ruby on their machines.

Thank you in advance for any assistance!

Kyonides

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

*Nominally*, you should also be able to subscribe to `
ruby-core@ruby-lang.org` and open a ticket that way.

I’ve had issues with the mailing-list to bugs bridge, but the bugs to
mailing-list works perfectly.

-a

···

On Wed, Oct 12, 2022 at 5:50 PM kyonides eupator <kyonides@gmail.com> wrote:

Believe me when I tell you that I tried to submit a bug ticket concerning
the Dir.glob issue in stand alone apps but bugs.ruby-lang.org double
factor authentication feature kept telling me that Google Authenticator's
codes were invalid or had expired. I tried it over 20 times in a row to no
avail. :frowning:

On Wed, Oct 12, 2022, 15:33 Austin Ziegler <halostatue@gmail.com> wrote:

I think that this would be excellent to open as a ticket at
bugs.ruby-lang.org.

-a

On Wed, Oct 12, 2022 at 4:46 PM kyonides eupator <kyonides@gmail.com> >> wrote:

Greetings!

I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and quickly
noticed that whenever I called Dir.glob via a CRuby rb_funcall function
call, it immediately caused a segfault. Later on I discovered by checking
the Dir class official documentation that all of the 3.x series now call
some mysterious Primitive constant instead of relying directly on a CRuby
function to perform the task. Here is a small extract of the official
documentation:

# File dir.rb, line 133
def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true)
  Primitive.dir_s_glob(pattern, flags, base, sort)
end

I've always failed to use Primitive in my Ruby test code. Ruby cannot
find it anywhere.

Calling Dir.glob in an IRB sessions works fine as well as running a Ruby
test code on a machine that has Ruby already installed there.

Now I have to ask you guys if you know how we are supposed to call
Dir#glob and Dir# methods from stand alone apps without asking our target
customers to install Ruby on their machines.

Thank you in advance for any assistance!

Kyonides

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

Believe me when I tell you that I tried to submit a bug ticket concerning the Dir.glob issue in stand alone apps but bugs.ruby-lang.org double factor authentication feature kept telling me that Google Authenticator's codes were invalid or had expired. I tried it over 20 times in a row to no avail. :frowning:

Please file your issue to Issues · ruby/b.r-l.o · GitHub

I can reset your 2fa status or password.
But I couldn't find the pre-registration status of
`kyonides@gmail.com` from bugs.ruby-lang.org.

···

On Thu, Oct 13, 2022 at 6:50 AM kyonides eupator <kyonides@gmail.com> wrote:

Believe me when I tell you that I tried to submit a bug ticket concerning the Dir.glob issue in stand alone apps but bugs.ruby-lang.org double factor authentication feature kept telling me that Google Authenticator's codes were invalid or had expired. I tried it over 20 times in a row to no avail. :frowning:

On Wed, Oct 12, 2022, 15:33 Austin Ziegler <halostatue@gmail.com> wrote:

I think that this would be excellent to open as a ticket at bugs.ruby-lang.org.

-a

On Wed, Oct 12, 2022 at 4:46 PM kyonides eupator <kyonides@gmail.com> wrote:

Greetings!

I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and quickly noticed that whenever I called Dir.glob via a CRuby rb_funcall function call, it immediately caused a segfault. Later on I discovered by checking the Dir class official documentation that all of the 3.x series now call some mysterious Primitive constant instead of relying directly on a CRuby function to perform the task. Here is a small extract of the official documentation:

# File dir.rb, line 133
def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true)
  Primitive.dir_s_glob(pattern, flags, base, sort)
end

I've always failed to use Primitive in my Ruby test code. Ruby cannot find it anywhere.

Calling Dir.glob in an IRB sessions works fine as well as running a Ruby test code on a machine that has Ruby already installed there.

Now I have to ask you guys if you know how we are supposed to call Dir#glob and Dir# methods from stand alone apps without asking our target customers to install Ruby on their machines.

Thank you in advance for any assistance!

Kyonides

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and quickly
noticed that whenever I called Dir.glob via a CRuby rb_funcall function
call, it immediately caused a segfault.

Do you have the code demonstrating the problem?

Later on I discovered by checking the Dir class official documentation
that all of the 3.x series now call some mysterious Primitive constant
instead of relying directly on a CRuby function to perform the task.

  MRI defines most of built-in classes in C with C-APIs like
  rb_define_method(). However, there are several issues using
  C-APIs. A few methods are defined in Ruby written in prelude.rb.
  However, we can not define all of classes because we can not touch
  deep data structure in Ruby. Furthermore, there are performance
  issues if we write all of them in Ruby. To solve this situation,
  I want to suggest written in Ruby with C intrinsic functions. To
  define built-in methods, introduce special Ruby syntax
  __intrinsic__.func(args). In this case, registered intrinsic
  function func() is called with args.

  To introduce Guild, I want to pass a "context" parameter (as a
  first parameter) for each C-functions like mrb_state on mruby.
  This is because getting it from TLS (Thread-local-storage)
  is high-cost operation on dynamic library (libruby).

  We have very a similar mechanism in TruffleRuby, inherited from
  Rubinius, which is called "primitives" (ala Smalltalk). It looks
  like this: TrufflePrimitive.weakref_set_object(self, obj)

  I think this an opportunity to standardize the syntax for
  "primitives"/"intrinsics". No matter the implementation language,
  it seems the concept of "primitives"/"intrinsics" is universal. A
  common syntax for intrinsics/primitives would allow to share
  Ruby code for core classes using these intrinsics/primitives.

  I have no preference on whether it should be called "primitive"
  or "builtin", but can we at least make the naming consistent?

# File dir.rb, line 133
def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true)
  Primitive.dir_s_glob(pattern, flags, base, sort)
end

MRI implementation in compile.c intercepts the ruby Primitive.func()
call and calls the underlying C function with an execution context
arg prepended:

static VALUE
dir_s_glob(rb_execution_context_t *ec, VALUE obj, VALUE str, VALUE
rflags, VALUE base, VALUE sort)

···

On 10/12/22, kyonides eupator <kyonides@gmail.com> wrote:

Of course, I do have it, Mr. Cameron.

// main.cpp - Dir#glob Execution Test

#include <stdio.h>
#include <ruby.h>
#include <ruby/io.h>

#define str(s) rb_str_new_cstr(s)

int raise_error(int state, const char* str)
{
  printf("Exit status: %i (%s)\n", state, str);
  VALUE exc = rb_errinfo();
  rb_exc_raise(exc);
  ruby_cleanup(0);
  return state;
}

int main(int argc, char **argv)
{
  int rargc = 0, state = 0;
  char **rargv = 0;
  ruby_sysinit(&rargc, &rargv);
  ruby_setup();
  VALUE rversion = rb_const_get(rb_cObject, rb_intern("RUBY_VERSION"));
  rb_funcall(Qnil, rb_intern("print"), 1, str("Ruby version: "));
  rb_p( rversion );
  rb_funcall(Qnil, rb_intern("puts"), 1,
             str("Get working directory:"));
  rb_p( rb_funcall(rb_cDir, rb_intern("getwd"), 0) );
  const char *mk_dir = "Dir.mkdir('tmp') unless Dir.exist?('tmp')";
  const char *is_tmp = "puts Dir.exist?('tmp')";
  const char *glob = "puts Dir.glob('*.h') rescue puts 'Rescued glob!'";
  const char *entries = "puts Dir.entries('tmp') rescue puts 'Rescued
entries!'";
  const char *rm_dir = "Dir.rmdir('tmp')";
  rb_eval_string_protect(mk_dir, &state);
  if (state) return raise_error(1, "mkdir");
  rb_funcall(Qnil, rb_intern("print"), 1,
             str("Does the 'tmp' directory exist? "));
  rb_eval_string_protect(is_tmp, &state);
  if (state) return raise_error(2, "is_tmp");
  rb_eval_string_protect(glob, &state);
  if (state) return raise_error(3, "glob");
  rb_eval_string_protect(entries, &state);
  if (state) return raise_error(4, "entries");
  rb_eval_string_protect(rm_dir, &state);
  if (state) return raise_error(5, "rmdir");
  rb_funcall(Qnil, rb_intern("print"), 1,
             str("Does the 'tmp' directory still exist? "));
  rb_eval_string_protect(is_tmp, &state);
  if (state) return raise_error(6, "is_tmp");
  ruby_cleanup(0);
  return 0;
}

If I had not rescued both glob AND entries methods in the code above, it
would have segfaulted in no time.

Kyonides

···

On Wed, Oct 12, 2022 at 4:58 PM Frank J. Cameron <fjc@fastmail.net> wrote:

On 10/12/22, kyonides eupator <kyonides@gmail.com> wrote:
> I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and quickly
> noticed that whenever I called Dir.glob via a CRuby rb_funcall function
> call, it immediately caused a segfault.

Do you have the code demonstrating the problem?

> Later on I discovered by checking the Dir class official documentation
> that all of the 3.x series now call some mysterious Primitive constant
> instead of relying directly on a CRuby function to perform the task.

Feature #16254: MRI internal: Define built-in classes in Ruby with `__intrinsic__` syntax - Ruby master - Ruby Issue Tracking System

        MRI defines most of built-in classes in C with C-APIs like
        rb_define_method(). However, there are several issues using
        C-APIs. A few methods are defined in Ruby written in prelude.rb.
        However, we can not define all of classes because we can not touch
        deep data structure in Ruby. Furthermore, there are performance
        issues if we write all of them in Ruby. To solve this situation,
        I want to suggest written in Ruby with C intrinsic functions. To
        define built-in methods, introduce special Ruby syntax
        __intrinsic__.func(args). In this case, registered intrinsic
        function func() is called with args.

        To introduce Guild, I want to pass a "context" parameter (as a
        first parameter) for each C-functions like mrb_state on mruby.
        This is because getting it from TLS (Thread-local-storage)
        is high-cost operation on dynamic library (libruby).

        We have very a similar mechanism in TruffleRuby, inherited from
        Rubinius, which is called "primitives" (ala Smalltalk). It looks
        like this: TrufflePrimitive.weakref_set_object(self, obj)

        I think this an opportunity to standardize the syntax for
        "primitives"/"intrinsics". No matter the implementation language,
        it seems the concept of "primitives"/"intrinsics" is universal. A
        common syntax for intrinsics/primitives would allow to share
        Ruby code for core classes using these intrinsics/primitives.

        I have no preference on whether it should be called "primitive"
        or "builtin", but can we at least make the naming consistent?

> # File dir.rb, line 133
> def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true)
> Primitive.dir_s_glob(pattern, flags, base, sort)
> end

MRI implementation in compile.c intercepts the ruby Primitive.func()
call and calls the underlying C function with an execution context
arg prepended:

static VALUE
dir_s_glob(rb_execution_context_t *ec, VALUE obj, VALUE str, VALUE
rflags, VALUE base, VALUE sort)

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Thanks for the code :slight_smile: I shortened it a bit to just show the problem:

#include <ruby.h>
#define str(s) rb_str_new_cstr(s)

int main(int argc, char **argv)
{
  int rargc = 0, state = 0;
  char **rargv = 0;
  ruby_sysinit(&rargc, &rargv);
  ruby_setup();
  VALUE rversion = rb_const_get(rb_cObject, rb_intern("RUBY_VERSION"));
  rb_funcall(Qnil, rb_intern("print"), 1, str("Ruby version: "));
  rb_p( rversion );

  rb_p( str("before glob") );
  rb_eval_string("p Dir.glob('*.h')");
  rb_p( str("after glob") );

  ruby_cleanup(0);
  return 0;
}

Results:

$ ./a.out-2.5
Ruby version: "2.5.8"
"before glob"

"after glob"

$ ./a.out-2.6
Ruby version: "2.6.9"
"before glob"

"after glob"

$ ./a.out-2.7
Ruby version: "2.7.6"
"before glob"

"after glob"

$ ./a.out-3.0
Ruby version: "3.0.4"
"before glob"
ruby: [BUG] Segmentation fault at 0x0000000000000018
...

$ ./a.out-3.1
Ruby version: "3.1.2"
"before glob"
ruby: [BUG] Segmentation fault at 0x0000000000000018
...

Looks good, except for the segfaults. XD Still, there's something missing
there. You see, Dir#entries also fails to find the temporary directory temp
that the very same Dir.mkdir created in my original code. :frowning:

By the way, I made sure my account kyonides could be found in
bugs.ruby-lang.org but no matter how many times I entered a code, it kept
telling me that Code is invalid or outdated. I wonder why the DFA hates me
:frowning:

I had to update my test code in order to make sure I could get the
following error messages.

Ruby version: "3.0.2"
Get working directory:
"/home/user/dev/dirglob"

···

*****
NoMethodError raised!
private method `open' called for Dir:Class
*****
Errno::EEXIST raised!
File exists @ dir_s_mkdir - tmp
eval:1:in `mkdir'
*****
Does the 'tmp' directory exist? true
*****
NoMethodError raised!
undefined method `glob' for Dir:Class
*****
TypeError raised!
wrong argument type File (expected dir)
eval:1:in `entries'
*****
Does the 'tmp' directory still exist? true

*The Actual Code*

// main.cpp - Dir#glob Execution Test

#include <stdio.h>
#include <ruby.h>
#include <ruby/io.h>

#define str(s) rb_str_new_cstr(s)

VALUE call_exception(VALUE exc)
{
  exc = rb_errinfo();
  VALUE klass, msg, bt;
  klass = str( rb_obj_classname(exc) );
  klass = rb_str_plus(klass, str(" raised!"));
  msg = rb_funcall(exc, rb_intern("message"), 0);
  bt = rb_funcall(exc, rb_intern("backtrace"), 0);
  rb_ary_pop(bt);
  VALUE c_ary = { klass, msg, bt, str("*****") };
  rb_io_puts(4, c_ary, rb_stdout);
  rb_exc_raise(exc); // Ignored by Ruby...
  rb_set_errinfo(Qnil);
  return Qnil;
}

void raise_error(int status, const char* str)
{
  VALUE exc = Qnil;
  int exit_status;
  rb_protect((VALUE (*)(VALUE))call_exception, exc, &exit_status);
}

int main(int argc, char **argv)
{
  int rargc = 0, state = 0;
  char **rargv = 0;
  ruby_sysinit(&rargc, &rargv);
  ruby_setup();
  VALUE rversion = rb_const_get(rb_cObject, rb_intern("RUBY_VERSION"));
  rb_funcall(Qnil, rb_intern("print"), 1, str("Ruby version: "));
  rb_p( rversion );
  rb_funcall(Qnil, rb_intern("puts"), 1,
             str("Get working directory:"));
  rb_p( rb_funcall(rb_cDir, rb_intern("getwd"), 0) );
  const char* line_break = "*****\n";
  const char *mk_dir = "Dir.mkdir('tmp')";
  const char *is_tmp = "puts Dir.exist?('tmp')";
  const char *glob = "puts Dir.glob('*.h')";
  const char *entries = "puts Dir.entries('tmp')";
  const char *rm_dir = "Dir.rmdir('tmp')";
  printf(line_break);
  rb_eval_string_protect("Dir.open('arch')", &state);
  if (state) raise_error(state, "Dir#open");
  rb_eval_string_protect(mk_dir, &state);
  if (state) raise_error(state, "Dir#mkdir");
  rb_funcall(Qnil, rb_intern("print"), 1,
             str("Does the 'tmp' directory exist? "));
  rb_eval_string(is_tmp);
  printf(line_break);
  rb_eval_string_protect(glob, &state);
  if (state) raise_error(state, "Dir#glob");
  rb_eval_string_protect(entries, &state);
  if (state) raise_error(state, "Dir#entries");
  //rb_eval_string(rm_dir);
  rb_funcall(Qnil, rb_intern("print"), 1,
             str("Does the 'tmp' directory still exist? "));
  rb_eval_string(is_tmp);
  ruby_cleanup(0);
  return state;
}

On Thu, Oct 13, 2022, 06:47 Frank J. Cameron <fjc@fastmail.net> wrote:

Thanks for the code :slight_smile: I shortened it a bit to just show the problem:

#include <ruby.h>
#define str(s) rb_str_new_cstr(s)

int main(int argc, char **argv)
{
  int rargc = 0, state = 0;
  char **rargv = 0;
  ruby_sysinit(&rargc, &rargv);
  ruby_setup();
  VALUE rversion = rb_const_get(rb_cObject, rb_intern("RUBY_VERSION"));
  rb_funcall(Qnil, rb_intern("print"), 1, str("Ruby version: "));
  rb_p( rversion );

  rb_p( str("before glob") );
  rb_eval_string("p Dir.glob('*.h')");
  rb_p( str("after glob") );

  ruby_cleanup(0);
  return 0;
}

Results:

$ ./a.out-2.5
Ruby version: "2.5.8"
"before glob"

"after glob"

$ ./a.out-2.6
Ruby version: "2.6.9"
"before glob"

"after glob"

$ ./a.out-2.7
Ruby version: "2.7.6"
"before glob"

"after glob"

$ ./a.out-3.0
Ruby version: "3.0.4"
"before glob"
ruby: [BUG] Segmentation fault at 0x0000000000000018
...

$ ./a.out-3.1
Ruby version: "3.1.2"
"before glob"
ruby: [BUG] Segmentation fault at 0x0000000000000018
...

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Looks good, except for the segfaults. XD Still, there's something missing
there. You see, Dir#entries also fails to find the temporary directory temp
that the very same Dir.mkdir created in my original code.

I wouldn't say I missed it, but I did leave it out to more clearly show
just the one problem at a time. :slight_smile:

By the way, I made sure my account kyonides could be found in
bugs.ruby-lang.org but no matter how many times I entered a code, it kept
telling me that Code is invalid or outdated. I wonder why the DFA hates me

Were you able to file an issue at Issues · ruby/b.r-l.o · GitHub
to have your 2FA reset?

···

On 10/14/22, kyonides eupator <kyonides@gmail.com> wrote:

I now have but after so many failures, who knows if it will finally be
reset or fixed...

Kyonides

···

On Fri, Oct 14, 2022 at 9:05 PM Frank J. Cameron <fjc@fastmail.net> wrote:

On 10/14/22, kyonides eupator <kyonides@gmail.com> wrote:
> Looks good, except for the segfaults. XD Still, there's something missing
> there. You see, Dir#entries also fails to find the temporary directory
temp
> that the very same Dir.mkdir created in my original code.

I wouldn't say I missed it, but I did leave it out to more clearly show
just the one problem at a time. :slight_smile:

> By the way, I made sure my account kyonides could be found in
> bugs.ruby-lang.org but no matter how many times I entered a code, it
kept
> telling me that Code is invalid or outdated. I wonder why the DFA hates
me

Were you able to file an issue at Issues · ruby/b.r-l.o · GitHub
to have your 2FA reset?

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Since everything is just as bad as it was on day one and the bug report
website still refuses to allow me to enter the report, I'm leaving this
topic alone for good. I'll simply ditch Ruby 3.x as a whole for common
method calls no longer work in applications built against the Ruby dll or
so file. It's a shame. I seriously think Ruby went the wrong way when the
developers introduced the Primitive pseudo object in version 3.x

I'll be using Ruby 2.7 for a long time I guess.

Kyonides

···

On Wed, Oct 12, 2022 at 4:01 PM SHIBATA Hiroshi <hsbt@ruby-lang.org> wrote:

>Believe me when I tell you that I tried to submit a bug ticket concerning
the Dir.glob issue in stand alone apps but bugs.ruby-lang.org double
factor authentication feature kept telling me that Google Authenticator's
codes were invalid or had expired. I tried it over 20 times in a row to no
avail. :frowning:

Please file your issue to Issues · ruby/b.r-l.o · GitHub

I can reset your 2fa status or password.
But I couldn't find the pre-registration status of
`kyonides@gmail.com` from bugs.ruby-lang.org.

On Thu, Oct 13, 2022 at 6:50 AM kyonides eupator <kyonides@gmail.com> > wrote:
>
> Believe me when I tell you that I tried to submit a bug ticket
concerning the Dir.glob issue in stand alone apps but bugs.ruby-lang.org
double factor authentication feature kept telling me that Google
Authenticator's codes were invalid or had expired. I tried it over 20 times
in a row to no avail. :frowning:
>
> On Wed, Oct 12, 2022, 15:33 Austin Ziegler <halostatue@gmail.com> wrote:
>>
>> I think that this would be excellent to open as a ticket at
bugs.ruby-lang.org.
>>
>> -a
>>
>> On Wed, Oct 12, 2022 at 4:46 PM kyonides eupator <kyonides@gmail.com> > wrote:
>>>
>>> Greetings!
>>>
>>> I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and
quickly noticed that whenever I called Dir.glob via a CRuby rb_funcall
function call, it immediately caused a segfault. Later on I discovered by
checking the Dir class official documentation that all of the 3.x series
now call some mysterious Primitive constant instead of relying directly on
a CRuby function to perform the task. Here is a small extract of the
official documentation:
>>>
>>> # File dir.rb, line 133
>>> def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort:
true)
>>> Primitive.dir_s_glob(pattern, flags, base, sort)
>>> end
>>>
>>> I've always failed to use Primitive in my Ruby test code. Ruby cannot
find it anywhere.
>>>
>>> Calling Dir.glob in an IRB sessions works fine as well as running a
Ruby test code on a machine that has Ruby already installed there.
>>>
>>> Now I have to ask you guys if you know how we are supposed to call
Dir#glob and Dir# methods from stand alone apps without asking our target
customers to install Ruby on their machines.
>>>
>>> Thank you in advance for any assistance!
>>>
>>> Kyonides
>>>
>>> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
>>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;
>>
>>
>>
>> --
>> Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
>> http://www.halostatue.ca/http://twitter.com/halostatue
>>
>> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;
>>
>
> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

1. I saw you file an issue with Issues · ruby/b.r-l.o · GitHub.
   2. Have you provided what your expected *login* to bugs.ruby-lang.org
   is, since the maintainer said that they cannot find an account for the
   email address you’re using now?
   3. You *do* realize that you can just send an email to
   ruby-core@ruby-lang.org and it *should* become a new ticket, right?

I doubt that the primitives were a mistake, as it will also make it easier
for non-CRuby implementations to implement core functionality. It may not
work for a particular use case, but that use case may have changed and the
way that you should make it work has probably changed, and will require
updated instructions.

-a

···

On Sun, Oct 23, 2022 at 10:06 AM kyonides eupator <kyonides@gmail.com> wrote:

Since everything is just as bad as it was on day one and the bug report
website still refuses to allow me to enter the report, I'm leaving this
topic alone for good. I'll simply ditch Ruby 3.x as a whole for common
method calls no longer work in applications built against the Ruby dll or
so file. It's a shame. I seriously think Ruby went the wrong way when the
developers introduced the Primitive pseudo object in version 3.x

I'll be using Ruby 2.7 for a long time I guess.

Kyonides

On Wed, Oct 12, 2022 at 4:01 PM SHIBATA Hiroshi <hsbt@ruby-lang.org> > wrote:

>Believe me when I tell you that I tried to submit a bug ticket
concerning the Dir.glob issue in stand alone apps but bugs.ruby-lang.org
double factor authentication feature kept telling me that Google
Authenticator's codes were invalid or had expired. I tried it over 20 times
in a row to no avail. :frowning:

Please file your issue to Issues · ruby/b.r-l.o · GitHub

I can reset your 2fa status or password.
But I couldn't find the pre-registration status of
`kyonides@gmail.com` from bugs.ruby-lang.org.

On Thu, Oct 13, 2022 at 6:50 AM kyonides eupator <kyonides@gmail.com> >> wrote:
>
> Believe me when I tell you that I tried to submit a bug ticket
concerning the Dir.glob issue in stand alone apps but bugs.ruby-lang.org
double factor authentication feature kept telling me that Google
Authenticator's codes were invalid or had expired. I tried it over 20 times
in a row to no avail. :frowning:
>
> On Wed, Oct 12, 2022, 15:33 Austin Ziegler <halostatue@gmail.com> >> wrote:
>>
>> I think that this would be excellent to open as a ticket at
bugs.ruby-lang.org.
>>
>> -a
>>
>> On Wed, Oct 12, 2022 at 4:46 PM kyonides eupator <kyonides@gmail.com> >> wrote:
>>>
>>> Greetings!
>>>
>>> I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and
quickly noticed that whenever I called Dir.glob via a CRuby rb_funcall
function call, it immediately caused a segfault. Later on I discovered by
checking the Dir class official documentation that all of the 3.x series
now call some mysterious Primitive constant instead of relying directly on
a CRuby function to perform the task. Here is a small extract of the
official documentation:
>>>
>>> # File dir.rb, line 133
>>> def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort:
true)
>>> Primitive.dir_s_glob(pattern, flags, base, sort)
>>> end
>>>
>>> I've always failed to use Primitive in my Ruby test code. Ruby cannot
find it anywhere.
>>>
>>> Calling Dir.glob in an IRB sessions works fine as well as running a
Ruby test code on a machine that has Ruby already installed there.
>>>
>>> Now I have to ask you guys if you know how we are supposed to call
Dir#glob and Dir# methods from stand alone apps without asking our target
customers to install Ruby on their machines.
>>>
>>> Thank you in advance for any assistance!
>>>
>>> Kyonides
>>>
>>> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
>>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;
>>
>>
>>
>> --
>> Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
>> http://www.halostatue.ca/http://twitter.com/halostatue
>>
>> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;
>>
>
> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

Seriously, I will ignore this thread from now on. I made the bug and the
2FA issue known to people and since there have been no changes, I prefer to
forget about this and even switch to a different language that hasn't made
such a serious mistake as the Primitive thing is. Good luck.

···

On Sun, Oct 23, 2022, 12:32 Austin Ziegler <halostatue@gmail.com> wrote:

   1. I saw you file an issue with Issues · ruby/b.r-l.o · GitHub.
   2. Have you provided what your expected *login* to bugs.ruby-lang.org
   is, since the maintainer said that they cannot find an account for the
   email address you’re using now?
   3. You *do* realize that you can just send an email to
   ruby-core@ruby-lang.org and it *should* become a new ticket, right?

I doubt that the primitives were a mistake, as it will also make it easier
for non-CRuby implementations to implement core functionality. It may not
work for a particular use case, but that use case may have changed and the
way that you should make it work has probably changed, and will require
updated instructions.

-a

On Sun, Oct 23, 2022 at 10:06 AM kyonides eupator <kyonides@gmail.com> > wrote:

Since everything is just as bad as it was on day one and the bug report
website still refuses to allow me to enter the report, I'm leaving this
topic alone for good. I'll simply ditch Ruby 3.x as a whole for common
method calls no longer work in applications built against the Ruby dll or
so file. It's a shame. I seriously think Ruby went the wrong way when the
developers introduced the Primitive pseudo object in version 3.x

I'll be using Ruby 2.7 for a long time I guess.

Kyonides

On Wed, Oct 12, 2022 at 4:01 PM SHIBATA Hiroshi <hsbt@ruby-lang.org> >> wrote:

>Believe me when I tell you that I tried to submit a bug ticket
concerning the Dir.glob issue in stand alone apps but bugs.ruby-lang.org
double factor authentication feature kept telling me that Google
Authenticator's codes were invalid or had expired. I tried it over 20 times
in a row to no avail. :frowning:

Please file your issue to Issues · ruby/b.r-l.o · GitHub

I can reset your 2fa status or password.
But I couldn't find the pre-registration status of
`kyonides@gmail.com` from bugs.ruby-lang.org.

On Thu, Oct 13, 2022 at 6:50 AM kyonides eupator <kyonides@gmail.com> >>> wrote:
>
> Believe me when I tell you that I tried to submit a bug ticket
concerning the Dir.glob issue in stand alone apps but bugs.ruby-lang.org
double factor authentication feature kept telling me that Google
Authenticator's codes were invalid or had expired. I tried it over 20 times
in a row to no avail. :frowning:
>
> On Wed, Oct 12, 2022, 15:33 Austin Ziegler <halostatue@gmail.com> >>> wrote:
>>
>> I think that this would be excellent to open as a ticket at
bugs.ruby-lang.org.
>>
>> -a
>>
>> On Wed, Oct 12, 2022 at 4:46 PM kyonides eupator <kyonides@gmail.com> >>> wrote:
>>>
>>> Greetings!
>>>
>>> I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and
quickly noticed that whenever I called Dir.glob via a CRuby rb_funcall
function call, it immediately caused a segfault. Later on I discovered by
checking the Dir class official documentation that all of the 3.x series
now call some mysterious Primitive constant instead of relying directly on
a CRuby function to perform the task. Here is a small extract of the
official documentation:
>>>
>>> # File dir.rb, line 133
>>> def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort:
true)
>>> Primitive.dir_s_glob(pattern, flags, base, sort)
>>> end
>>>
>>> I've always failed to use Primitive in my Ruby test code. Ruby
cannot find it anywhere.
>>>
>>> Calling Dir.glob in an IRB sessions works fine as well as running a
Ruby test code on a machine that has Ruby already installed there.
>>>
>>> Now I have to ask you guys if you know how we are supposed to call
Dir#glob and Dir# methods from stand alone apps without asking our target
customers to install Ruby on their machines.
>>>
>>> Thank you in advance for any assistance!
>>>
>>> Kyonides
>>>
>>> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
>>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;
>>
>>
>>
>> --
>> Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
>> http://www.halostatue.ca/http://twitter.com/halostatue
>>
>> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;
>>
>
> Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org
?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
Austin Ziegler • halostatue@gmail.com • austin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

And people wonder why certain complaints aren’t taken seriously.

-a

···

On Oct 23, 2022, at 14:53, kyonides eupator kyonides@gmail.com wrote:

Seriously, I will ignore this thread from now on. I made the bug and the 2FA issue known to people and since there have been no changes, I prefer to forget about this and even switch to a different language that hasn’t made such a serious mistake as the Primitive thing is. Good luck.

On Sun, Oct 23, 2022, 12:32 Austin Ziegler <halostatue@gmail.com> wrote:

  1. I saw you file an issue with https://github.com/ruby/b.r-l.o/issues.
  2. Have you provided what your expected login to bugs.ruby-lang.org is, since the maintainer said that they cannot find an account for the email address you’re using now?
  3. You do realize that you can just send an email to ruby-core@ruby-lang.org and it should become a new ticket, right?
    I doubt that the primitives were a mistake, as it will also make it easier for non-CRuby implementations to implement core functionality. It may not work for a particular use case, but that use case may have changed and the way that you should make it work has probably changed, and will require updated instructions.

-a

On Sun, Oct 23, 2022 at 10:06 AM kyonides eupator <kyonides@gmail.com> wrote:

Since everything is just as bad as it was on day one and the bug report website still refuses to allow me to enter the report, I’m leaving this topic alone for good. I’ll simply ditch Ruby 3.x as a whole for common method calls no longer work in applications built against the Ruby dll or so file. It’s a shame. I seriously think Ruby went the wrong way when the developers introduced the Primitive pseudo object in version 3.x

I’ll be using Ruby 2.7 for a long time I guess.

Kyonides

On Wed, Oct 12, 2022 at 4:01 PM SHIBATA Hiroshi <hsbt@ruby-lang.org> wrote:

Believe me when I tell you that I tried to submit a bug ticket concerning the Dir.glob issue in stand alone apps but bugs.ruby-lang.org double factor authentication feature kept telling me that Google Authenticator’s codes were invalid or had expired. I tried it over 20 times in a row to no avail. :frowning:

Please file your issue to https://github.com/ruby/b.r-l.o/issues

I can reset your 2fa status or password.
But I couldn’t find the pre-registration status of
[kyonides@gmail.com](mailto:kyonides@gmail.com) from bugs.ruby-lang.org.

On Thu, Oct 13, 2022 at 6:50 AM kyonides eupator <kyonides@gmail.com> wrote:

Believe me when I tell you that I tried to submit a bug ticket concerning the Dir.glob issue in stand alone apps but bugs.ruby-lang.org double factor authentication feature kept telling me that Google Authenticator’s codes were invalid or had expired. I tried it over 20 times in a row to no avail. :frowning:

On Wed, Oct 12, 2022, 15:33 Austin Ziegler <halostatue@gmail.com> wrote:

I think that this would be excellent to open as a ticket at bugs.ruby-lang.org.

-a

On Wed, Oct 12, 2022 at 4:46 PM kyonides eupator <kyonides@gmail.com> wrote:

Greetings!

I was compiling a small app against Ruby 3.0 on Ubuntu 22.04 and quickly noticed that whenever I called Dir.glob via a CRuby rb_funcall function call, it immediately caused a segfault. Later on I discovered by checking the Dir class official documentation that all of the 3.x series now call some mysterious Primitive constant instead of relying directly on a CRuby function to perform the task. Here is a small extract of the official documentation:

File dir.rb, line 133

def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true)
Primitive.dir_s_glob(pattern, flags, base, sort)
end

I’ve always failed to use Primitive in my Ruby test code. Ruby cannot find it anywhere.

Calling Dir.glob in an IRB sessions works fine as well as running a Ruby test code on a machine that has Ruby already installed there.

Now I have to ask you guys if you know how we are supposed to call Dir#glob and Dir# methods from stand alone apps without asking our target customers to install Ruby on their machines.

Thank you in advance for any assistance!

Kyonides

Unsubscribe: mailto:[ruby-talk-request@ruby-lang.org](mailto:ruby-talk-request@ruby-lang.org)?subject=unsubscribe
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>


Austin Ziegler • halostatue@gmail.comaustin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

Unsubscribe: mailto:[ruby-talk-request@ruby-lang.org](mailto:ruby-talk-request@ruby-lang.org)?subject=unsubscribe
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Unsubscribe: mailto:[ruby-talk-request@ruby-lang.org](mailto:ruby-talk-request@ruby-lang.org)?subject=unsubscribe
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Unsubscribe: mailto:[ruby-talk-request@ruby-lang.org](mailto:ruby-talk-request@ruby-lang.org)?subject=unsubscribe
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Unsubscribe: mailto:[ruby-talk-request@ruby-lang.org](mailto:ruby-talk-request@ruby-lang.org)?subject=unsubscribe
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Austin Ziegler • halostatue@gmail.comaustin@halostatue.ca
http://www.halostatue.ca/http://twitter.com/halostatue

Unsubscribe: mailto:[ruby-talk-request@ruby-lang.org](mailto:ruby-talk-request@ruby-lang.org)?subject=unsubscribe
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Unsubscribe: mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe
http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk