Age | Commit message (Collapse) | Author |
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3742
|
|
It seems immutable information.
Notes:
Merged: https://github.com/ruby/ruby/pull/3671
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3589
|
|
Some global variables should be used from non-main Ractors.
[Bug #17268]
```ruby
# ractor-local (derived from created ractor): debug
'$DEBUG' => $DEBUG,
'$-d' => $-d,
# ractor-local (derived from created ractor): verbose
'$VERBOSE' => $VERBOSE,
'$-w' => $-w,
'$-W' => $-W,
'$-v' => $-v,
# process-local (readonly): other commandline parameters
'$-p' => $-p,
'$-l' => $-l,
'$-a' => $-a,
# process-local (readonly): getpid
'$$' => $$,
# thread local: process result
'$?' => $?,
# scope local: match
'$~' => $~.inspect,
'$&' => $&,
'$`' => $`,
'$\'' => $',
'$+' => $+,
'$1' => $1,
# scope local: last line
'$_' => $_,
# scope local: last backtrace
'$@' => $@,
'$!' => $!,
# ractor local: stdin, out, err
'$stdin' => $stdin.inspect,
'$stdout' => $stdout.inspect,
'$stderr' => $stderr.inspect,
```
Notes:
Merged: https://github.com/ruby/ruby/pull/3670
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3434
|
|
This commit introduces Ractor mechanism to run Ruby program in
parallel. See doc/ractor.md for more details about Ractor.
See ticket [Feature #17100] to see the implementation details
and discussions.
[Feature #17100]
This commit does not complete the implementation. You can find
many bugs on using Ractor. Also the specification will be changed
so that this feature is experimental. You will see a warning when
you make the first Ractor with `Ractor.new`.
I hope this feature can help programmers from thread-safety issues.
Notes:
Merged: https://github.com/ruby/ruby/pull/3365
|
|
https://rubyci.org/logs/rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20200821T223002Z.fail.html.gz
```
process.c:5593:37: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
while ((gle = getlogin_r(login, loginsize)) != 0) {
~~~~~~~~~~ ^~~~~~~~~
```
type of getlogin_r's 2nd argument is
- int on FreeBSD
- https://www.freebsd.org/cgi/man.cgi?query=getlogin_r&apropos=0&sektion=0&manpath=FreeBSD+12.1-RELEASE+and+Ports&arch=default&format=html
- size_t on Linux, NetBSD
- https://man7.org/linux/man-pages/man3/getlogin_r.3.html
- https://www.freebsd.org/cgi/man.cgi?query=getlogin_r&apropos=0&sektion=0&manpath=NetBSD+9.0&arch=default&format=html
|
|
Correctly capture thread before releasing GVL and pass as argument to
`rb_thread_scheduler_if_nonblocking`.
Notes:
Merged: https://github.com/ruby/ruby/pull/3323
|
|
Not every compilers understand that rb_raise does not return. When a
function does not end with a return statement, such compilers can issue
warnings. We would better tell them about reachabilities.
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
|
|
Kernel#sleep should still return seconds slept, even when using a
Thread.scheduler. The return value of Scheduler#wait_sleep can be
ignored.
Notes:
Merged: https://github.com/ruby/ruby/pull/3198
|
|
Allow the 'Dir.home' method to reliably locate the user's home directory when
all three of the following are true at the same time:
1. Ruby is running on a Unix-like OS
2. The $HOME environment variable is not set
3. The process is not a descendant of login(1) (or a work-alike)
The prior behavior was that the lookup could only work for login-descended
processes.
This is accomplished by looking up the user's record in the password database
by uid (getpwuid_r(3)) as a fallback to the lookup by name (getpwname_r(3))
which is still attempted first (based on the name, if any, returned by
getlogin_r(3)).
If getlogin_r(3), getpwnam_r(3), and/or getpwuid_r(3) is not available at
compile time, will fallback on using their respective non-*_r() variants:
getlogin(3), getpwnam(3), and/or getpwuid(3).
The rationale for attempting to do the lookup by name prior to doing it by uid
is to accommodate the possibility of multiple login names (each with its own
record in the password database, so each with a potentially different home
directory) being mapped to the same uid (as is explicitly allowed for by
POSIX; see getlogin(3posix)).
Preserves the existing behavior for login-descended processes, and adds the
new capability of having Dir.home being able to find the user's home directory
for non-login-descended processes.
Fixes [Bug #16787]
Related discussion:
https://bugs.ruby-lang.org/issues/16787
https://github.com/ruby/ruby/pull/3034
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3032
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
To fix build failures.
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
This shall fix compile errors.
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
|
|
not only when !w but also when w == WAITPID_LOCK_ONLY.
See also: f7c0cc36920a4ed14a3ab1ca6cfdf18ceff1e5d5 and a2264342063260d660b99872eaf5080f6ab08e81.
We thought this change was an oversight in the latter commit.
Without this change, the test fails like:
$ make test-all TESTS="../test/ruby/test_process.rb -n test_exec_failure_leaves_no_child" RUN_OPTS="--jit"
...
1) Failure:
TestProcess#test_exec_failure_leaves_no_child [/home/k0kubun/src/github.com/ruby/ruby/test/ruby/test_process.rb:2493]:
Expected [[26799, #<Process::Status: pid 26799 exit 127>]] to be empty.
Co-Authored-By: Yusuke Endoh <mame@ruby-lang.org>
|
|
As fork(2) is deprecated, its calls must be guarded by
`COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)`.
All usages of fork(2) in process have been alread guarded. A new call
to fork(2) was added in ruby.c with f22c4ff359498ab342e4b6d6feb21af6004ee270.
This caused a build failure on Solaris 11.
It may hide a bug to guard big code unnecessarily, so this change
introduces a simple wrapper "rb_fork" whose definition is guarded, and
replaces all calls to fork(2) with the wrapper function.
|
|
Ditto for 4b853932eaa7fa4acf8a0f0c9b7c695bb4f5e76d
|
|
|
|
|
|
inaccurate
* See [Bug #16740]
|
|
It should not be linked to `Process.clock_getes`.
|
|
* [Bug #16740]
* Remove the GETTIMEOFDAY_BASED_CLOCK_REALTIME example because the
caveat applies to all clock ids, not just the Symbol clock ids.
|
|
|
|
Split ruby.h
Notes:
Merged-By: shyouhei <shyouhei@ruby-lang.org>
|
|
`rb_str_new_cstr` can raise a `NoMemoryError`.
|
|
Paths in `rb_execarg_t` should have been converted already.
|
|
If the timer thread is left stopped, memory crash or segfault can
happen.
|
|
Saves comitters' daily life by avoid #include-ing everything from
internal.h to make each file do so instead. This would significantly
speed up incremental builds.
We take the following inclusion order in this changeset:
1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very
first thing among everything).
2. RUBY_EXTCONF_H if any.
3. Standard C headers, sorted alphabetically.
4. Other system headers, maybe guarded by #ifdef
5. Everything else, sorted alphabetically.
Exceptions are those win32-related headers, which tend not be self-
containing (headers have inclusion order dependencies).
Notes:
Merged: https://github.com/ruby/ruby/pull/2711
|
|
|
|
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
|
|
[Bug #16424]
Notes:
Merged: https://github.com/ruby/ruby/pull/2754
|
|
Suppress compiler warnings.
|
|
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.
This modifies some internal functions that took a safe level argument
to no longer take the argument.
rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.
One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd. We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
Notes:
Merged: https://github.com/ruby/ruby/pull/2476
|
|
|
|
* Top-level `return`;
* Documentation for comments syntax;
* `rescue` inside blocks;
* Enhance `Object#to_enum` docs;
* Make `chomp:` option more obvious for `String#each_line` and
`#lines`;
* Enhance `Proc#>>` and `#<<` docs;
* Enhance `Processs` class docs.
Notes:
Merged: https://github.com/ruby/ruby/pull/2612
|
|
This function has been used wrongly always at first, "allocate a
buffer then wrap it with tmpbuf". This order can cause a memory
leak, as tmpbuf creation also can raise a NoMemoryError exception.
The right order is "create a tmpbuf then allocate&wrap a buffer".
So the argument of this function is rather harmful than just
useless.
TODO:
* Rename this function to more proper name, as it is not used
"temporary" (function local) purpose.
* Allocate and wrap at once safely, like `ALLOCV`.
|
|
```
$ ruby -ve 'IO.popen("ls"){}; $?.to_int'
ruby 2.6.4p104 (2019-08-28 revision 67798) [x86_64-darwin18]
Traceback (most recent call last):
-e:1:in `<main>': undefined method `to_int' for #<Process::Status: pid 33989 SIGPIPE (signal 13)> (NoMethodError)
Did you mean? to_i
taint
```
Process::Status#to_int was removed at 7ba5c4e.
|
|
Seems FreeBSD already supported `CLOCK_PROCESS_CPUTIME_ID`.
That added by https://reviews.freebsd.org/rS239347 and the doc was updated
by https://reviews.freebsd.org/rS315694.
I confirmed `CLOCK_PROCESS_CPUTIME_ID` constant exists in 9.3.0 branch.
https://github.com/freebsd/freebsd/blob/release/9.3.0/sys/sys/time.h#L269
Notes:
Merged: https://github.com/ruby/ruby/pull/2429
|
|
To properly generate documents.
|
|
We can check the function pointer passed to rb_define_global_function
like we do so in rb_define_method. It turns out that almost anybody
is misunderstanding the API.
|
|
We can check the function pointer passed to rb_define_module_function
like how we do so in rb_define_method. The difference is that this
changeset reveales lots of atiry mismatches.
|
|
They lack portability. See also
https://travis-ci.org/shyouhei/ruby/jobs/577164015
|
|
After 5e86b005c0f2ef30df2f9906c7e2f3abefe286a2, I now think ANYARGS is
dangerous and should be extinct. This commit uses rb_gvar_getter_t /
rb_gvar_setter_t for rb_define_hooked_variable /
rb_define_virtual_variable which revealed lots of function prototype
inconsistencies. Some of them were literally decades old, going back
to dda5dc00cff334cac373096d444a0fd59e716124.
|
|
Often uid / gid are 16 bit or 32 bit integers, while VALUE are 32
to 64 bits. They tend to differ in size. Because rb_ensure expects
its callbacks to take VALUE arguments, narrowing must be done by
hand, otherwise data corruption can happen depending on machine ABI.
|
|
|