Commit graph

93016 commits

Author SHA1 Message Date
John Hawthorn
7f25b8f5fb Disable TSAN for rb_gc_mark_machine_context
Previously this was listed as a suppression, but we actually want this
permanently unsanitized. This should be faster and more reliable since
TASN won't have to match against symbolicated backtraces.
2025-07-24 16:35:42 -07:00
John Hawthorn
3ad2019259 Extract vm_locked_by_ractor_p
This introduces a new method to encapsulate checking whether the current
Ractor owns the vm->ractor.sync lock. This allows us to disable TSan on
it since that operation should be safe, and still get validation of
other uses.
2025-07-24 16:35:20 -07:00
Stan Lo
7465e169da ZJIT: Remove redundant test exclusions 2025-07-24 18:47:20 -04:00
Alan Wu
271e52d553 ZJIT: Re-enable some A64 assembler tests
Tweak for Condition to build when `cfg!(target = "x86_64")`.
2025-07-24 17:01:27 -04:00
Alan Wu
7e2b6291b8 ZJIT: DRY up underscore rexport anti-pattern
Keeping the same name makes re-exporting more concise.
2025-07-24 17:01:27 -04:00
BurdetteLamar
ed22e15acb [DOC] Tweak for String#encode! 2025-07-24 15:57:28 -04:00
ydah
b2838bef69 Add NODE_DEFINED tests for cases with parentheses to test_ast.rb 2025-07-25 01:07:32 +09:00
Kunshan Wang
5ef20b3a27 YJIT: Use raw memory write to update pointers in code
Because we have set all code memory to writable before the reference
updating phase, we can use raw memory writes directly.
2025-07-24 11:37:44 -04:00
S-H-GAMELINKS
fd492a45eb Add DEFINED NODE locations
Add keyword_defined locations to struct RNode_DEFINED
2025-07-24 23:30:23 +09:00
Peter Zhu
f186f2cb70 Remove unused imemo_parser_strterm 2025-07-24 09:49:13 -04:00
Nobuyoshi Nakada
4c60e431e1
Win32: Suppress an error message when baseruby is not found 2025-07-24 15:45:35 +09:00
Nobuyoshi Nakada
b246fb604e
Use <> for a system header 2025-07-24 12:56:08 +09:00
Hiroshi SHIBATA
6dc37f9003 Update the latest versions of actions 2025-07-24 12:47:16 +09:00
Yuta Saito
076e51e5ec math.c: cleanup unused #include <errno.h>
`errno` is no longer used after 5073155a17
2025-07-24 12:39:53 +09:00
Samuel Williams
64f508ade8
Support cause: in Thread#raise and Fiber#raise. (#13967)
* Add support for `cause:` argument to `Fiber#raise` and `Thread#raise`.

The implementation behaviour is consistent with `Kernel#raise` and
`Exception#initialize` methods, allowing the `cause:` argument to be
passed to `Fiber#raise` and `Thread#raise`. This change ensures that
the `cause:` argument is handled correctly, providing a more consistent
and expected behavior when raising exceptions in fibers and threads.

