Commit graph

67273 commits

Author SHA1 Message Date
Nobuyoshi Nakada
5dc36ddcd0
Add out of range tests for Array#slice! 2021-08-29 10:33:22 +09:00
git
7731be94eb * 2021-08-29 [ci skip] 2021-08-29 09:41:46 +09:00
Mike Dalessio
d43279edac Fix length calculation for Array#slice!
Commit 4f24255 introduced a bug which allows a length to be passed to
rb_ary_new4 which is too large, resulting in invalid memory access.

For example:

    (1..1000).to_a.slice!(-2, 1000)
2021-08-29 09:41:22 +09:00
Lars Kanis
7e36b91526 Add Windows as a supported OS for Process.clock_gettime [ci skip] 2021-08-28 18:26:19 +09:00
git
f4b73f77ef * 2021-08-28 [ci skip] 2021-08-28 18:22:29 +09:00
Nobuyoshi Nakada
394498b878
[Windows CI] Stop VS-2022
We have previewed it, and know it doesn't work well now.
2021-08-28 18:21:47 +09:00
Nobuyoshi Nakada
47a2ea4df5
[Windows CI] Stop on error in VS-2022 2021-08-28 18:21:44 +09:00
Nobuyoshi Nakada
76e8cfd158
[Windows CI] Setup env 2021-08-28 18:21:39 +09:00
Peter Zhu
ed31bdfeee Fix memory leak in Variable Width Allocation
Force recycled objects could create a freelist for the page. At the
start of sweeping we should append to the freelist to avoid
permanently losing the slots on the freelist.
2021-08-27 10:13:32 -04:00
Nobuyoshi Nakada
3562c7ba33
Update the list of replacing objects under missing 2021-08-27 12:43:45 +09:00
Nobuyoshi Nakada
80c1faf076
Use C99-defined signbit macro 2021-08-27 12:42:23 +09:00
Nobuyoshi Nakada
04be8e84db
Use C99-defined macros to classify a floating-point number 2021-08-27 12:41:30 +09:00
Nobuyoshi Nakada
3711467362
[Windows CI] Set PATCH path 2021-08-27 09:34:53 +09:00
Nobuyoshi Nakada
a2831cf247
[Windows CI] Make test-all parallel and verbose 2021-08-27 09:34:53 +09:00
Nobuyoshi Nakada
8a754bc5c9
[Windows CI] Group nmake step 2021-08-27 09:34:53 +09:00
Nobuyoshi Nakada
fbdd1c6a79
[Windows CI] Moved parameters to include 2021-08-27 09:34:52 +09:00
git
db4bfdfb4c * 2021-08-27 [ci skip] 2021-08-27 09:16:40 +09:00
Henrik Nyh
19ab24a064 [DOC] Fix a typo in Dir.fnmatch 2021-08-27 09:16:25 +09:00
Kazuhiro NISHIYAMA
ef10e8a1eb Use patch installed by msys2/setup-msys2 2021-08-26 19:47:48 +09:00
Kazuhiro NISHIYAMA
79a3e89dae Use bundled libffi on windows-2022 2021-08-26 19:47:48 +09:00
Kazuhiro NISHIYAMA
5550c2719a Install patch
Because patch does not installed on windows-2022.

https://github.com/actions/virtual-environments/issues/3949
> Only pure MSYS2 is installed. No additional packages
2021-08-26 19:47:48 +09:00
Kazuhiro NISHIYAMA
69615251f9 Ignore errors on windows-2022
https://github.com/ruby/ruby/pull/4775/checks?check_run_id=3419490832#step:13:38
2021-08-26 19:47:48 +09:00
Kazuhiro NISHIYAMA
d96ba8c5c3 Use newer libffi on windows-2022 2021-08-26 19:47:48 +09:00
Kazuhiro NISHIYAMA
b1f58d3e91 Set VCVARS 2021-08-26 19:47:48 +09:00
Kazuhiro NISHIYAMA
5e65f31b5a Add Windows Server 2022 with Visual Studio 2022
https://github.blog/changelog/2021-08-23-github-actions-windows-server-2022-with-visual-studio-2022-is-now-available-on-github-hosted-runners-public-beta/
2021-08-26 19:47:48 +09:00
Lars Kanis
9c0582704f Fix example fiber scheduler reg. writable events
There were two issues:

1. When an IO object is waiting for writablility only (as in test_tcp_accept) the selected hash is empty.
   Therefore selected[fiber] returns nil but needs to default to 0 in order to be or'ed with IO::WRITABLE.

