Commit graph

93130 commits

Author SHA1 Message Date
Peter Zhu
771804248e Make ARGF not pin references during marking
ARGF supports compaction, but it pins all of its references, which means
that none of it can move. This commit changes it to actually support
compaction.
2025-07-31 12:46:51 -04:00
Nobuyoshi Nakada
b3598cf2a3 Win: Strip CRs from cpp and nm output
The combination of mingw tools and cygin/msys2 ruby leaves CRs.
2025-08-01 00:15:27 +09:00
Peter Zhu
6c24904a69 Make static symbol ID atomic
We don't need the VM lock if we make static symbol IDs atomic.
2025-07-31 11:09:03 -04:00
Nobuyoshi Nakada
68a03167a5 Suppress maybe-uninitialized warnings 2025-07-31 23:07:08 +09:00
Peter Zhu
05353ab4b7 Make cross_ractor_require write barrier protected 2025-07-31 09:14:22 -04:00
BurdetteLamar
6f7a4f9c96 [DOC] Tweaks for String#getbyte 2025-07-31 09:14:11 -04:00
BurdetteLamar
d7bc1378d2 [DOC] Tweaks for String#force_encoding 2025-07-31 09:13:57 -04:00
BurdetteLamar
6d466a55bd [DOC] Tweaks for String#eql? 2025-07-31 09:13:36 -04:00
BurdetteLamar
ff6a8e95b7 [DOc] Tweaks for String#end_with? 2025-07-31 09:13:20 -04:00
Burdette Lamar
e2bd36388f
[DOC] Tweak for String#encode 2025-07-31 09:13:01 -04:00
Kazuki Yamaguchi
0d3d296b85 Reapply "[ruby/openssl] x509: disallow ossl_x509{,attr,crl,ext,revoked,name}*_new(NULL)"
This reverts commit ec01cd9bbb.

This should no longer break the tests, now that the following changes
have been applied:

 - RubyGems change: 32977f3869
 - ruby/openssl change: e8261963c7
2025-07-31 18:45:53 +09:00
Kazuki Yamaguchi
e8261963c7 [ruby/openssl] x509store: fix StoreContext#current_cert
Commit ef277083ba overlooked a caller of ossl_x509_new() with NULL
argument. OpenSSL::X509::StoreContext#current_cert may not have a
certificate to return if StoreContext#verify has not been called.