[Feature #21360]

* Shared specs for Fiber/Thread/Kernel raise.

---------

Co-authored-by: Samuel Williams <samuel.williams@shopify.com>
2025-07-24 14:45:43 +12:00
Stan Lo
2e0a782936 ZJIT: Run zjit-check on CI for faster test_zjit.rb feedback 2025-07-23 19:52:59 -04:00
Stan Lo
f27e8b11cb ZJIT: Add multiple exclude targets 2025-07-23 19:52:59 -04:00
Stan Lo
3504eba9b8 ZJIT: Start testing againt /test 2025-07-23 19:52:59 -04:00
John Hawthorn
9256442615 Cleanup M_TBL workarounds and comments
Previously we had an assertion that the method table was only set on
young objects, and a comment stating that was how it needed to be used.
I think that confused the complexity of the write barriers that may be
needed here.

* Setting an empty M_TBL never needs a write barrier
* T_CLASS and T_MODULE should always fire a write barrier to newly added
  methods
* T_ICLASS only needs a write barrier to methods when
  RCLASSEXT_ICLASS_IS_ORIGIN(x) && !RCLASSEXT_ICLASS_ORIGIN_SHARED_MTBL(x)

We shouldn't assume that the object being young is sufficient, because
we also need write barriers for incremental marking and it's unreliable.
2025-07-23 14:33:55 -07:00
John Hawthorn
d67eb07f75 Fix missing write barrier through M_TBL
When creating a new origin in ensure_origin, we need to fire a write
barrier after RCLASS_WRITE_ORIGIN. rb_class_set_super allocates, so GC
could happen there, either incrementally marking or promoting the newly
allocated class, and only after RCLASS_WRITE_ORIGIN will origin mark
object in the M_TBL.
2025-07-23 14:33:55 -07:00
BurdetteLamar
54a578e72a [DOC] Tweaks for String#encoding 2025-07-23 17:09:33 -04:00
Burdette Lamar
56572baa4c
[DOC] Tweaks for String#each_grapheme_cluster (#13981) 2025-07-23 17:07:25 -04:00
Burdette Lamar
e3d36fff8f
[DOC] Tweaks for String#empty? 2025-07-23 17:06:44 -04:00
Stan Lo
78820e86c7 Update doc for ObjectSpace.memsize_of 2025-07-23 15:49:04 -04:00
BurdetteLamar
7816a04d97 [DOC] Tweaks for String#each_line 2025-07-23 15:48:35 -04:00
BurdetteLamar
17eee25c66 [DOC] Tweaks for String#each_codepoint 2025-07-23 15:36:32 -04:00
BurdetteLamar
cd9b74638c [DOC] Tweaks for String#each_char 2025-07-23 15:35:28 -04:00
Alan Wu
41149a96ef ZJIT: Fix clobbering register for self in gen_entry_params()
Previously, for 8+ params we wound up clobbering the self param when
putting the last param in memory in the JIT entry point:

    # ZJIT entry point: a@../test.rb:5
    <snip>
    ldur x0, [x19, #0x18]
    # set method params: 8
    ldur x1, [x21, #-0x58]
    ldur x2, [x21, #-0x50]
    ldur x3, [x21, #-0x48]
    ldur x4, [x21, #-0x40]
    ldur x5, [x21, #-0x38]
    ldur x11, [x21, #-0x30]
    ldur x12, [x21, #-0x28]
    ldur x0, [x21, #-0x20]
    stur x0, [sp, #-0x20]
    bl #0x11e17018c

Doing the memcpys for parameters in memory first avoids this clobbering.

    # set method params: 8
    ldur x0, [x21, #-0x20]
    stur x0, [sp, #-0x20]
    ldur x12, [x21, #-0x28]
    ldur x11, [x21, #-0x30]
    ldur x5, [x21, #-0x38]
    ldur x4, [x21, #-0x40]
    ldur x3, [x21, #-0x48]
    ldur x2, [x21, #-0x50]
    ldur x1, [x21, #-0x58]
    ldur x0, [x19, #0x18]
2025-07-23 13:29:03 -04:00
tomoya ishida
5e5cec1b86
Fix bigand_int edgecase returning false (#13987) 2025-07-24 02:12:12 +09:00
Peter Zhu
93be578691 Remove global symbol locks for rb_intern 2025-07-23 10:07:11 -04:00
Peter Zhu
33a849e385 Remove global symbol lock for rb_gc_free_dsymbol 2025-07-23 10:07:11 -04:00
André Luiz Tiago Soares
85221800ca
Add comments to autogen script 2025-07-23 11:23:38 +00:00
Yusuke Endoh
7e64a68252 Prevent a warning: old-style function definition
ipsocket.c:57:1: warning: old-style function definition [-Wold-style-definition]
   57 | current_clocktime()
      | ^~~~~~~~~~~~~~~~~
2025-07-23 16:46:01 +09:00
Naoto Ono
fbaad485db
Launchable: Remove launchable subset command (#13969)
I've enabled the [Predictive Test Selection](https://www.launchableinc.com/docs/features/predictive-test-selection/) feature, which let machine-learning model selects the appropriate tests to reduce CI execution time in https://github.com/ruby/ruby/pull/12617.

However, I noticed that there are some problems for enabling PTS in Ruby CI after several experiments. Until fixing the problem, I'll disable this feature by removing `launchable subset` command.
2025-07-23 11:18:11 +09:00
André Luiz Tiago Soares
61b5d3cf89
[DOC] Fix 'hexadecimal' spelling on encodings docs
Fix typo
2025-07-23 10:10:56 +09:00
Alan Wu
33363030e1 ZJIT: Use rb_vm_env_write() for hir::Insn::SetLocal
We weren't firing write barriers before when writing to imemo/env
objects. Wbcheck caught this with test/ruby/test_refinement.rb:

    ruby -v: ruby 3.5.0dev (2025-07-22T17:05:58Z wbcheck 2569a80954) +ZJIT dev +PRISM +GC[wbcheck] [x86_64-linux]
    WBCHECK ERROR: Missed write barrier detected!
      Parent object: 0x558de9f4e6e0 (wb_protected: true)
        rb_obj_info_dump: 0x0000558de9f4e6e0 T_IMEMO/<env>
      Reference counts - snapshot: 3, writebarrier: 0, current: 4, missed: 1
      Missing reference to: 0x558decf37c30
        rb_obj_info_dump: 0x0000558decf37c30 method/UnboundMethod method

    WBCHECK SUMMARY: Found 1 objects with missed write barriers (1 total violations)
2025-07-22 18:04:28 -04:00
BurdetteLamar
465b1696ad [DOC] Tweaks for String#each_byte 2025-07-22 17:55:06 -04:00
BurdetteLamar
7ca3b38a95 [DOC] Tweak for String#dump 2025-07-22 17:54:04 -04:00
Allison Cretel
45e65f55bc Fix typos in documentation_guide.md 2025-07-22 12:52:45 -04:00
Allison Cretel
02aee1b724 Change TESTOPS to TESTOPTS 2025-07-22 12:52:45 -04:00
Jun Aruga
7bb48f87f3 [ruby/openssl] ssl: add SSLSocket#sigalg, #peer_sigalg, #group
These methods are useful to test post-quantum cryptography (PQC) cases.

434ef74452
2025-07-22 16:51:02 +00:00
John Hawthorn
41ec0f5b97 Update misc/tsan_suppressions.txt
* Add gc_enable/disable to TSAN suppressions
* Remove deleted methods from tsan suppressions
* Remove TSAN errors we've fixed
* Add another two inline cache suppressions
* Improve comments
2025-07-22 09:37:13 -07:00
John Hawthorn
973e6770d5 Fix TSAN data race in gc_start
objspace->flags.immediate_sweep shares the same word as
objspace->flags.during_incremental_marking. So in gc_start we need to
assign it after gc_enter() so that we hold the VM lock and have issued a
barrier, as rb_gc_impl_writebarrier is reading
objspace->flags.during_incremental_marking.
2025-07-22 09:37:13 -07:00
Aaron Patterson
a1403fb7cb Interpolated strings must not be frozen
Strings concatenated with backslash may end up being frozen when they
shouldn't be.  This commit fixes the issue.  It required a change
upstream in Prism, but also a change to the Prism compiler in CRuby.

  https://github.com/ruby/prism/pull/3606

[Bug #21187]
2025-07-22 08:10:55 -07:00
Kunshan Wang
0f408602cb Fix missing increment of deleted_entries
When `rb_concurrent_set_foreach_with_replace` deletes entries from a
concurrent set, it should increment the `deleted_entries` field, too.
2025-07-22 10:05:24 -04:00
Jean Boussier
8541dec8c4 encoding.c: check for autoload before checking index
Otherwise we may be checking the index while the encoding
is being autoloaded by another ractor.
2025-07-22 12:58:49 +02:00
Hiroshi SHIBATA
4dec4fbdfa
[rubygems/rubygems] Define dummy module for mise plugin
64bdff1e1e
2025-07-22 18:41:57 +09:00
git
af718aaf4b Update bundled gems list as of 2025-07-22 2025-07-22 07:07:16 +00:00
Alan Wu
e77eee96a3 ZJIT: Load return value before frame teardown
Or else the following returns garbage since it loads after
moving SP. Prior bad disassembly:

    def a(n1,n2,n3,n4,n5,n6,n7,n8) = n8
    a(1,1,1,1,1,1,1,0)

    # Block: bb0(v0, v1, v2, v3, v4, v5, v6, v7, v8)
    stp x29, x30, [sp, #-0x10]!
    mov x29, sp
    # bump C stack pointer
    sub sp, sp, #0x10
    # Insn: v10 Return v8
    # pop stack frame
    adds x19, x19, #0x38
    stur x19, [x20, #0x10]
    # restore C stack pointer
    add sp, sp, #0x10
    mov sp, x29
    ldp x29, x30, [sp], #0x10
    ldur x0, [sp]
    ret
2025-07-21 23:09:42 -04:00
David Rodríguez
9f961a4b30 [rubygems/rubygems] Workaround RVM issue when using Bundler <= 2.5.22
Old versions of BUndler need a workaround to support nested `bundle
exec` invocations by overriding `Gem.activate_bin_path`. However,
RubyGems now uses this new `Gem.activate_and_load_bin_path` helper in
binstubs, which is of course not overridden in those Bundler versions
since it didn't exist at the time.

So, include the override here to workaround that.

e5ed95e242
2025-07-22 10:01:28 +09:00