[#81492] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — normalperson@...
Issue #13618 has been reported by normalperson (Eric Wong).
12 messages
2017/06/01
[#88695] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2018/08/27
> https://bugs.ruby-lang.org/issues/13618
[#81569] [Ruby trunk Feature#12589] VM performance improvement proposal — vmakarov@...
Issue #12589 has been updated by vmakarov (Vladimir Makarov).
3 messages
2017/06/04
[#81581] [Ruby trunk Bug#13632] Not processable interrupt queue for a thread after it's notified that FD is closed in some other thread. — sir.nickolas@...
Issue #13632 has been reported by nvashchenko (Nikolay Vashchenko).
4 messages
2017/06/05
[#81590] Re: [ruby-cvs:66197] ko1:r59023 (trunk): revert r59020 because it may fail some tests sometimes on some environment (http://ci.rvm.jp/). This revert is to check the reason of failures. — Eric Wong <normalperson@...>
ko1@ruby-lang.org wrote:
5 messages
2017/06/06
[#81591] Re: [ruby-cvs:66197] ko1:r59023 (trunk): revert r59020 because it may fail some tests sometimes on some environment (http://ci.rvm.jp/). This revert is to check the reason of failures.
— Eric Wong <normalperson@...>
2017/06/06
Eric Wong <normalperson@yhbt.net> wrote:
[#81596] Re: [ruby-cvs:66203] Re: Re: ko1:r59023 (trunk): revert r59020 because it may fail some tests sometimes on some environment (http://ci.rvm.jp/). This revert is to check the reason of failures.
— Eric Wong <normalperson@...>
2017/06/06
Eric Wong <normalperson@yhbt.net> wrote:
[#81825] [Ruby trunk Feature#13697] [PATCH]: futex based thread primitives — normalperson@...
Issue #13697 has been reported by normalperson (Eric Wong).
3 messages
2017/06/29
[ruby-core:81852] [Ruby trunk Bug#13554] Running system with different gid fails on Linux if host has group with lots of members
From:
usa@...
Date:
2017-06-30 10:54:03 UTC
List:
ruby-core #81852
Issue #13554 has been updated by usa (Usaku NAKAMURA).
Backport changed from 2.2: DONTNEED, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: DONTNEED, 2.3: DONE, 2.4: REQUIRED
ruby_2_3 r59220 merged revision(s) 58658.
----------------------------------------
Bug #13554: Running system with different gid fails on Linux if host has group with lots of members
https://bugs.ruby-lang.org/issues/13554#change-65574
* Author: ssgelm (Stephen Gelman)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
* Backport: 2.2: DONTNEED, 2.3: DONE, 2.4: REQUIRED
----------------------------------------
In #9600, it was pointed out that groups can be larger than sysconf(SC_GETGR_R_SIZE_MAX) in Linux. This was fixed in r45290 by enlarging the buffer and retrying. That worked well, but it was broken again in r51492. Ever since, when trying to run the following ruby code:
~~~ ruby
begin
system("/bin/ls", gid: "adm")
rescue => exception
puts exception.backtrace
raise
end
~~~
I get the backtrace:
~~~
gid.rb:2:in `system'
gid.rb:2:in `<main>'
gid.rb:2:in `system': can't modify frozen false (RuntimeError)
from gid.rb:2:in `<main>'
~~~
In this case the "adm" group has about 200 members. It's worth noting that because of the way getgrnam_r works this happens if I pick any group listed after adm. It seems that the change in r51492 causes the buffer that is allocated for getgrnam_r to be marked as frozen, so when it's not big enough and it gets resized using rb_str_modify_expand ruby raises an exception.
This occurs in any release of ruby 2.3 or 2.4 and also on the trunk on either debian wheezy or jessie.
I don't have a deep enough knowledge of the ruby C API to know the best fix, but I was able to work around the problem with the following change:
~~~diff
diff --git a/process.c b/process.c
index 9191051..721dd4c 100644
--- a/process.c
+++ b/process.c
@@ -5126,9 +5126,9 @@ obj2gid(VALUE id
rb_free_tmp_buffer(getgr_tmp);
rb_syserr_fail(e, "getgrnam_r");
}
- rb_str_modify_expand(*getgr_tmp, getgr_buf_len);
- getgr_buf = RSTRING_PTR(*getgr_tmp);
- getgr_buf_len = rb_str_capacity(*getgr_tmp);
+ rb_free_tmp_buffer(getgr_tmp);
+ getgr_buf_len = getgr_buf_len * 2;
+ getgr_buf = rb_alloc_tmp_buffer(getgr_tmp, getgr_buf_len);
}
#elif defined(HAVE_GETGRNAM)
grptr = getgrnam(grpname);
~~~
Alternatively, I assume the better way to fix this would be to allocate the tmp buffer in a way that allows it to be resized but I didn't see an obvious way to do that.
--
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>