[#84867] [Ruby trunk Bug#14357] thread_safe tests suite segfaults — v.ondruch@...
Issue #14357 has been reported by vo.x (Vit Ondruch).
11 messages
2018/01/15
[#85364] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults
— Eric Wong <normalperson@...>
2018/02/03
v.ondruch@tiscali.cz wrote:
[#85368] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults
— Eric Wong <normalperson@...>
2018/02/03
Eric Wong wrote:
[#85442] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults
— Eric Wong <normalperson@...>
2018/02/06
Eric Wong <normalperson@yhbt.net> wrote:
[#85451] Re: [Ruby trunk Bug#14357] thread_safe tests suite segfaults
— Vladimir Makarov <vmakarov@...>
2018/02/06
On 02/06/2018 05:00 AM, Eric Wong wrote:
[#84874] [Ruby trunk Bug#14360] Regression CSV#open method for writing from Ruby 2.4.3 to 2.5.0 — shevegen@...
Issue #14360 has been updated by shevegen (Robert A. Heiler).
3 messages
2018/01/15
[#84980] [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — hsbt@...
Issue #13618 has been updated by hsbt (Hiroshi SHIBATA).
10 messages
2018/01/23
[#85012] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2018/01/23
hsbt@ruby-lang.org wrote:
[#85081] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2018/01/24
Eric Wong <normalperson@yhbt.net> wrote:
[#85082] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2018/01/24
> Thinking about this even more; I don't think it's possible to
[#85088] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — danieldasilvaferreira@...
Issue #13618 has been updated by dsferreira (Daniel Ferreira).
3 messages
2018/01/25
[#85107] [Ruby trunk Misc#14222] Mutex.lock is not safe inside signal handler: what is? — eregontp@...
Issue #14222 has been updated by Eregon (Benoit Daloze).
3 messages
2018/01/25
[#85136] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — Eric Wong <normalperson@...>
samuel@oriontransfer.org wrote:
3 messages
2018/01/26
[ruby-core:85260] [Ruby trunk Feature#14386] Add option to let Kernel.#system raise error instead of returning false
From:
zn@...
Date:
2018-01-30 14:56:38 UTC
List:
ruby-core #85260
Issue #14386 has been updated by znz (Kazuhiro NISHIYAMA).
How about using part after pid of `Process::Status#inspect`?
```
% ruby -ve 'begin;system(%q(ruby -e "exit(false)"), exception: true);rescue => e;p e;p Process.last_status;end'
ruby 2.6.0dev (2018-01-30 trunk 62111) [x86_64-darwin16]
#<RuntimeError: Command failed with exit 1: ruby -e "exit(false)">
#<Process::Status: pid 38365 exit 1>
% ruby -ve 'begin;system(%q(ruby -e "Process.kill(:TERM, Process.pid)"), exception: true);rescue;p $!;p $?;end'
ruby 2.6.0dev (2018-01-30 trunk 62111) [x86_64-darwin16]
#<RuntimeError: Command failed with SIGTERM (signal 15): ruby -e "Process.kill(:TERM, Process.pid)">
#<Process::Status: pid 38389 SIGTERM (signal 15)>
```
```patch
diff --git a/process.c b/process.c
index 8b8268e9f1..6ad9216564 100644
--- a/process.c
+++ b/process.c
@@ -548,7 +548,8 @@ pst_pid(VALUE st)
static void
pst_message(VALUE str, rb_pid_t pid, int status)
{
- rb_str_catf(str, "pid %ld", (long)pid);
+ if (pid != (rb_pid_t)-1)
+ rb_str_catf(str, "pid %ld", (long)pid);
if (WIFSTOPPED(status)) {
int stopsig = WSTOPSIG(status);
const char *signame = ruby_signal_name(stopsig);
@@ -4090,8 +4091,10 @@ rb_f_system(int argc, VALUE *argv)
status = PST2INT(rb_last_status_get());
if (status == EXIT_SUCCESS) return Qtrue;
if (eargp->exception) {
- rb_raise(rb_eRuntimeError, "Command failed with status (%d): %s",
- WEXITSTATUS(status), RSTRING_PTR(eargp->invoke.sh.shell_script));
+ VALUE str = rb_str_buf_new(0);
+ pst_message(str, (rb_pid_t)-1, status);
+ rb_raise(rb_eRuntimeError, "Command failed with%"PRIsVALUE": %s",
+ str, RSTRING_PTR(eargp->invoke.sh.shell_script));
}
else {
return Qfalse;
```
----------------------------------------
Feature #14386: Add option to let Kernel.#system raise error instead of returning false
https://bugs.ruby-lang.org/issues/14386#change-70021
* Author: k0kubun (Takashi Kokubun)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
I sometimes write code like:
~~~ ruby
system('git pull origin master') || raise('Failed to execute: git pull origin master')
system('bundle check || bundle install') || raise('Failed to execute: bundle check || bundle install')
~~~
Using rake, we can simplify the above code to the following one, but there's no way to do that outside Rakefile. (Note that I just want to do the same thing as "bash -e", the error message is actually not important.)
~~~ ruby
sh 'git pull origin master'
sh 'bundle check || bundle install'
~~~
If we add the following option, we can simplify such code even when we're not on a rake task. I'm not sure whether it's a good name or not though.
~~~ ruby
system 'git pull origin master', assert_status: true
system 'bundle check || bundle install', assert_status: true
# => RuntimeError: Command failed with status (1): bundle check || bundle install
~~~
--
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>