4149b43890
2025-07-31 09:45:35 +00:00
Hiroya Fujinami
18f500e347
Fix indents in Onigmo files to use spaces instead of tabs (#14047) [no ci] 2025-07-31 13:08:54 +09:00
Hiroshi SHIBATA
064e74087c
Also added arch variable to download-cache keys 2025-07-31 12:23:43 +09:00
Hiroshi SHIBATA
92ca64ab80
Added prefix for key of GH cache since download-cache is created four times with the same name. 2025-07-31 11:31:30 +09:00
Hiroshi SHIBATA
47b8916576
Save vcpkg cache with master and stable branches 2025-07-31 10:36:23 +09:00
Peter Zhu
7cece235ab Don't check the symbol's fstr at shutdown
During Ruby's shutdown, we no longer need to check the fstr of the symbol
because we don't use the fstr anymore for freeing the symbol. This can also
fix the following ASAN error:

==2721247==ERROR: AddressSanitizer: use-after-poison on address 0x75fa90a627b8 at pc 0x64a7b06fb4bc bp 0x7ffdf95ba9b0 sp 0x7ffdf95ba9a8
READ of size 8 at 0x75fa90a627b8 thread T0
    #0 0x64a7b06fb4bb in RB_BUILTIN_TYPE include/ruby/internal/value_type.h:191:30
    #1 0x64a7b06fb4bb in rb_gc_shutdown_call_finalizer_p gc.c:357:18
    #2 0x64a7b06fb4bb in rb_gc_impl_shutdown_call_finalizer gc/default/default.c:3045:21
    #3 0x64a7b06fb4bb in rb_objspace_call_finalizer gc.c:1739:5
    #4 0x64a7b06ca1b2 in rb_ec_finalize eval.c:165:5
    #5 0x64a7b06ca1b2 in rb_ec_cleanup eval.c:256:5
    #6 0x64a7b06c98a3 in ruby_cleanup eval.c:179:12
2025-07-30 13:57:32 -04:00
Max Bernstein
75f25e5c49 ZJIT: Don't create owned Cow/String when printing 2025-07-30 10:36:15 -07:00
Max Bernstein
1b700c56d8 ZJIT: Don't make unnecessary Cow 2025-07-30 10:36:15 -07:00
Max Bernstein
8c73b103cd ZJIT: Don't write to String 2025-07-30 10:36:15 -07:00
Max Bernstein
0f7ee8e7a4 ZJIT: Get rid of CallInfo 2025-07-30 10:36:15 -07:00
Max Bernstein
096d48d7db ZJIT: Deref struct in find() 2025-07-30 10:36:15 -07:00
Max Bernstein
7b10dbd55f ZJIT: Remove catch-all case to make it clearer what's unimplemented 2025-07-30 10:36:15 -07:00
Max Bernstein
9a30554796 ZJIT: Remove unused ArraySet instruction 2025-07-30 10:36:15 -07:00
John Hawthorn
0aac763bf0 Convert cross_ractor_requires to DECL_MARKING 2025-07-30 10:18:28 -07:00
Takashi Kokubun
2cd10de330
ZJIT: Prepare for sharing JIT hooks with ZJIT (#14044) 2025-07-30 10:11:10 -07:00
Stan Lo
4263c49d1c
YJIT: Remove a dead test for getinlinecaches (#14033)
The test was added in #5221 4 years ago but:

1. The insn it targets was removed in 2022 in #6187
2. The YJIT API `blocks_for` seems to be dropped in 2022 when it switched
   to use Rust in #5826

So this test has not been run in more than 3 years and can't be run
anymore. I think we can remove it.
2025-07-30 09:33:25 -07:00
Peter Zhu
74887a2c12 [ruby/mmtk] Skip weak references that are special consts
If a reference marked weak becomes a special const, it will crash because
it is not a GC handled object. We should skip special consts here.

870a79426b
2025-07-30 13:26:19 +00:00
Hiroya Fujinami
66bcb69054
Port Oniguruma patches to prevent integer overflow (#14027)
* Port a Oniguruma patch: Integer overflow in forward_search_range()

db64ef3189

Co-Authored-By: K.Kosako <kkos@users.noreply.github.com>

* Port a Oniguruma patch: Integer overflow in backward_search_range() and onig_search_gpos()

bfc36d3d81

Co-Authored-By: K.Kosako <kkos@users.noreply.github.com>

* Port a Oniguruma patch: Integer overflow in onig_search_gpos()

778a43dd56

It differs from the Oniguruma patch in that it dosen't use `onigenc_get_prev_char_head()`
because this function's signature has been changed by Oniguruma and the change is not ported
in Onigmo for now. This patch respects the current Onigmo implementation.

Co-Authored-By: K.Kosako <kkos@users.noreply.github.com>

* Add castings to prevent warnings

* Correct castings to use OnigDistance

---------

Co-authored-by: K.Kosako <kkos@users.noreply.github.com>
2025-07-30 20:56:13 +09:00
Jean Boussier
cbe5241c77 [DOC] Mention that Hash#replace also replaces defaults 2025-07-30 10:40:34 +02:00
David Rodríguez
e2fbd01714 [rubygems/rubygems] Remove unnecessary endless loop detection
Fixes a TODO now that no reports have been reported in a while.

f10dc84e7b
2025-07-30 11:19:32 +09:00
David Rodríguez
862b30287a [rubygems/rubygems] Bump vendored thor to 1.4.0
8078a747b3
2025-07-30 11:19:30 +09:00
David Rodríguez
124cd77470 [rubygems/rubygems] Keep fixture Gemfiles in sync when bumping version
781443cb0f
2025-07-30 11:19:28 +09:00
dependabot[bot]
2ec5e70fdb [rubygems/rubygems] Bump thor in /bundler/spec/realworld/fixtures/tapioca
Bumps [thor](https://github.com/rails/thor) from 1.3.2 to 1.4.0.
- [Release notes](https://github.com/rails/thor/releases)
- [Commits](https://github.com/rails/thor/compare/v1.3.2...v1.4.0)

---
updated-dependencies:
- dependency-name: thor
  dependency-version: 1.4.0
  dependency-type: indirect
...

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

0a4e5a377d
2025-07-30 11:19:27 +09:00
David Rodríguez
e42f1aaa5a [rubygems/rubygems] Fix truffleruby failing to install sorbet-static when there's no lockfile
The generic Ruby platform was getting unconditionally added in
truffleruby, preventing resolution in situations where there's no
generic ruby version (sorbet-static). Instead, the generic platform
should be considered per dependency, not globally.

a96afc5351
2025-07-30 11:19:26 +09:00
David Rodríguez
15e9dc19fb [rubygems/rubygems] Remove JRuby workaround
Original issue was fixed in JRuby 9.3.0.0, which seems old enough for us
to remove the workaround.

d285148d39
2025-07-30 11:19:24 +09:00
David Rodríguez
a0b501effe [rubygems/rubygems] Remove out of date TODO
After digging into git history a bit, I figure this was about unifying
`bundle cache` and `bundle package`, which already happened a while ago.
So remove this TODO since it's now misleading.

5a0b06b84d
2025-07-30 11:19:23 +09:00
Peter Zhu
1a4c0a9913 [ruby/mmtk] Fix warnings from cargo fmt
84975a8840
2025-07-29 21:45:11 +00:00
Peter Zhu
f608095b84 [ruby/mmtk] Fix clippy warnings
45f991578e
2025-07-29 21:45:10 +00:00
Max Bernstein
ade4558602
ZJIT: Catch more failed recursive compilations (#14042)
Untangle the logic a bit and specifically:

* catch `gen_entry` failures
* don't set `start_ptr` until all recursive calls succeed

Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
2025-07-29 16:36:25 -04:00
Max Bernstein
039f4139f8
ZJIT: Create delta debugging script to narrow JIT failures (#14041)
Add support for `--zjit-allowed-iseqs=SomeFile` and
`--zjit-log-compiled-iseqs=SomeFile` so we can restrict and inspect
which ISEQs get compiled.

Then add `jit_bisect.rb` which we can run to try and narrow a failing
script. For example:

    plum% ../tool/zjit_bisect.rb ../build-dev/miniruby "test.rb"
    I, [2025-07-29T12:41:18.657177 #96899]  INFO -- : Starting with JIT list of 4 items.
    I, [2025-07-29T12:41:18.657229 #96899]  INFO -- : Verifying items
    I, [2025-07-29T12:41:18.726213 #96899]  INFO -- : step fixed[0] and items[4]
    I, [2025-07-29T12:41:18.726246 #96899]  INFO -- : 4 candidates
    I, [2025-07-29T12:41:18.797212 #96899]  INFO -- : 2 candidates
    Reduced JIT list:
    bar@test.rb:8
    plum%

We start with 4 compiled functions and shrink to just one.
2025-07-29 19:43:14 +00:00
Peter Zhu
b07e214bf1 [DOC] Remove point about ASAN not working on released Ruby
ASAN works on Ruby 3.4 and later, so we can remove the point about using
master branch for ASAN.
2025-07-29 14:54:17 -04:00
Stan Lo
2eab962c53 [ruby/prism] Allow command calls in endless method bodies within assignments
Previously, endless method definitions in assignment contexts like
`x = def f = p 1` would fail to parse because command calls (method
calls without parentheses) were only accepted when the surrounding
binding power was less than `PM_BINDING_POWER_COMPOSITION`.

This fix specifically checks for assignment context and allows command
calls in those cases while maintaining the existing behavior for other
contexts. This ensures that:

- `x = def f = p 1` parses correctly (previously failed)
- `private def f = puts "Hello"` still produces the expected error

722af59ba3
2025-07-29 17:18:41 +00:00
Earlopain
026079925c [ruby/prism] Do not use 0 to indicate the latest ruby version to parse
This makes it hard to do version checks against this value. The current version checks work because there are so few possible values at the moment.

As an example, PR 3337 introduces new syntax for ruby 3.5 and uses `PM_OPTIONS_VERSION_LATEST` as its version guard. Because what is considered the latest changes every year, it must later be changed to `parser->version == parser->version == PM_OPTIONS_VERSION_CRUBY_3_5 || parser->version == PM_OPTIONS_VERSION_LATEST`, with one extra version each year.

With this change, the PR can instead write `parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5` which is self-explanatory
and works for future versions.

8318a113ca
2025-07-29 17:17:28 +00:00
Takashi Kokubun
b22eb0e468
ZJIT: Add --zjit-stats (#14034) 2025-07-29 10:00:15 -07:00
tomoya ishida
a66e4f2154
Improve performance of bignum[beg, len] (#14007)
Implement rb_big_aref2.
Taking a small slice from large bignum was slow in rb_int_aref2.
2025-07-29 16:34:13 +00:00
Peter Zhu
46d106f7ab Fix indentation in switch in rb_gc_impl_mark_maybe [ci skip] 2025-07-29 10:53:52 -04:00
Nobuyoshi Nakada
e0818ac659
Fix stripping features from the description 2025-07-29 22:11:49 +09:00
Nobuyoshi Nakada
a6914c089d
Fix the current parser detection
Since `RUBY_DESCRIPTION` contains the branch name, `/prism/i` can
match unexpectedly.  Extract the feature lists between revision
and platform infos.
2025-07-29 22:11:49 +09:00
Jean Boussier
7ee127d2d1 Get rid of imemo_ast
It has been marked as obsolete for a while and I see no reason
to keep it.
2025-07-29 13:05:12 +02:00