2. When an IO object is waiting for read- or writability (as in test_tcp_connect), but only one of these
   two events arrive, the Fiber and IO object need to be removed from the other `@readable` or `@writable` list.
2021-08-26 21:49:12 +12:00
Sutou Kouhei
a2ad0cb7b4 Make Hash#each family usable in Ractor
We don't need to increment/decrement iteration level for frozen Hash
because frozen Hash can't be modified. We can assume that nobody
changes the target Hash while calling #each family.

How to reproduce:

    a = {}
    100.times do |i|
      a[i] = true
    end
    Ractor.make_shareable(a)

    4.times.collect do
      Ractor.new(a) do |b|
        100.times do
          b.each_value do
          end
        end
      end
    end.each(&:take)

Example output:

    internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
    #<Thread:0x00007fcfb087bb30 run> terminated with exception (report_on_exception is true):
    #<Thread:0x00007fcfb087b8d8 run> terminated with exception (report_on_exception is true):
    #<Thread:0x00007fcfb088d678 run> terminated with exception (report_on_exception is true):
    #<Thread:0x00007fcfb087bd88 run> terminated with exception (report_on_exception is true):
    /tmp/h.rb:10:in `each_value'/tmp/h.rb:10:in `each_value': : /tmp/h.rb:10:in `each_value'no implicit conversion from nil to integer/tmp/h.rb:10:in `each_value'no implicit conversion from nil to integer (: :  (TypeErrorTypeError)no implicit conversion from nil to integer)no implicit conversion from nil to integer (

     (TypeErrorTypeError	from /tmp/h.rb:10:in `block (3 levels) in <main>'
    	from /tmp/h.rb:10:in `block (3 levels) in <main>'
    ))	from /tmp/h.rb:9:in `times'

    	from /tmp/h.rb:9:in `times'

    	from /tmp/h.rb:9:in `block (2 levels) in <main>'
    	from /tmp/h.rb:10:in `block (3 levels) in <main>'
    	from /tmp/h.rb:10:in `block (3 levels) in <main>'
    	from /tmp/h.rb:9:in `block (2 levels) in <main>'
    	from /tmp/h.rb:9:in `times'
    	from /tmp/h.rb:9:in `times'
    	from /tmp/h.rb:9:in `block (2 levels) in <main>'
    	from /tmp/h.rb:9:in `block (2 levels) in <main>'
    <internal:ractor>:694:in `take': thrown by remote Ractor. (Ractor::RemoteError)
    	from /tmp/h.rb:14:in `each'
    	from /tmp/h.rb:14:in `<main>'
    /tmp/h.rb:10:in `each_value': no implicit conversion from nil to integer (TypeError)
    	from /tmp/h.rb:10:in `block (3 levels) in <main>'
    	from /tmp/h.rb:9:in `times'
    	from /tmp/h.rb:9:in `block (2 levels) in <main>'
2021-08-26 13:29:58 +09:00
git
27410eaeb2 * 2021-08-26 [ci skip] 2021-08-26 10:24:21 +09:00
Kevin Newton
f4b88959d5 Clean up lambda output from exyacc.rb
The `lambda_body` grammar rule has a `"}"`, which is throwing off the `exyacc.rb` regular expressions. This changes the regular expression to account for `"}"` as well, which makes the output of `ruby sample/exyacc.rb < parse.y` change by the following diff:

```diff
632,634d631
< 		    ", &@3);
< 			$$ = $2;
< 		    }
```

