71164 Commits

Author SHA1 Message Date
Peter Zhu
82513c7d71 Remove unused function declaration in dln.c
getenv is no longer used in dln.c.
2022-02-18 09:30:08 -05:00
Shugo Maeda
cda5aee74e
LONG2NUM() should be used for rmatch_offset::{beg,end}
https://github.com/ruby/ruby/pull/5518#discussion_r809645406
2022-02-18 22:13:45 +09:00
Burdette Lamar
e9a2b30744
Enhanced RDoc concerning command injection (#5537)
Clarifies security vulnerabilities for commands.

Treats:

    Kernel.system
    Kernel.` (backtick)
    IO.popen
    IO.read
    IO.write
    IO.binread
    IO.binwrite
    IO.readlines
    IO.foreach
2022-02-18 06:46:04 -06:00
NARUSE, Yui
542a38f619 gen-mail.rb: support markdown file path 2022-02-18 21:44:22 +09:00
Yuta Saito
dff70b50d0 [wasm] vm.c: stop unwinding to main for every vm_exec call by setjmp
the original rb_wasm_setjmp implementation always unwinds to the root
call frame to have setjmp compatible interface, and simulate sjlj's
undefined behavior. Therefore, every vm_exec call unwinds to main, and
a deep call stack makes setjmp call very expensive. The following
snippet from optcarrot takes 5s even though it takes less than 0.3s on
native.

```
[0x0, 0x4, 0x8, 0xc].map do |attr|
  (0..7).map do |j|
    (0...0x10000).map do |i|
      clr = i[15 - j] * 2 + i[7 - j]
      clr != 0 ? attr | clr : 0
    end
  end
end
```

This patch adds a WASI specialized vm_exec which uses lightweight
try-catch API without unwinding to the root frame. After this patch, the
above snippet takes only 0.5s.
2022-02-18 18:28:18 +09:00
Akinori MUSHA
ac32b7023a Mention Set as a new builtin class to NEWS 2022-02-18 11:56:24 +09:00
Akinori MUSHA
dd3501bb95 Make Set a builtin feature [Feature #16989] 2022-02-18 11:56:24 +09:00
git
7757ccb504 * 2022-02-18 [ci skip] 2022-02-18 01:54:28 +09:00
Jeremy Evans
4c366ec977 Add Thread.each_caller_location
This method takes a block and yields Thread::Backtrace::Location
objects to the block.  It does not take arguments, and always
starts at the default frame that caller_locations would start at.

Implements [Feature #16663]
2022-02-17 08:54:07 -08:00
Nobuyoshi Nakada
4113862c00 Do not search for commands with double tool prefixes [Bug #18504]
The `CC` found by `AC_CHECK_TOOL` is prefixed by the host triplet
when cross compiling.  To search for commands with `AC_CHECK_TOOL`
based on that `CC` means to search also doubly prefixed names.
2022-02-17 22:47:02 +09:00
Nobuyoshi Nakada
992bdfea2d
Refine the load error message
Show the linked ruby library name when failed to load extension
built against different ruby library.
2022-02-17 20:29:50 +09:00
Nobuyoshi Nakada
5952a1f201
Check running macOS version at runtime 2022-02-17 20:29:50 +09:00
Nobuyoshi Nakada
c8b414b334
Reuse -v option result as target_platform
Backticks method invokes `/bin/sh` when the command contains
quotes, and `sh` clears some environment variables set in
runruby.rb to search the built shared library.
2022-02-17 20:12:38 +09:00
Kazuhiro NISHIYAMA
dfe7faa6b6
exclude name must be Regexp or Symbol
fdf0f8d814/tool/lib/test/unit.rb (L1273-L1290)
2022-02-17 19:04:16 +09:00
Koichi Sasada
fdf0f8d814 btest-ruby OPTS=-v should disable quiet
`make btest-ruby` is run with -q (quiet) option and -v should
remove -q option.
2022-02-17 18:58:37 +09:00
Hiroshi SHIBATA
9f81d9f92d Hide patchlevel from release build 2022-02-17 14:36:30 +09:00
Yusuke Endoh
5f01fba001 yjit_codegen.c: Prevent a possible out-of-bound access
The code attempts to read `C_ARG_REGS[leaf_builtin->argc + 1]`, and the
size of `C_ARG_REGS` is `NUM_C_ARG_REGS`.  So, the guard condition must
be `leaf_builtin->argc + 1 + 1 <= NUM_C_ARG_REGS`.

This change fixes the off-by-one error. This issue was found by Coverity
Scan.
2022-02-17 01:43:59 +09:00
git
fabf60c93b * 2022-02-17 [ci skip] 2022-02-17 00:34:19 +09:00
Alan Wu
797e8f542e
Fix -Wsign-compare when -DRUBY_DEBUG=1
Sizes for darray are size_t now. CC @peterzhu2118
2022-02-16 10:34:06 -05:00
Peter Zhu
969ad5802d Change feature_index from fake Array to darray
Using a fake (malloc) RArray is not friendly for the garbage
collector. Fake RArray does not have a heap page, so it causes Variable
Width Allocation to crash when we try to implement it on Arrays.

This commit changes feature_index from a RArray to a darray.
2022-02-16 09:50:29 -05:00
Peter Zhu
71afa8164d Change darray size to size_t and add functions that use GC malloc
Changes size and capacity of darray to size_t to support more
elements.

Adds functions to darray that use GC allocation functions.
2022-02-16 09:50:29 -05:00
Nobuyoshi Nakada
f9abb286fb Parenthesize a macro expression
The modulo in `rb_yjit_code_page_alloc` seems interpreted wrongly.
2022-02-16 09:43:54 -05:00
Koichi Sasada
00c7a0d491 fix parallel test timeout retrying
On the parallel test, workers can be killed because of timeout
and the information for the retrying can be inconsistent.
This patch will skip if the inconsistency is found and report
as an error.

http://ci.rvm.jp/results/trunk-asserts@phosphorus-docker/3834082
2022-02-16 17:57:04 +09:00
Yusuke Endoh
b9851c7e1b lib/securerandom.rb: Fix the check of availability of Random.urandom
Random.urandom raises a RuntimeError if it is unavailable.
[Bug #13885]
2022-02-16 16:32:28 +09:00
git
e7d76fe2b0 * 2022-02-16 [ci skip] 2022-02-16 13:32:13 +09:00
Koichi Sasada
1ae630db26 wmap#each should check liveness of keys
`ObjectSpace::WeakMap#each*` should check key's liveness.
fix [Bug #18586]
2022-02-16 13:31:46 +09:00
Peter Zhu
26187a8520 Use RARRAY_SHARED_ROOT_FLAG for checking re-enter
RARRAY_SHARED_ROOT_FLAG is defined as FL_USER5, but we should use
RARRAY_SHARED_ROOT_FLAG instead of depending on that they're equal.
2022-02-14 09:35:54 -05:00
Koichi Sasada
76e594d515 fix GC event synchronization
(1) gc_verify_internal_consistency() use barrier locking
    for consistency while `during_gc == true` at the end
    of the sweep on `RGENGC_CHECK_MODE >= 2`.
(2) `rb_objspace_reachable_objects_from()` is called without
    VM synchronization and it checks `during_gc != true`.

So (1) and (2) causes BUG because of `during_gc == true`.
To prevent this error, wait for VM barrier on `during_gc == false`
and introduce VM locking on `rb_objspace_reachable_objects_from()`.

http://ci.rvm.jp/results/trunk-asserts@phosphorus-docker/3830088
2022-02-14 17:17:55 +09:00
git
838031170c * 2022-02-14 [ci skip] 2022-02-14 14:52:39 +09:00
Koichi Sasada
8e0899919b extend timeout for mjit
1 seconeds is not enough on an specific (busy) machine w/ mjit.
http://ci.rvm.jp/results/trunk-mjit@phosphorus-docker/3830178
2022-02-14 14:52:12 +09:00
Nobuyoshi Nakada
7a8ea2e497
[MSWin] Install OpenSSL with vcpkg 2022-02-13 18:25:59 +09:00
Nobuyoshi Nakada
b4fd0e0c73
Exclude TestThread#test_signal_at_join on FreeBSD 13 for now [ci skip] 2022-02-13 17:39:57 +09:00
git
a9aa42ac64 * 2022-02-13 [ci skip] 2022-02-13 15:48:18 +09:00
Koichi ITO
045ab1d056 [DOC] Fix a typo in Integer#chr example
The current example raises the following error.

```ruby
0..chr # => undefined local variable or method `chr' for main:Object (NameError)
```

This PR updates the example to produce the expected behavior.

```ruby
0.chr # => "\x00"
```
2022-02-13 15:48:01 +09:00
Nobuyoshi Nakada
11862c1a7c
[MSWin] Remove stale configuration check [ci skip]
PSAPI library has not been used since d66c5768caaee16a0c2c2c641185.
2022-02-12 23:17:23 +09:00
Nobuyoshi Nakada
844a8355a1 [ruby/rdoc] Load YAML library for each test
https://github.com/ruby/rdoc/commit/a93e1bcd68
2022-02-12 17:13:06 +09:00
Nobuyoshi Nakada
3b3fb73d61 [ruby/rdoc] Dump plain objects as RDoc::Options
So that the generated `.rdoc_options` file is loadable.

https://github.com/ruby/rdoc/commit/6cf6e1647b
2022-02-12 16:15:08 +09:00
Nobuyoshi Nakada
11f3882173 [ruby/rdoc] Fix a test method name
https://github.com/ruby/rdoc/commit/8166b84cf3
2022-02-12 16:02:17 +09:00
Nobuyoshi Nakada
e95ad70079
[ruby/rdoc] Update generated files 2022-02-12 15:22:47 +09:00
Ulysse Buonomo
5348a34504 [ruby/rdoc] Relative loading for easier development (https://github.com/ruby/rdoc/pull/821)
This patch makes sure we only load relative code. Hence when coding or
testing rdoc, we'll be sure to always be using the correct code.

Discussion started at https://github.com/ruby/rdoc/pull/817.

Signed-off-by: Ulysse Buonomo <buonomo.ulysse@gmail.com>

https://github.com/ruby/rdoc/commit/aa41bd48eb

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-02-12 15:06:06 +09:00
Yusuke Endoh
08137c5dd9 [ruby/rdoc] Optimize RawLine by using a regexp instead of negative look-ahead rule
This improves the performance in some cases.
`rdoc .../gems/sinatra-2.1.0/README.md` takes 10.5 sec. before this
change, and 7.1 sec. after this change.
`make rdoc` of ruby/ruby takes 19.3 sec. before this change, 18.1 sec.
after this change.

https://github.com/ruby/rdoc/commit/7cf8281e3e
2022-02-12 14:59:26 +09:00
Nobuyoshi Nakada
6e65e04186
[DOC] Remove unnecessary rdoc-ref: schemes 2022-02-12 12:38:37 +09:00
Nobuyoshi Nakada
50c972a1ae
[DOC] Simplify operator method references 2022-02-12 12:38:36 +09:00
S-H-GAMELINKS
e6b537e605 Reuse operation rule for operation2 2022-02-12 12:28:07 +09:00
S-H-GAMELINKS
c0651b4ae1 Reuse p_kwnorest rule for f_no_kwarg 2022-02-12 12:27:49 +09:00
Steven Nunez
68be9a9ae8 Fix Typo 2022-02-12 10:43:27 +09:00
git
ee3b7a1a8c * 2022-02-12 [ci skip] 2022-02-12 00:36:39 +09:00
Yusuke Endoh
118769d028 test/ruby/test_exception.rb: prevent "assigned but unused variable" 2022-02-12 00:36:01 +09:00
Ilia Zenkevich
e92e87bf90 [rubygems/rubygems] Add clarification for bundle-config "with" option
https://github.com/rubygems/rubygems/commit/666f3cc724
2022-02-11 18:49:57 +09:00
David Rodríguez
7b676b3ce3 [rubygems/rubygems] Fix corrupted lockfile when using gemspec and multiple sources
https://github.com/rubygems/rubygems/commit/9712262d90
2022-02-11 18:20:20 +09:00