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

15809 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada d010eba2f4
Fix tests for ABI incompatible binary error messags 2022-07-17 10:18:08 +09:00
Nobuyoshi Nakada 5ae83151b1 [rubygems/rubygems] Drop support for old `Gem::Specification` versions
`specification_version` method was added before RubyGems 1.0, and
`add_runtime_dependency` method was before 1.2.  These seem aged
enough to remove.

https://github.com/rubygems/rubygems/commit/92770c5cd9
2022-07-16 19:33:16 +09:00
Noah Gibbs aed1539ec5
YJIT: Add send unit tests (#6143)
Add send unit tests for YJIT
2022-07-15 13:52:47 -04:00
st0012 36ca0e58b6 [ruby/reline] Use color name instead of code (integer) in dialog color APIs
As pointed out in the
[comment](https://github.com/ruby/reline/pull/413#issuecomment-1168033973),
the code is actually a control sequence and not only for colors.

To make the dialog color APIs safer to use, we should restrict its
usages and extract away the bg/fg concept from the input.

So in this commit, I made these changes:

1. The dialog_*_bg/fg_color APIs only takes and returns color names (symbol):
  - :black
  - :red
  - :green
  - :yellow
  - :blue
  - :magenta
  - :cyan
  - :white
2. Add additional dialog_*_bg/fg_color_sequence APIs to access the raw code.

https://github.com/ruby/reline/commit/b32a977766
2022-07-16 02:30:23 +09:00
Peter Zhu 7424ea184f Implement Objects on VWA
This commit implements Objects on Variable Width Allocation. This allows
Objects with more ivars to be embedded (i.e. contents directly follow the
object header) which improves performance through better cache locality.
2022-07-15 09:21:07 -04:00
Takashi Kokubun 439d31bc77
MJIT: Merge mjit_worker.c back to mjit.c (#6138)
Since #6006, we no longer avoid executing GC on mjit_worker.c and thus
there's no need to carefully change how we write code whether you're in
mjit.c or mjit_worker.c anymore.
2022-07-14 20:34:46 -07:00
Nobuyoshi Nakada 8b64e8f2ed [ruby/set] Get rid of use of `Gem::Version`
When retrying in ruby's test, it seems possible that `Gem` is not
loaded.

```
  1) Error:
TC_Set_Builtin#test_to_set:
NameError: uninitialized constant TC_Set_Builtin::Gem
    /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:844:in `should_omit?'
    /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:869:in `test_to_set'

  2) Error:
TC_Set_Builtin#test_Set:
NameError: uninitialized constant TC_Set_Builtin::Gem
    /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:844:in `should_omit?'
    /export/home/chkbuild/chkbuild-gcc/tmp/build/20220708T070011Z/ruby/test/test_set.rb:849:in
    `test_Set'
```

This is by `Gem::Version` only, just compare as array of integers
instead.

https://github.com/ruby/set/commit/cde0a4bbc7
2022-07-14 17:13:52 +09:00
Jean Boussier 664c23db79 GVL Instrumentation: remove the EXITED count assertion
It's very flaky for some unknown reason. Something we have
an extra EXITED event. I suspect some other test is causing this.
2022-07-13 19:39:31 +02:00
Jean Boussier 268269687c thread/test_instrumentation_api: cleanup all existing threads in setup
We saw the following failure:
```
TestThreadInstrumentation#test_thread_instrumentation [/tmp/ruby/v3/src/trunk-random3/test/-ext-/thread/test_instrumentation_api.rb:25]:
Expected 0..3 to include 4.
```

Which shouldn't happen unless somehow there was a leaked thread.
2022-07-13 14:13:41 +02:00
Hiroshi SHIBATA 437a5ae9d6 Merge RubyGems and Bundler master 2022-07-13 14:11:55 +09:00
Matt Valentine-House 067a5f1a00 [Feature #18901] Don't run size pool move tests without VWA 2022-07-12 08:50:33 -04:00
Matt Valentine-House 214ed4cbc6 [Feature #18901] Support size pool movement for Arrays
This commit enables Arrays to move between size pools during compaction.
This can occur if the array is mutated such that it would fit in a
different size pool when embedded.

The move is carried out in two stages:

1. The RVALUE is moved to a destination heap during object movement
   phase of compaction
2. The array data is re-embedded and the original buffer free'd if
   required. This happens during the update references step
2022-07-12 08:50:33 -04:00
Nobuyoshi Nakada 0f8a0c5f37 Refactor tests for ThreadInstrumentation counters
* Extracted some assertions.
* Assert counter values should be positive.
2022-07-12 19:43:11 +09:00
Nobuyoshi Nakada a6e2f3fd8d Use `IO.popen` to fork and exit the child process without cleanup 2022-07-12 19:43:11 +09:00
dependabot[bot] 6e74c5c268 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.18 to 0.9.19.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.18...v0.9.19)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/962c717083
2022-07-12 04:57:50 +09:00
dependabot[bot] ea956e5e68 [rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_builder/custom_name
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.18 to 0.9.19.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.18...v0.9.19)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/186d2b83f1
2022-07-12 02:52:17 +09:00
Yusuke Endoh a871fc4d86 Fix a regression of b2e58b02ae
At that commit, I fixed a wrong conditional expression that was always
true.  However, that seemed to have caused a regression. [Bug #18906]

This change removes the condition to make the code always enabled.
It had been enabled until that commit, albeit unintentionally, and even
if it is enabled it only consumes a tiny bit of memory, so I believe it
is harmless. [Bug #18906]
2022-07-11 23:38:37 +09:00
st0012 2733c04967 [ruby/reline] Add tests for top-level dialog color APIs
https://github.com/ruby/reline/commit/347a468c59
2022-07-11 22:19:44 +09:00
Matt Valentine-House 6423d32e3b Replace use of double_heap in tests with expand_heap 2022-07-11 09:00:03 -04:00
Takashi Kokubun fae568edbe
Use NO_JIT_DESCRIPTION only when needed
Apparently 203801566a broke YJIT's CI.
2022-07-10 23:58:19 -07:00
Takashi Kokubun 203801566a
Fix #5872 for MJIT GitHub Actions
If you run tests with RUN_OPTS=--mjit, the test fixes in
https://github.com/ruby/ruby/pull/5872 don't work.
2022-07-10 23:10:36 -07:00
Nobuyoshi Nakada da21a2c388 [ruby/rdoc] `RubyVM` is implementation dependent
https://github.com/ruby/rdoc/commit/aaeb5ce1ce
2022-07-11 13:43:15 +09:00
Nobuyoshi Nakada b564ef3698 [ruby/rdoc] Fix the known classes more
https://github.com/ruby/rdoc/commit/9f47234e0e
2022-07-11 13:43:14 +09:00
Nobuyoshi Nakada 86df6f4bb3 [ruby/rdoc] Fix an exception class name
https://github.com/ruby/rdoc/commit/87301da71b
2022-07-11 13:14:06 +09:00
Nobuyoshi Nakada 949c3afb48 [ruby/openssl] Skip a new test when old OpenSSL
It does not raise an error when setting an invalid value to SSLContext
ciphers on Ubuntu 18.04.

https://github.com/ruby/openssl/commit/8c96a69b0d
2022-07-09 15:26:32 +09:00
Nobuyoshi Nakada d77ebe8eea
[ruby/openssl] Strip trailing spaces [ci skip]
https://github.com/ruby/openssl/commit/862d92de93
2022-07-09 00:39:18 +09:00
Jarek Prokop 4d6a29320d [ruby/openssl] Let OpenSSL choose the digest if digest for Openssl::OCSP::BasicResponse#sign is nil.
https://github.com/ruby/openssl/commit/27efcd7e1c
2022-07-08 23:18:22 +09:00
Jeremy Evans def445303a [ruby/openssl] Fix test of cipher name to pass in LibreSSL 3.4
LibreSSL 3.5 switched the cipher naming to match OpenSSL.

https://github.com/ruby/openssl/commit/bf198278bd
2022-07-08 23:18:18 +09:00
twkmd12 09daf78fb5 [ruby/openssl] Add 'ciphersuites=' method to allow setting of TLSv1.3 cipher suites along with some unit tests (https://github.com/ruby/openssl/pull/493)
Add OpenSSL::SSL::SSLContext#ciphersuites= method along with unit tests.

https://github.com/ruby/openssl/commit/12250c7cef
2022-07-08 23:18:11 +09:00
Jeremy Evans 01025a0055 [ruby/openssl] Skip optional wildcard SAN tests on LibreSSL 3.5.0+
RFC 6066 states how some wildcard SAN entries MAY be handled, but
it does not say they MUST be handled.  LibreSSL 3.5.0 only handles
suffix wildcard SANs, not prefix wildcard SANs, or interior
wildcard SANs, so return early from the wildcard SAN tests on
LibreSSL 3.5.0.

Fixes #471

https://github.com/ruby/openssl/commit/717d7009d6
2022-07-08 23:18:07 +09:00
Nobuyoshi Nakada 4a2662ae8b
[Bug #18890] Suppress warnings and fix the message
```
test/ruby/test_parse.rb:1384: warning: assigned but unused variable - obj
test/ruby/test_pattern_matching.rb:1162: warning: unused literal ignored
test/ruby/test_pattern_matching.rb:1165: warning: unused literal ignored
test/ruby/test_pattern_matching.rb:1161: warning: assigned but unused variable - a
test/ruby/test_pattern_matching.rb:1164: warning: assigned but unused variable - b
```

And a newline should be significant here.
2022-07-08 11:31:51 +09:00
Nobuyoshi Nakada f1c15f3e94
Relax assertion condition for thread local counters
Recently `TestThreadInstrumentation#test_join_counters` often fails as

```
<[1, 1, 1]> expected but was
<[2, 2, 2]>.
```

Probably it seems that the thread is suspended more than once.
There may be no guarantee that the subject thread never be suspended
more than once.
2022-07-08 10:55:44 +09:00
Jean Boussier 65ae2bb2e0 Thread#value: handle threads killed by a fork
[Bug #18902]

When a thread is killed because we forked, the `value` if left
to `Qundef`. Returning it woudl crash the VM.
2022-07-07 19:49:25 +02:00
Jean Boussier 587d2d199b thread_pthread.c: call SUSPENDED event when entering native_sleep
[Bug #18900]

Thread#join and a few other codepaths are using native sleep as
a way to suspend the current thread. So we should call the relevant
hook when this happen, otherwise some thread may transition
directly from `RESUMED` to `READY`.
2022-07-07 17:49:00 +02:00
Nobuyoshi Nakada cd94842922 [Bug #18892] Reset `ARGF.lineno` after reading shebang 2022-07-07 11:33:07 +09:00
Burdette Lamar 7ba5c0633c [ruby/pstore] Emphasize keys instead of roots, values instead of objects (https://github.com/ruby/pstore/pull/7)
Modifies RDoc to Emphasize keys instead of roots, values instead of objects.

Code:

    Renames method #root? to #key? and method #roots to #keys.
    Aliases method #key as #root and method #keys as #roots.
    Adds testing for all four methods.

https://github.com/ruby/pstore/commit/4436ea0891
2022-07-07 07:05:01 +09:00
Nobuyoshi Nakada 5ef3c7ea2d
[Bug #18898] Fallback invalid external encoding to the default 2022-07-06 18:08:31 +09:00
Nobuyoshi Nakada eaeb130b11 [Bug #18890] newline should be insignificant after pattern label 2022-07-06 08:32:36 +09:00
Brian Le 902d1a5c51 [rubygems/rubygems] add message when gems are requested to be updated but they are not installed
https://github.com/rubygems/rubygems/commit/27953ffe9a
2022-07-06 02:59:14 +09:00
Brian Le 6eab8095fa [rubygems/rubygems] output gems already up-to-date regardless if any gems were updated
https://github.com/rubygems/rubygems/commit/4ec608a573
2022-07-06 02:59:13 +09:00
Nobuyoshi Nakada babdb158d1
Synchronize the test thread not to die before assertions 2022-07-05 13:50:45 +09:00
dependabot[bot] ed76ba35dd [rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_builder/custom_name
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.15 to 0.9.18.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.15...v0.9.18)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/a862203683
2022-07-05 09:45:42 +09:00
dependabot[bot] 94aff13f88 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.15 to 0.9.18.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.15...v0.9.18)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/db8486a61e
2022-07-05 09:45:03 +09:00
Jean Boussier 890df5f812 ObjectSpace.dump: Include string coderange
I suspect that some shared pages are invalidated because
some static string don't have their coderange set eagerly.

So the first time they are scanned, the entire memory page is
invalidated.

Being able to see the coderange in `ObjectSpace` would help debug
this.

And in addition `dump` currently call `is_broken_string()`  and `is_ascii_string()`
which both end up scanning the string and assigning coderange. I think it's
undesirable as `dump` should be read only.
2022-07-04 20:04:59 +02:00
Nobuyoshi Nakada 302f353fd9 [ruby/stringio] Fix the result of `StringIO#truncate` so compatible with `File`
https://github.com/ruby/stringio/commit/16847fea32
2022-07-01 00:52:29 +09:00
Yusuke Endoh 8eb5198ccc [rubygems/rubygems] Prevent a warning: `*' interpreted as argument prefix
http://rubyci.s3.amazonaws.com/ubuntu2004-arm/ruby-master/log/20220630T063003Z.log.html.gz
```
[19606/21662] TestAst#test_not_cared:test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb(none):18: warning: `*' interpreted as argument prefix
(none):19: warning: `*' interpreted as argument prefix
 = 0.00 s
```

https://github.com/rubygems/rubygems/commit/c98f9326e8
2022-06-30 18:53:20 +09:00
Nobuyoshi Nakada 982cda9a3e [Bug #18877] Let `lex_ctxt` not to eat escaped whitespace 2022-06-30 16:31:51 +09:00
Peter Zhu 66eb58d6bd Refactor tests for moving strings with compaction 2022-06-29 15:11:53 -04:00
Nobuyoshi Nakada 685efac059
[Bug #18884] `class` cannot be just followed by modifiers 2022-06-29 14:13:15 +09:00
Ian Ker-Seymer 3051d4bc2a [rubygems/rubygems] Support ruby 2.3 and 2.4
https://github.com/rubygems/rubygems/commit/3a9205df36
2022-06-29 09:53:14 +09:00
Ian Ker-Seymer 50e576292b [rubygems/rubygems] Upgrade rb-sys to 0.9.14
https://github.com/rubygems/rubygems/commit/c9adf3ef1c
2022-06-29 09:53:14 +09:00
David Rodríguez a16de43f23 [rubygems/rubygems] Add `gem env user_gemhome` and `gem env user_gemdir`
https://github.com/rubygems/rubygems/commit/14d3f80df6
2022-06-29 03:25:46 +09:00
David Rodríguez f0fab24241 [rubygems/rubygems] Add missing test for user installation directory
https://github.com/rubygems/rubygems/commit/5ab8aa2a45
2022-06-29 03:25:46 +09:00
st0012 a415a3de05 [ruby/irb] Properly reset USE_COLORIZE after changing it in tests
Some context tests assigns USE_COLORIZE to false and never change it
back. This can potentially affect other tests' result as the default
should be nil (activated) instead.

https://github.com/ruby/irb/commit/986eb16ece
2022-06-29 00:23:18 +09:00
Tomas Volf 69337a65b2 [rubygems/rubygems] Fix test_install_location_extra_slash on alpine
Under POSIX behavior of leading // is implementation defined. Musl does
preserve it in realpath, glibc does not. That means the test was failing
when executed on alpine linux. Original issue #508 was about // in the
path, not about leading ones. When executed in such environment, the
test will still test what it should when the explicit mangling of the
path is not done.

Fixes #5652

https://github.com/rubygems/rubygems/commit/0fa7373bf6
2022-06-28 23:31:33 +09:00
Stan Lo 44c1316293 [ruby/irb] Centralize coloring control (https://github.com/ruby/irb/pull/374)
* Use colorable: argument as the only coloring control

* Centalize color controling logic at Color.colorable?

There are 2 requirements for coloring output:

1. It's supported on the platform
2. The user wants it: `IRB.conf[:USE_COLORIZE] == true`

Right now we check 1 and 2 separately whenever we colorize things.
But it's error-prone because while 1 is the default of `colorable`
parameter, 2 always need to manually checked. When 2 is overlooked, it
causes issues like https://github.com/ruby/irb/pull/362

And there's 0 case where we may want to colorize even when the user
disables it. So I think we should merge 2 into `Color.colorable?` so it
can be automatically picked up.

* Add tests for all inspect modes

* Simplify inspectors' coloring logic

* Replace use_colorize? with Color.colorable?

* Remove Context#use_colorize cause it's redundant

https://github.com/ruby/irb/commit/1c53023ac4
2022-06-28 22:30:42 +09:00
Nobuyoshi Nakada 131422ceea [ruby/rdoc] Support attributes defined by `rb_struct_define`
https://github.com/ruby/rdoc/commit/854b370763
2022-06-28 20:17:30 +09:00
Nobuyoshi Nakada 51be2cf6d2 [ruby/rdoc] Parse also InitVM-prefixed functions
Initialization depending on VM is separated.

https://github.com/ruby/rdoc/commit/030d10fccd
2022-06-28 14:51:49 +09:00
pocari 8c6c3e30f3 [ruby/reline] Enable to change the background color of dialogs. (https://github.com/ruby/reline/pull/413)
https://github.com/ruby/reline/commit/bd49537964
2022-06-27 22:28:49 +09:00
David Rodríguez f83c5de6d5 [rubygems/rubygems] Improve error message when `operating_system.rb` fails to load
Show an absolute path instead of an unhelpful relative path.

https://github.com/rubygems/rubygems/commit/f1eed36e2f
2022-06-27 17:03:24 +09:00
Takashi Kokubun 232e2f5981
Skip TupleSpaceProxyTest on MINGW64 too
It wasn't specific to UCRT64

https://github.com/ruby/ruby/runs/7062992464
2022-06-26 21:00:04 -07:00
Alan Wu 49d5921550 Fix Rinda test teardown for omitted tests
New test failures on MINGW appeared after
c2e37c8ff7.

      1) Error:
    Rinda::TupleSpaceProxyTest#test_00_template:
    NoMethodError: undefined method `stop_service' for nil:NilClass
        D:/a/ruby/ruby/src/test/rinda/test_rinda.rb:516:in `teardown'

      2) Error:
    Rinda::TupleSpaceProxyTest#test_ruby_talk_264062:
    NoMethodError: undefined method `stop_service' for nil:NilClass
        D:/a/ruby/ruby/src/test/rinda/test_rinda.rb:516:in `teardown'

Teardown happens even when the test is omitted.

See: https://github.com/ruby/ruby/runs/7058984522
2022-06-26 09:24:22 -04:00
Takashi Kokubun c2e37c8ff7
Try skipping TupleSpaceProxyTest on MinGW UCRT64
As you all know, MinGW UCRT64 CI has randomly got stuck despite its
"Finished tests" output.

Looking at the logs closely, it seems like all of the recent such
reproductions end with the following output:

```
  Retrying hung up testcases...
  [ 1/14] Rinda::TupleSpaceProxyTest#test_ruby_talk_264062 = 0.21 s
  [ 2/14] Rinda::TupleSpaceProxyTest#test_00_template = 0.01 s
  [ 3/14] Rinda::TupleSpaceProxyTest#test_inp_rdp = 0.00 s
  [ 4/14] Rinda::TupleSpaceProxyTest#test_core_03_notify = 0.01 s
  [ 5/14] Rinda::TupleSpaceProxyTest#test_00_renewer = 0.01 s
  [ 6/14] Rinda::TupleSpaceProxyTest#test_cancel_02 = 0.11 s
  [ 7/14] Rinda::TupleSpaceProxyTest#test_00_DRbObject = 0.00 s
  [ 8/14] Rinda::TupleSpaceProxyTest#test_core_02 = 0.11 s
  [ 9/14] Rinda::TupleSpaceProxyTest#test_core_01 = 0.11 s
  [10/14] Rinda::TupleSpaceProxyTest#test_remote_array_and_hash = 0.01 s
  [11/14] Rinda::TupleSpaceProxyTest#test_00_tuple = 0.00 s
  [12/14] Rinda::TupleSpaceProxyTest#test_take_bug_8215 = 0.41 s
  [13/14] Rinda::TupleSpaceProxyTest#test_cancel_01 = 0.11 s
  [14/14] Rinda::TupleSpaceProxyTest#test_symbol_tuple = 0.01 s
  Finished tests in 719.252845s, 29.4292 tests/s, 3838.7154 assertions/s.
  21167 tests, 2761007 assertions, 0 failures, 0 errors, 708 skips
```

https://github.com/ruby/ruby/runs/7057789554

While it seems to be retried successfully, given that it hungs up once
and this appears all the time, this test class seems a bit suspicious.
To check if it's related, let me try disabling this for now.
2022-06-25 23:36:14 -07:00
Nobuyoshi Nakada 0e5f9afff6 [ruby/irb] Set prompt mode explictly
Fix https://github.com/ruby/irb/pull/353

https://github.com/ruby/irb/commit/7db93f9326
2022-06-26 15:23:33 +09:00
Nobuyoshi Nakada a2b3f2014c [ruby/irb] Require stringio to use StringIO
https://github.com/ruby/irb/commit/e024ab716b
2022-06-26 15:23:32 +09:00
Peter Jones e0bfdb23af [ruby/irb] Ensure stdout is a TTY before calling winsize
When outputting a (possibly truncated) value, IRB will query the
window size.  However, if IRB was piped to another process, stdout
will no longer be a TTY and will not support the `winsize` method.

This fix ensure that stdout is a TTY.

https://github.com/ruby/irb/commit/125de5eeea
2022-06-26 14:40:48 +09:00
Tomas Volf 56809537a4 [rubygems/rubygems] Clean up temporary directory after generate_index --update
While generate_index did clean up temporary directory, when running with
--update flag, that did not happen and the temporary directory was left
behind.

This commit fixes that and modifies tests in order to make sure this is
not reintroduced later on.

Fixes #5635.

https://github.com/rubygems/rubygems/commit/9fa34dc329
2022-06-26 11:15:43 +09:00
Samuel Williams d281347abb [ruby/io-wait] Fix usage of `assert_raises` -> `assert_raise`. (https://github.com/ruby/io-wait/pull/20)
https://github.com/ruby/io-wait/commit/c5c6abbb5c
2022-06-25 17:12:26 +09:00
git 7e68762446 * remove trailing spaces. [ci skip] 2022-06-25 16:22:07 +09:00
Samuel Williams f9c8d80883 [ruby/io-wait] Don't add `IO#wait*` methods when `RUBY_IO_WAIT_METHODS` is defined by Ruby. (https://github.com/ruby/io-wait/pull/19)
* Fix return value compatibility with Ruby 2.x.

* Don't add `IO#wait*` methods in Ruby 3.2+.

https://github.com/ruby/io-wait/commit/54c504d089
2022-06-25 16:21:54 +09:00
David Rodríguez 12a5fa408b Sync RubyGems & Bundler with upstream repo 2022-06-24 10:52:02 +09:00
Alan Wu 744d17ff6c Fix infinite loop when b_return TracePoint throws
Previously, we didn't pop the frame that runs the TracePoint hook for
b_return events for blocks running as methods (bmethods). In case the
hook raises, that formed an infinite loop during stack unwinding in
hook_before_rewind().

[Bug #18060]
2022-06-22 08:30:39 -04:00
Chris Seaton 31b2cd38c5 Include JIT information in crash reports
Since enabling YJIT or MJIT drastically changes what could go wrong at
runtime, it's good to be front and center about whether they are enabled
when dumping a crash report. Previously, `RUBY_DESCRIPTION` and the
description printed when crashing can be different when a JIT is on.

Introduce a new internal data global, `rb_dynamic_description`, and set
it to be the same as `RUBY_DESCRIPTION` during initialization; use it
when crashing.

 * version.c: Init_ruby_description(): Initialize and use
       `rb_dynamic_description`.
 * error.c: Change crash reports to use `rb_dynamic_description`.
 * ruby.c: Call `Init_ruby_description()` earlier. Slightly more work
       for when we exit right after printing the description but that
       was deemed acceptable.
 * include/ruby/version.h: Talk about how JIT info is not in
      `ruby_description`.
 * test/-ext-/bug_reporter/test_bug_reporter.rb: Remove handling for
       crash description being different from `RUBY_DESCRIPTION`.
 * test/ruby/test_rubyoptions.rb: ditto

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
2022-06-20 17:18:29 -04:00
Jean Boussier c46824d094 test_instrumentation_api.rb: Allow one less exit
I suspect that sometimes on CI the last thread is prempted before eaching the exit hook
causing the test to flake. I can't find a good way to force it to run.
2022-06-20 13:03:39 +02:00
Nobuyoshi Nakada 1e9939dae2 [Feature #18788] Support options as `String` to `Regexp.new`
`Regexp.new` now supports passing the regexp flags not only as an
`Integer`, but also as a `String.  Unknown flags raise errors.
2022-06-20 19:35:12 +09:00
Nobuyoshi Nakada ab2a43265c Warn suspicious flag to `Regexp.new`
Now second argument should be `true`, `false`, `nil` or Integer.
This flag is confused with third argument some times.
2022-06-20 19:35:12 +09:00
Yusuke Endoh 15db2e9496 Prevent a warning "possibly useless use of a literal in void context" 2022-06-20 19:25:11 +09:00
Yusuke Endoh 078db98da4 Prevent a warning "Expected ... to define AutoloadTest but it didn't"
related: [Bugs #18813] and eca31d24d6
2022-06-20 17:39:58 +09:00
Nobuyoshi Nakada da362fee59
Scale the time to wait native threads to run hook 2022-06-19 23:33:26 +09:00
Jean Boussier eca31d24d6 [Bug #18813] Warn when autoload has to lookup in parent namespace
This is a verbose mode only warning.
2022-06-18 14:49:02 +02:00
Jean Boussier c34a5469c8 Debug TestThreadInstrumentation
It previously failed with:

```
    1) Failure:
  TestThreadInstrumentation#test_thread_instrumentation_fork_safe [/home/runner/work/ruby/ruby/src/test/-ext-/thread/test_instrumentation_api.rb:50]:
  <5> expected but was
  <4>.
```

Suggesting one `EXIT` event wasn't fired or processed.

Adding an assetion on `Thead#status` may help figure out what is wrong.
2022-06-17 15:11:10 +02:00
Jean Boussier b6c1e1158d GVL Instrumentation API: add STARTED and EXITED events
[Feature #18339]

After experimenting with the initial version of the API I figured there is a need
for an exit event to cleanup instrumentation data. e.g. if you record data in a
{thread_id -> data} table, you need to free associated data when a thread goes away.
2022-06-17 09:08:26 +02:00
Nobuyoshi Nakada 20d4168250
Skip failing test on FreeBSD [ci skip] 2022-06-17 14:37:15 +09:00
John Hawthorn ae163cae6b Allow calling protected methods from refinements
Previously protected methods on refinements could never be called
because they were seen as being "defined" on the hidden refinement
ICLASS.

This commit updates calling refined protected methods so that they are
considered to be defined on the original class (the one being refined).

This ended up using the same behaviour that was used to check whether a
call to super was allowed, so I extracted that into a method.

[Bug #18806]
2022-06-16 13:24:48 -07:00
Nobuyoshi Nakada cd5cafa4a3 Respect the encoding of the source [Bug #18827]
Do not override the input string encoding at the time of preparation,
the source encoding is not determined from the input yet.
2022-06-17 01:48:52 +09:00
Nobuyoshi Nakada 278fefb962 ENV.merge! support multile arguments [Feature #18279] 2022-06-17 01:22:24 +09:00
Jemma Issroff 51835135a0 Added tests for setting ivars on frozen objs 2022-06-16 08:48:08 -07:00
Jemma Issroff c49fde351f Adding more clone tests, and adding dup tests 2022-06-16 08:48:08 -07:00
Shishir Joshi c310691dd8 [ruby/net-http] Make `Net::HTTPHeader#content_range` return nil on non-byte units
* Returning nil from the `content_range` method instead of raising an
  error when the unit in the content-range header is not "bytes".

Fix https://bugs.ruby-lang.org/issues/11450

https://github.com/ruby/net-http/commit/0b5030dd86

Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-06-16 23:35:27 +09:00
Nobuyoshi Nakada 2223eb082a
Revert "HTTPHeader.content_range throws error on non-byte units"
This reverts commit 63546bfc15.
2022-06-16 22:10:59 +09:00
Shishir Joshi 63546bfc15
HTTPHeader.content_range throws error on non-byte units
* Added a nil check in Net::HTTPHeader#initialize_http_header for keys in the header that do not have any value
* Returning nil from the content_range method instead of raising an error when the unit in the content-range header is not bytes
* Modified initialize_http_header to match trunk

fix [Bug #11450]
fix https://github.com/ruby/ruby/pull/1018
2022-06-16 20:16:47 +09:00
Takashi Kokubun 5310147bb8
MJIT: Handle JIT failure properly 2022-06-15 15:57:30 -07:00
Takashi Kokubun 1162523bae
Remove MJIT worker thread (#6006)
[Misc #18830]
2022-06-15 09:40:54 -07:00
Takashi Kokubun 46706e7808
MJIT: Add a test for Process.waitall handling 2022-06-14 22:42:09 -07:00
Nobuyoshi Nakada 1a70973f75 ripper: Check if anonymous parameters defined [Bug #18828] 2022-06-14 20:41:41 +09:00
Matt Valentine-House 56cc3e99b6 Move String RVALUES between pools
And re-embed any strings that can now fit inside the slot they've been
moved to
2022-06-13 10:11:27 -07:00
Yusuke Endoh abc828bc67 Prevent a "warning: `*' interpreted as argument prefix" 2022-06-13 10:38:51 +09:00
Yusuke Endoh 670de71628 Prevent a warning: assigned but unused variable - out
http://rubyci.s3.amazonaws.com/ubuntu1804/ruby-master/log/20220613T003003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20220613T003003Z/ruby/test/ruby/test_yjit_exit_locations.rb:96: warning: assigned but unused variable - out
/home/chkbuild/chkbuild/tmp/build/20220613T003003Z/ruby/test/ruby/test_yjit_exit_locations.rb:96: warning: assigned but unused variable - err
/home/chkbuild/chkbuild/tmp/build/20220613T003003Z/ruby/test/ruby/test_yjit_exit_locations.rb:96: warning: assigned but unused variable - status
```
2022-06-13 10:37:26 +09:00
John Hawthorn 52da90acee Make method id explicit in rb_exec_recursive_outer
Previously, because opt_aref and opt_aset don't push a frame, when they
would call rb_hash to determine the hash value of the key, the initial
level of recursion would incorrectly use the method id at the top of the
stack instead of "hash".

This commit replaces rb_exec_recursive_outer with
rb_exec_recursive_outer_mid, which takes an explicit method id, so that
we can make the hash calculation behave consistently.

rb_exec_recursive_outer was documented as being internal, so I believe
this should be okay to change.
2022-06-10 14:48:21 -07:00
Alan Wu e75cb61d46 Fix nested bmethod TracePoint and memory leak
df317151a5 removed the code to free
rb_hook_list_t, so repeated targeting of the same bmethod started
to leak the hook list. You can observe how the maximum memory use
scales with input size in the following script with `/usr/bin/time -v`.

```ruby
o = Object.new
o.define_singleton_method(:foo) {}
trace = TracePoint.new(:return) {}

bmethod = o.method(:foo)

ARGV.first.to_i.times { trace.enable(target:bmethod){} }
4.times {GC.start}
```

After this change the maximum doesn't grow as quickly.

To plug the leak, check whether the hook list is already allocated
when enabling the targeting TracePoint for the bmethod. This fix
also allows multiple TracePoints to target the same bmethod, similar
to other valid TracePoint targets.

Finally, free the rb_hook_list_t struct when freeing the method
definition it lives on. Freeing in the GC is a good way to avoid
lifetime problems similar to the one fixed in df31715.

[Bug #18031]
2022-06-10 10:10:27 +09:00