Which makes it closer to a valid EBNF.
2021-08-25 18:23:56 -07:00
Peter Zhu
62bc4a9420 [Feature #18045] Implement size classes for GC
This commits implements size classes in the GC for the Variable Width
Allocation feature. Unless `USE_RVARGC` compile flag is set, only a
single size class is created, maintaining current behaviour. See the
redmine ticket for more details.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-08-25 09:28:21 -04:00
Peter Zhu
c08d4067be [Feature #18045] Remove T_PAYLOAD
This commit removes T_PAYLOAD since the new VWA implementation no longer
requires T_PAYLOAD types.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-08-25 09:28:21 -04:00
Yuta Saito
01be881f35 Use empty instead of NOOP in mk file to make it safer
This would avoid unintentional use of the `NOOP` environment variable

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-08-25 18:47:44 +09:00
Yuta Saito
d1f0d1ca2e Fix build failure on macOS with --enable-shared
./spec/ruby/optional/capi/ext/array_spec.c can match with spec/%/ if
using GNU Make under version 3.81. make command installed on macOS is
3.81, so ruby can't be built with default make on macOS with
  --enable-shared option since bda56a03a6
2021-08-25 18:47:44 +09:00
Nobuyoshi Nakada
c4c0b60d92
Add missing empty macro [ci skip] 2021-08-25 18:28:27 +09:00
Hiroshi SHIBATA
384c0f57aa
Added bundle install before bundle exec on rdoc sync 2021-08-25 15:02:29 +09:00
Yusuke Endoh
b44741f5dc tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf
Formerly, TypeProf was tested with the latest RBS code during
`make test-bundled-gems`. However, when a new version of rbs is
released, and if it is incompatible with TypeProf,
`make test-bundled-gems` starts failing, which was annoying.

By this change, TypeProf is tested with the bundled version of RBS.
2021-08-25 11:13:17 +09:00
git
716624660b * 2021-08-25 [ci skip] 2021-08-25 00:36:23 +09:00
Jeremy Evans
14a9c364f7 Fix warnings in test_optimization.rb
These were introduced in the test for tracing optimized methods
added in 48c8df9e0e.
2021-08-24 08:34:48 -07:00
Peter Zhu
bbedd29b6e [Bug #18117] Fix Ractor race condition with GC
rb_objspace_reachable_objects_from requires that the GC not be active.
Since the Ractor barrier is not executed for incremental sweeping,
Ractor may call rb_objspace_reachable_objects_from after sweeping
has started to share objects. This causes a crash that looks like
the following:

```
<internal:ractor>:627: [BUG] rb_objspace_reachable_objects_from() is not supported while during_gc == true
```

Co-authored-by: Vinicius Stock <vinicius.stock@shopify.com>
2021-08-24 09:47:42 -04:00
Nobuyoshi Nakada
b62ed309f0 [ruby/securerandom] [DOC] fix a code mark up [ci skip]
de47532707
2021-08-24 19:29:54 +09:00
Yusuke Endoh
4a6b5f4622 Revert "tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf"
This reverts commit 22deda43cb.

It was incomplete. Sorry!
2021-08-24 18:08:16 +09:00
Olle Jonsson
80597f2544
[ruby/un] gemspec: Explicitly list 0 executables
This gem exposes no executables, so this makes that clear to the reader.

012c298e12
2021-08-24 18:02:44 +09:00
Hiroshi SHIBATA
b126a27d8c
[ruby/un] LICENSE
762c38c176
2021-08-24 18:02:44 +09:00
Kazuhiro NISHIYAMA
2eed62fb65
[ruby/un] Use STDIN if no arguments
8e0d6f62cb
2021-08-24 18:02:44 +09:00
Kazuhiro NISHIYAMA
66abeb0370
[ruby/un] Add colorize command
4d080eeec0
2021-08-24 18:02:44 +09:00
Hiroshi SHIBATA
d140b03053
Added ruby/un entry 2021-08-24 18:02:44 +09:00
Jun Aruga
2be84afea5 .github/workflows/compilers.yml: Specify a container running user as root.
Explicitly specify the root as a user to run tests in the containers.

Coming new ruby/ruby-ci-image images are required to run the container as
a regular user by default, while the root user is required to run the
compilers.yml. Add `id` command to print the user info.

Co-authored-by: fedor <fedor@cirruslabs.org>
2021-08-24 10:55:24 +02:00
Yusuke Endoh
22deda43cb tool/test-bundled-gems.rb: Use the bundled RBS code to test TypeProf
Formerly, TypeProf was tested with the latest RBS code during
`make test-bundled-gems`. However, when a new version of rbs is
released, and if it is incompatible with TypeProf,
`make test-bundled-gems` starts failing, which was annoying.

By this change, TypeProf is tested with the bundled version of RBS.
2021-08-24 17:43:11 +09:00
Nobuyoshi Nakada
bcc5a2b67e [ruby/fiddle] Simplify libc and libm path logics (https://github.com/ruby/fiddle/pull/91)
* Simplify libc_so and libm_so

If nil, no need to set to nil.

* Get rid of repeating inversions

4323e689d8
2021-08-24 16:18:24 +09:00
Aaron Patterson
0f1e8f38c9 [ruby/fiddle] Improve "offsetof" calculations (https://github.com/ruby/fiddle/pull/90)
I need to get the offset of members inside sub structures.  This patch
adds sub-structure offset support for structs.

cf78eddbb6
2021-08-24 16:18:22 +09:00