Граф коммитов

742 Коммитов

Автор SHA1 Сообщение Дата
ko1 8dd9c12c58 move fields to ec.
* vm_core.h (rb_thread.h): move errinfo and trace_arg to
  rb_execution_context_t.

* cont.c (fiber_switch, rb_cont_call): do not restore "trace_arg" here.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-28 14:27:49 +00:00
ko1 1939d097e6 move several fields from rb_thread_t to rb_execution_context_t.
* vm_core.h (rb_thread_t): move several fields which are copied at cont.c
  to rb_execution_context_t.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-26 07:56:44 +00:00
nobu aea98ff0d5 removed ruby_error_print
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-16 01:53:15 +00:00
watson1978 d0015e4ac6 Improve performance of implicit type conversion
To convert the object implicitly, it has had two parts in convert_type() which are
  1. lookink up the method's id
  2. calling the method

Seems that strncmp() and strcmp() in convert_type() are slightly heavy to look up
the method's id for type conversion.

This patch will add and use internal APIs (rb_convert_type_with_id, rb_check_convert_type_with_id)
to call the method without looking up the method's id when convert the object.

Array#flatten -> 19 % up
Array#+       ->  3 % up

[ruby-dev:50024] [Bug #13341] [Fix GH-1537]

### Before
       Array#flatten    104.119k (± 1.1%) i/s -    525.690k in   5.049517s
             Array#+      1.993M (± 1.8%) i/s -     10.010M in   5.024258s

### After
       Array#flatten    124.005k (± 1.0%) i/s -    624.240k in   5.034477s
             Array#+      2.058M (± 4.8%) i/s -     10.302M in   5.019328s

### Test Code
require 'benchmark/ips'

class Foo
  def to_ary
    [1,2,3]
  end
end

Benchmark.ips do |x|

  ary = []
  100.times { |i| ary << i }
  array = [ary]

  x.report "Array#flatten" do |i|
    i.times { array.flatten }
  end

  x.report "Array#+" do |i|
    obj = Foo.new
    i.times { array + obj }
  end

end

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-31 12:30:57 +00:00
k0kubun 253232c028 process.c: Use getrusage(2) in Process.times
if getrusage(2) is available, to improve precision of Process.times and
its user like lib/benchmark.rb.

On macOS, since getrusage(2) has better precision than times(3),
they are much improved like:

* Before

Process.times
=> #<struct Process::Tms utime=0.56, stime=0.35, cutime=0.04, cstime=0.03>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.340000   0.310000   0.650000 (  0.674025)

* After

Process.times
=> #<struct Process::Tms utime=0.561899, stime=0.35076, cutime=0.046483, cstime=0.038929>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.343223   0.310037   0.653260 (  0.674025)

On Linux, since struct rusage from getrusage(2) is used instead of struct tms
from times(2), they are slightly improved like:

* Before

Process.times
=> #<struct Process::Tms utime=0.43, stime=0.11, cutime=0.0, cstime=0.0>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.120000   0.040000   0.170000 (  0.171621)

* After

Process.times
=> #<struct Process::Tms utime=0.432, stime=0.116, cutime=0.0, cstime=0.0>

puts Benchmark.measure { "a" * 1_000_000_000 }
  0.124000   0.048000   0.172000 (  0.171621)

[ruby-dev:49471] [Feature #11952]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 01:48:11 +00:00
nobu cb302650a0 process.c: fix error check
* process.c (obj2uid, obj2gid): check the error number returned by
  `getpwnam_r()` and `getgrnam_r()`, instead of `errno`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-11 02:38:09 +00:00
nobu 8f9a46a304 .
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-10 23:34:33 +00:00
nobu ec70309ffa process.c: temporary string for buffer
* process.c (obj2uid, obj2gid): use temporary string as the buffer
  instead of `rb_alloc_tmp_buffer`, which is `NODE_ALLOCA` since
  r51492.  [ruby-core:81084] [Bug #13554]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-10 23:18:07 +00:00
sorah af4b7c8e86 Add documents on Process::CLOCK_* constants
* process.c: Add documents on Process::CLOCK_* constants.
  Patch by Sunao Komuro <sunao-komuro@cookpad.com>.
  Closes [GH-1567] [Bug #13386]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-29 09:31:13 +00:00
shyouhei 3106f9412a use HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
We already check for __builtin_mul_overflow in configure but never
actually referred it before.  Why not call it if available, because
that should render supposedly-optimial assembly outputs.

Optionally if __builtin_mul_overflow_p is available, which is the case
for recent GCC, use that to detect fixnum overflow.  This is much
faster than the previous.  On my machine generated assembly of
numeric.c:int_pow reduces from 480 to 448 bytes, according to nm(1).
Also on my machine, following script boosts from 7.819 to 6.929 sec.

time ./miniruby -e 'i=0; while i < 30_000_000 do i += 1; 7 ** 23; end'

Signed-off-by: Urabe, Shyouhei <shyouhei@ruby-lang.org>


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-06 06:04:52 +00:00
nobu 4b7fd61a05 process.c: PATH env in spawn
* process.c (rb_exec_fillarg): honor the given path environment
  variable.  [ruby-core:53103] [Bug #8004]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-06 00:58:49 +00:00
nobu 4e44f6ef86 [DOC] replace Fixnum with Integer [ci skip]
* numeric.c: [DOC] update document for Integer class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-26 06:11:23 +00:00
nobu 5d4309d068 process.c: use uaspawn
* process.c (proc_exec_cmd): use UTF-8 version aspawn.
  [ruby-dev:49838] [Bug #12841]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-14 15:54:03 +00:00
nobu 0cc169d1de fid typos [ci skip]
* fix typos, "a" before "Integer" to "an".  [Fix GH-1438]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-24 02:28:25 +00:00
naruse fdaea1596a * process.c (InitVM_process): Support CLOCK_MONOTONIC_RAW_APPROX,
CLOCK_UPTIME_RAW, and CLOCK_UPTIME_RAW_APPROX which are introduced
  by macOS 10.12.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-21 08:46:06 +00:00
akr 577de1e93d replace fixnum by integer in documents.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-08 04:57:49 +00:00
ko1 9f60791a04 * vm_core.h: revisit the structure of frame, block and env.
[Bug #12628]

  This patch introduce many changes.

  * Introduce concept of "Block Handler (BH)" to represent
    passed blocks.

  * move rb_control_frame_t::flag to ep[0] (as a special local
    variable). This flags represents not only frame type, but also
    env flags such as escaped.

  * rename `rb_block_t` to `struct rb_block`.

  * Make Proc, Binding and RubyVM::Env objects wb-protected.

  Check [Bug #12628] for more details.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-28 11:02:30 +00:00
naruse c73eb62b3f fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-04 07:05:00 +00:00
naruse 37c32dc6d1 * process.c: define sig_t if not exist.
at least Solaris 10 and 11 doesn't have sig_t.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-04 04:57:27 +00:00
normal 80a0c0f808 process.c (disable_child_handler_fork_child): simplify
signal(2) is portable for SIG_DFL and SIG_IGN, so we do not
need the extra code for sigaction(2).

Also, execve will reset all signal handlers to default
anyways, so there is little sense in preserving old
signal handler besides SIG_IGN.

Hopefully this makes the code easier-to-understand and
maintain.

* process.c (disable_child_handler_fork_child): simplify
  [ruby-core:75781] [Misc #12439]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-02 21:13:26 +00:00
nobu 294f653163 process.c: [DOC] Process.abort [ci skip]
* process.c (rb_f_abort): [DOC] Process.abort is a singleton
  method of Process, but not an instance method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-27 11:43:23 +00:00
nobu aa107497cd fix build on no-fork-spawnv platforms
* process.c (rb_execarg_commandline): build command line string
  from argument vector in rb_execarg.
  [ruby-core:75611] [Bug #12398]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-20 15:36:34 +00:00
naruse 28f5e12c24 * configure.in: check function attirbute const and pure,
and define CONSTFUNC and PUREFUNC if available.
  Note that I don't add those options as default because
  it still shows many false-positive (it seems not to consider
  longjmp).

* vm_eval.c (stack_check): get rb_thread_t* as an argument
  to avoid duplicate call of GET_THREAD().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08 17:44:51 +00:00
naruse a6c8e8d15b * configure.in: add -Wsuggest-attribute=noreturn and suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08 00:55:28 +00:00
nobu 48ed66868c process.c: argument types over conversion
* process.c (rb_exec_getargs): honor the expected argument types
  over the conversion method.  the basic language functionality
  should be robust.  [ruby-core:75388] [Bug #12355]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-06 22:58:03 +00:00
normal ebfb401e77 process.c (disable_child_handler_fork_child): initialize handler for SIGPIPE
This only happens on the !POSIX_SIGNAL case; but one may
test with the following:

    --- a/process.c
    +++ b/process.c
    @@ -3479,6 +3479,7 @@ disable_child_handler_fork_parent(struct child_handler_disabler_state *old)
     #endif
     }

    +#undef POSIX_SIGNAL
     /* This function should be async-signal-safe.  Actually it is. */
     static int
     disable_child_handler_fork_child(struct child_handler_disabler_state *old, char *errmsg, size_t errmsg_buflen)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-02 21:04:17 +00:00
nobu 24eb2e9cfe process.c: prefer rb_check_arity
* process.c: use rb_check_arity instead of rb_scan_args for simple
  optional arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-14 04:41:47 +00:00
usa 8ff043d8cb * process.c (rb_execarg_parent_start1): need to convert the encoding to
ospath's one.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-27 12:15:20 +00:00
usa 956100bc2e * process.c (rb_execarg_addopt): need to convert to ospath.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-27 12:03:45 +00:00
usa fe0194e25e * process.c: use rb_w32_uchdir() instead of plain chdir() on Windows.
reported by naruse via twitter.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-27 11:54:59 +00:00
nobu f4166e2dd7 prefer rb_syserr_fail
* file.c, io.c, util.c: prefer rb_syserr_fail with saved errno
  over setting errno then call rb_sys_fail, not to be clobbered
  potentially and to reduce thread local errno accesses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23 08:57:48 +00:00
hsbt 52cd994814 * enum.c: fix a typo in documentation.
[ci skip][fix GH-1140] Patch by @jutaz
* io.c: ditto.
* iseq.c: ditto.
* numeric.c: ditto.
* process.c: ditto.
* string.c: ditto.
* vm_trace.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14 02:52:14 +00:00
nobu f604375832 process.c: fix rdoc of Process.getsid [ci skip]
* process.c (proc_getsid): [DOC] Fix double word 'for' and typo.
  [Fix GH-1080]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-04 02:38:25 +00:00
kosaki 4ad2057f27 * ChangeLog: Good-bye OS/2.
* common.mk: ditto.
* configure.in: ditto.
* dln_find.c: ditto.
* ext/Setup.emx: ditto.
* ext/extmk.rb: ditto.
* ext/socket/extconf.rb: ditto.
* ext/zlib/extconf.rb: ditto.
* file.c: ditto.
* include/ruby/defines.h: ditto.
* io.c: ditto.
* lib/mkmf.rb: ditto.
* missing/os2.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* NEWS: announce OS/2 is no longer supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18 01:18:34 +00:00
nobu 09cbe9d640 process.c: do not inherit saved fds
* process.c (save_redirect_fd): make saved FDs close-on-exec not
  to be inherited.
* process.c (run_exec_dup2): restore close-on-exec flags too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-12 05:30:05 +00:00
nobu 9fb0863f4f Clarify spawn pgroup documentation [ci skip]
* process.c (rb_f_spawn): Be more specific regarding "other
  values" by having "non-zero positive integers" Add nil, the
  default value, as a possible value and what it means.
  Try to use more consistent language.
  [Fix GH-1008]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-10 13:15:55 +00:00
nobu d3022c424c process.c: keep GVL if WNOHANG
* process.c (rb_waitpid): do not release GVL when WNOHANG is set,
  it should return immediately without blocking.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-08 07:15:09 +00:00
nobu 2a87a0fc73 process.c: retry loop
* process.c (rb_waitpid): refactor retry loop by interrupt.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-08 07:00:13 +00:00
nobu cfecd21a89 process.c: open exception message
* process.c (rb_execarg_parent_start1): raise with the target path
  name when open() failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-07 15:14:46 +00:00
nobu be3de529c2 process.c: chdir exception message
* process.c (rb_exec_fail): raise with the target directory name
  when chdir() failed.  pointed out by sorah.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-07 14:45:31 +00:00
nobu d2f4d5a5fe Fix typo in Process.detatch doc [ci skip]
* process.c (proc_detach): [DOC] fix typo "intent" as "intend" in
  rdoc.  [Fix GH-1011]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-02 08:18:39 +00:00
nobu c670b75ec2 process.c: [DOC] env values in spawn [ci skip]
* process.c (rb_f_spawn): [DOC] elaborate environment variable
  values.  [ruby-core:70456] [Bug #11463]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-19 14:55:32 +00:00
normal f224fecc0f improve handling of timer thread shutdown
Shutting down the timer thread now always closes pipes to free FDs.
In fact, we close the write ends of the pipes is done in the main
RubyVM to signal the timer thread shutdown.

To effectively close pipes, we implement userspace locks via
atomics to force the pipe closing thread to wait on any signal
handlers which may be waking up.

While we're at it, improve robustness during resource exhaustion and
allow it to limp along non-fatally if restarting a timer thread
fails.

This reverts r51268

Note: this change is tested with VM_CHECK_MODE 1 in vm_core.h

* process.c (close_unless_reserved): add extra check
  (dup2_with_divert): remove
  (redirect_dup2): use dup2 without divert
  (before_exec_non_async_signal_safe): adjust call + comment
  (rb_f_exec): stop timer thread for all OSes
  (rb_exec_without_timer_thread): remove
* eval.c (ruby_cleanup): adjust call
* thread.c (rb_thread_stop_timer_thread): always close pipes
* thread_pthread.c (struct timer_thread_pipe): add writing field,
    mark owner_process volatile for signal handlers
  (rb_thread_wakeup_timer_thread_fd): check valid FD
  (rb_thread_wakeup_timer_thread): set writing flag to prevent close
  (rb_thread_wakeup_timer_thread_low): ditto
  (CLOSE_INVALIDATE): new macro
  (close_invalidate): new function
  (close_communication_pipe): removed
  (setup_communication_pipe_internal): make errors non-fatal
  (setup_communication_pipe): ditto
  (thread_timer): close reading ends inside timer thread
  (rb_thread_create_timer_thread): make errors non-fatal
  (native_stop_timer_thread): close write ends only, always,
   wait for signal handlers to finish
  (rb_divert_reserved_fd): remove
* thread_win32.c (native_stop_timer_thread): adjust (untested)
  (rb_divert_reserved_fd): remove
* vm_core.h: adjust prototype

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-14 09:44:10 +00:00
nobu 46b39cb0ba revert r31760 and r31761
seems that rb_bug_errno() is called in sigpipe() intentionally.
https://gist.github.com/sorah/831169

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-26 05:37:59 +00:00
normal 4fd2443580 avoid redundant GET_THREAD() calls
This reduces binary size slightly on my 32-bit system:

   text    data     bss     dec     hex filename
2847705   12360   30632 2890697  2c1bc9 ruby.orig
2847641   12360   30632 2890633  2c1b89 ruby

* iseq.c (rb_iseq_compile_with_option): reuse result of previous
  GET_THREAD() call
* thread.c (thread_create_core): ditto
  (rb_mutex_trylock): ditto
  (rb_mutex_lock): ditto
* process.c (rb_waitpid): avoid multiple eval from RUBY_VM_CHECK_INTS
* thread.c (rb_thread_check_ints): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16 20:42:43 +00:00
ngoto f242e17f9b * process.c (redirect_dup2): when the new FD of dup2() coflicts
with one of the timer thread FDs, the internal FD is diverted.
  [Bug #11336] [ruby-core:69886] [Bug #11350] [ruby-core:69961]
    
* process.c (dup2_with_divert): new function for the above purpose.
   
* thread_pthread.c (rb_divert_reserved_fd): new function for
  diverting reserved FD. If the given FD is the same as one of the
  reserved FDs, the reserved FD number is internally changed.
  It returns -1 when error. Otherwise, returns 0. It also returns
  0 if there is no need to change reserved FD number.

* thread_win32.c (rb_divert_reserved_fd): always returns 0 because
  of no reserved FDs.

* internal.h (rb_divert_reserved_fd): prototype declaration.
  It is Ruby internal use only.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16 13:06:13 +00:00
ngoto db2fe4b8ef Revert r51209 because signals after stopping timer thread before
entering exec(2) system call may be lost.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16 12:08:56 +00:00
normal e981a61c53 process.c (close_unless_reserved): declare type of `fd' arg
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-16 02:39:30 +00:00
ngoto d1bce9ec55 * process.c (redirect_close, parent_redirect_close): should not close
reserved FD. It should be closed in the exec system call due to the
  O_CLOEXEC or FD_CLOEXEC flag. [Bug #11353] [ruby-core:69977]
    
* process.c (close_unless_reserved): new function to close FD unless
  it is reserved for internal communication.
      
* thread_pthread.c (rb_reserved_fd_p): should check owner_process pid
  to avoid false positive in forked child process.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-15 14:26:22 +00:00
ngoto 4d23a784f5 * process.c (rb_f_exec): rb_exec_without_timer_thread should be
used on every OS, not only on Mac OS X or Haiku, to prevent
  timer thread communications using file descriptor 3 after
  setting redirection of the fd 3 before calling exec.
  [Bug #11336] [ruby-core:69886]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-10 11:27:43 +00:00