[#104169] [Ruby master Feature#17938] Keyword alternative for boolean positional arguments — matheusrichardt@...

Issue #17938 has been reported by matheusrich (Matheus Richard).

12 messages 2021/06/04

[#104213] [Ruby master Feature#17942] Add a `initialize(public @a, private @b)` shortcut syntax for defining public/private accessors for instance vars — tyler@...

SXNzdWUgIzE3OTQyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IFR5bGVyUmljayAoVHlsZXIgUmljayku

6 messages 2021/06/09

[#104288] [Ruby master Bug#17992] Upstreaming the htmlentities gem into CGI#.(un)escape_html — alexandermomchilov@...

Issue #17992 has been reported by AMomchilov (Alexander Momchilov).

9 messages 2021/06/15

[#104338] [Ruby master Misc#17997] DevelopersMeeting20210715Japan — mame@...

Issue #17997 has been reported by mame (Yusuke Endoh).

10 messages 2021/06/17

[#104361] [Ruby master Bug#18000] have_library doesn't work when ruby is compiled with --disable-shared --disable-install-static-library — jean.boussier@...

Issue #18000 has been reported by byroot (Jean Boussier).

9 messages 2021/06/18

[#104381] [Ruby master Feature#18004] Add Async to the stdlib — shannonskipper@...

Issue #18004 has been reported by shan (Shannon Skipper).

9 messages 2021/06/22

[#104401] [Ruby master Feature#18007] Help developers of C extensions meet requirements in "doc/extension.rdoc" — mike.dalessio@...

Issue #18007 has been reported by mdalessio (Mike Dalessio).

16 messages 2021/06/25

[#104430] [Ruby master Bug#18011] `Method#parameters` is incorrect for forwarded arguments — josh.cheek@...

Issue #18011 has been reported by josh.cheek (Josh Cheek).

12 messages 2021/06/29

[ruby-core:104354] [Ruby master Bug#17993] Ruby process stuck in rb_sigwait_sleep

From: curlypaul924@...
Date: 2021-06-17 22:17:12 UTC
List: ruby-core #104354
Issue #17993 has been updated by cout (Paul Brannan).


I think I have tracked the problem to libev.  Kudu uses libev for its reactor, and libev installs a signal handler for SIGCHLD (http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod):

> Libev grabs SIGCHLD as soon as the default event loop is initialised. This is necessary to guarantee proper behaviour even if the first child watcher is started after the child exits. The occurrence of SIGCHLD is recorded asynchronously, but child reaping is done synchronously as part of the event loop processing. Libev always reaps all children, even ones not watched.

Unfortunately AFAICT there is no good way to turn this off through the C++ interface to libev, even if it is not needed.  That means any library that uses libev cannot be used with ruby out of the box.  My gut feeling is that this is libev's fault for installing a SIGCHLD handler, not invoking the originally installed SIGCHLD handler, and reaping child processes that it did not start.


----------------------------------------
Bug #17993: Ruby process stuck in rb_sigwait_sleep
https://bugs.ruby-lang.org/issues/17993#change-92582

* Author: cout (Paul Brannan)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-linux-gnu]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I have a very simple client for kudu (https://kudu.apache.org/) implement as a wrapper that I invoke with FFI.  After creating a kudu client with `KuduClientBuilder::Build()`, subsequent calls to `system` cause the ruby interpreter to block indefinitely.  It is unclear to me whether the fault is in the ruby interpreter, in my wrapper code, or in kudu.

The wrapper looks like this:

```
#include <kudu/client/client.h>

#include <string>

extern "C" {

int build_client(char const * addr) {
  ::kudu::client::sp::shared_ptr<::kudu::client::KuduClient> client;

  auto status = ::kudu::client::KuduClientBuilder()
      .add_master_server_addr(addr)
      .Build(&client);

  return status.ok();
}

}
```

And the ruby script looks like this:

```
require 'ffi'

module TestFFI
  extend ::FFI::Library
  ffi_lib './libtest_ffi.so'
  attach_function :build_client, [ :strptr ], :int
end

TestFFI.build_client(ARGV[0])

system("true");
```

The backtrace for the main thread looks like this:

```
#0  0x00007ff93fbe3811 in ppoll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ff9411030e0 in rb_sigwait_sleep (th=th@entry=0x1261440, sigwait_fd=sigwait_fd@entry=3, rel=rel@entry=0x0) at /data/ruby-2.7.3/hrtime.h:148
#2  0x00007ff941104488 in native_sleep (th=0x1261440, rel=0x0) at /data/ruby-2.7.3/thread_pthread.c:2099
#3  0x00007ff94110708e in rb_thread_sleep_interruptible () at /data/ruby-2.7.3/thread.c:1329
#4  0x00007ff94106d945 in waitpid_sleep (x=x@entry=140729366950784) at /data/ruby-2.7.3/process.c:1151
#5  0x00007ff940f8f32c in rb_ensure (b_proc=b_proc@entry=0x7ff94106d930 <waitpid_sleep>, data1=data1@entry=140729366950784, e_proc=e_proc@entry=0x7ff94106d8e0 <waitpid_cleanup>, 
    data2=data2@entry=140729366950784) at /data/ruby-2.7.3/eval.c:1129
#6  0x00007ff941075389 in rb_f_system (argc=<optimized out>, argv=<optimized out>, _=<optimized out>) at /data/ruby-2.7.3/process.c:4557
#7  0x00007ff941138f53 in vm_call_cfunc_with_frame (empty_kw_splat=<optimized out>, cd=<optimized out>, calling=<optimized out>, reg_cfp=<optimized out>, ec=<optimized out>)
    at /data/ruby-2.7.3/vm_insnhelper.c:2514
#8  vm_call_cfunc (ec=0x1261a50, reg_cfp=0x7ff94168ffa0, calling=<optimized out>, cd=0x156d680) at /data/ruby-2.7.3/vm_insnhelper.c:2539
#9  0x00007ff9411459ac in vm_sendish (method_explorer=<optimized out>, block_handler=<optimized out>, cd=<optimized out>, reg_cfp=<optimized out>, ec=<optimized out>)
    at /data/ruby-2.7.3/vm_insnhelper.c:4023
#10 vm_exec_core (ec=0x7ffe1bed31b8, initial=1) at insns.def:801
#11 0x00007ff94114bc1f in rb_vm_exec (ec=0x1261a50, mjit_enable_p=1) at /data/ruby-2.7.3/vm.c:1929
#12 0x00007ff940f8bbd0 in rb_ec_exec_node (ec=ec@entry=0x1261a50, n=n@entry=0x13ce5c8) at /data/ruby-2.7.3/eval.c:278
#13 0x00007ff940f91078 in ruby_run_node (n=0x13ce5c8) at /data/ruby-2.7.3/eval.c:336
#14 0x00000000004009df in main (argc=<optimized out>, argv=<optimized out>) at /data/ruby-2.7.3/main.c:50
```

Tested with ruby 2.7.3p183 and kudu 1.10.0-cdh6.3.0 on Ubuntu 16.04.

Everything works as expected on ruby 2.5.

I have not tried any other combinations of ruby or kudu.




-- 
https://bugs.ruby-lang.org/

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

In This Thread

Prev Next