Commit graph

90879 commits

Author SHA1 Message Date
John Hawthorn
b3b1d7b295 Remove spinlock in dtoa's Balloc, use xmalloc
The spinlock here performs poorly when there are multiple Ractors. The
improvement on single threaded performance doesn't seem that
significant, so I think we should just use malloc.
2025-04-07 16:56:44 -07:00
Kanstantsin Shautsou
4646ab8917 Use correct warn method 2025-04-07 16:37:39 +02:00
Peter Zhu
e3abdfbc84 Skip test_heaps_grow_independently for MMTk 2025-04-07 09:41:11 -04:00
Peter Zhu
d4406f0627 Grow GC heaps independently
[Bug #21214]

If we allocate objects where one heap holds transient objects and another
holds long lived objects, then the heap with transient objects will grow
along the heap with long lived objects, causing higher memory usage.

For example, we can see this issue in this script:

    def allocate_small_object = []
    def allocate_large_object = Array.new(10)

    arys = Array.new(1_000_000) do
      # Allocate 10 small transient objects
      10.times { allocate_small_object }
      # Allocate 1 large object that is persistent
      allocate_large_object
    end

    pp GC.stat
    pp GC.stat_heap

Before this change:

    heap_live_slots: 2837243
    {0 =>
      {slot_size: 40,
       heap_eden_pages: 1123,
       heap_eden_slots: 1838807},
     2 =>
      {slot_size: 160,
       heap_eden_pages: 2449,
       heap_eden_slots: 1001149},
    }

After this change:

    heap_live_slots: 1094474
    {0 =>
      {slot_size: 40,
       heap_eden_pages: 58,
       heap_eden_slots: 94973},
     2 =>
      {slot_size: 160,
       heap_eden_pages: 2449,
       heap_eden_slots: 1001149},
    }
2025-04-07 09:41:11 -04:00
Jean Boussier
432e5fa7e4 prism_compile.c: Avoid zero length allocation
The constant pool may be empty.
2025-04-07 12:00:09 +02:00
git
135e5bff9a Update bundled gems list at d485638a08 [ci skip] 2025-04-07 06:11:34 +00:00
Hiroshi SHIBATA
d485638a08 Allow win32ole test failure
```
D:/a/ruby/ruby/src/gems/src/win32ole/test/win32ole/test_win32ole_event.rb:80:in 'TestWIN32OLE_EVENT_SWbemSink#default_handler': undefined method '+' for nil (NoMethodError)
```

4007208388
2025-04-07 15:10:58 +09:00
Hiroshi SHIBATA
f70bf78403 Fixed wrong condition to avoid flaky ractor_test.rb 2025-04-07 15:10:58 +09:00
Hiroshi SHIBATA
be5dea9720 Rename test command for test-unit
b7d3c32f6e
2025-04-07 15:10:58 +09:00
Hiroshi SHIBATA
a4b4dad4ba Update bundled_gems 2025-04-07 15:10:58 +09:00
Yusuke Endoh
3a7b9ca93b Fix Integer.sqrt to never exceed actual value
`Integer.sqrt` uses `sqrt(3)` from libm for small values.
This method must return a value less than or equal to the actual integer
square root, but libm's sqrt does not always guarantee that.

This change corrects that by decrementing the result if necessary.

Fixes [Bug #21217]
2025-04-07 11:08:10 +09:00
Nobuyoshi Nakada
e25889951f
Ensure builtin binaries are aligned to ibf_header
Since IBF result string size should be multiple of 4, this should not
increase the binary size actually.
2025-04-06 12:24:23 +09:00
Naoto Ono
b5ac483d95
Fix the if condition to skip test_ractor.rb correctly (#13067)
Follow-up for a2b03ba7cb
2025-04-06 09:38:58 +09:00
Nobuyoshi Nakada
229784d160
[Bug #21150] macOS: unwinding coroutine workaround is only for arm64 2025-04-05 10:31:20 +09:00
Jean Boussier
085cc6e434 Ractor: revert to moving object bytes, but size pool aware
Using `rb_obj_clone` introduce other problems, such as `initialize_*`
callbacks invocation in the context of the parent ractor.

So we can revert back to copy the content of the object slots,
but in a way that is aware of size pools.
2025-04-04 16:26:29 +02:00
Nobuyoshi Nakada
eb765913c1
Console Cntl event is sent to root process sharing the console 2025-04-04 19:34:04 +09:00
Nobuyoshi Nakada
cec45aedb5
Cannot send signal to process group on Windows 2025-04-04 16:24:49 +09:00
Nobuyoshi Nakada
d22e766042
Cannot send SIGTERM to another process on Windows 2025-04-04 16:24:48 +09:00
Hiroshi SHIBATA
0251abca7f
Fixed mismatched indentation 2025-04-04 14:23:25 +09:00
Hiroshi SHIBATA
705a95323e
Removed unused variable 2025-04-04 14:21:05 +09:00
Hiroshi SHIBATA
b4a94011ca
Hardening auto-merge workflow
https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enabling-automerge-on-a-pull-request
2025-04-04 11:58:59 +09:00
git
cd8c203ffb Update bundled gems list at 05e74543f6 [ci skip] 2025-04-04 01:22:09 +00:00
Hiroshi SHIBATA
05e74543f6 Update bundled_gems 2025-04-04 10:21:31 +09:00
David Rodríguez
710bf4a472 [rubygems/rubygems] Rubyinstaller2 fixed this
08b3c48f41
2025-04-04 08:54:47 +09:00
David Rodríguez
f8c0225971 [rubygems/rubygems] Improve bug report instructions
* Explicitly recommend copying full command output and not just the bug
  report template part.
* Include quadruple quotes in the "What actually happened section" and
  tell users to copy full command output inside. Hopefully quadruple
  quotes will make the error report information (which includes triple
  quotes itself) render fine by default.
* Avoid "actually" as per quality_spec.rb recommendation.

0a3bf2edb1
2025-04-04 08:54:47 +09:00
Kazuki Yamaguchi
6b5e187d0e [ruby/openssl] pkcs7: fix test failure on RHEL 9
The test case test_split_content fails on RHEL 9 and Fedora 41 because
their OpenSSL packages do not accept SHA-1 signatures. This was only
caught after commit 69fd7f8863 added the missing assertion.

While the example PKCS#7 structures could be simply regenerated with
SHA-256, this test case could be simplified because it is checking two
different things.

Replace test_split_content with separate test cases: one verifying
signed-data authenticatedAttributes and another for decoding BER input.

Fixes https://github.com/ruby/openssl/issues/875

b32406b0c1
2025-04-03 17:58:30 +00:00
Kazuki Yamaguchi
3911113bc4 [ruby/openssl] pkcs7: update test case test_graceful_parsing_failure
Using test_pkcs7.rb as an example invalid input is not reliable because
we may happen to include a valid PKCS#7 PEM block in a heredoc.

76fead26d2
2025-04-03 17:58:29 +00:00
John Hawthorn
137b51e4d3 Remove rb_gc_start from cancel_single_ractor_mode
In 307732ccee Ractors were changed to
explicitly run GC when the first non-main one was activated in order to
disable the transient heap. Theap no longer exists so I don't think we
need to do this.
2025-04-03 10:39:47 -07:00
John Hawthorn
5eb3efcf2d Fix timeline_value not being marked in test
T_DATA with a NULL pointer are not marked. Let's wrap 1 instead to
ensure that our mark function is actually run.
2025-04-03 10:39:47 -07:00
Jean Boussier
4aa74b605c compile.c: avoid allocating 0 length call_data
if `body->ci_size` is `0`, there's no point allocating 0B,
it just wastes an entry in the allocator.
2025-04-03 16:57:57 +02:00
Hiroshi SHIBATA
fab133e629 Use EnvUtil.apply_timeout_scale 2025-04-03 20:03:18 +09:00
Hiroshi SHIBATA
3f152ce767 Extend open_timeout for test failure on s390x
20250403T060004Z.fail.html.gz
2025-04-03 20:03:18 +09:00
Nobuyoshi Nakada
1dddc6c78b
Remove no longer used union
IMEMO_NEW takes just one memo value, min/max argc are assigned
directly and packed argc is not used.
2025-04-03 16:56:24 +09:00
Jeremy Evans
29dafa5fc2 Fix assertion failure with anonymous splats
When calling a method that accepts an anonymous splat and literal
keywords without any arguments, an assertion failure was previously
raised. Set rest_index to 0 when setting rest to the frozen hash,
so the args_argc calculation is accurate.

While here, add more tests for methods with anonymous splats with
and without keywords and keyword splats to confirm behavior is
correct.

Also add a basic bootstrap test that would hit the previous assertion
failure.

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2025-04-02 19:31:05 -07:00
Herwin
b8e2bec914 Grammar fix in doc/exceptions.md: there => they're 2025-04-03 10:14:58 +09:00
Hiroshi SHIBATA
1598a2cab8 Enforce to use CMake 3 because CMake 4 is not compatible to build libyaml via vcpkg 2025-04-03 10:12:34 +09:00
Earlopain
d543fda433 [ruby/prism] Be explicit in tests which files parser can't parse
It also updates to latest `parser`, which allows numbered
parameters in pattern matching pin,
passing `patterns.txt` and `case.txt`

bdcc8b3dc5
2025-04-02 20:53:34 +00:00
Earlopain
334c261cc9 [ruby/prism] Fix parser translator when splatting in pattern matching pin
Because it ends up treating it as a local variable, and `a.x`
is not a valid local variable name.

I'm not big on pattern matching, but conceptually it makes sense to me
to treat anything inside ^() to not be
pattern matching syntax?

80dbd85c45
2025-04-02 20:51:54 +00:00
Jean Boussier
fe9ebb2456 vm_core.h: unify YJIT ifdefs 2025-04-02 18:50:14 +02:00
BurdetteLamar
3a7b03242f [DOC] Tweaks for Hash doc 2025-04-02 12:10:56 -04:00
Burdette Lamar
2a55cc3fb8
[DOC] Tweaks to String::try_convert 2025-04-02 12:03:17 -04:00
Kunshan Wang
ce1dfe81c2 [DOC] Doc for Thread::ConditionVariable
Documented the necessity of calling `wait` in a loop.  We modified the
example to demonstrate the idiomatic use, and added a third thread `a2`
to demonstrate another reason that necessitates the loop.

Mentioned spurious wake-up in the doc.
2025-04-02 10:47:52 -04:00
Jean Boussier
580aa60051 Improve backtrace of errors raised by Socket.tcp_with_fast_fallback
[Bug #21211]

Socket errors raised from background threads are hard to track down because
their backtrace starts from the spawned thread.

To solve this we can raise a new error with the old one as `cause`.
2025-04-02 13:24:22 +02:00
Hiroshi SHIBATA
43ee4a50d9 Fixup comment for Windows platform, not Solaris 2025-04-02 16:24:47 +09:00
Hiroshi SHIBATA
e71192da69 Removed Solaris conditions from optional and shared directories 2025-04-02 16:24:47 +09:00
Hiroshi SHIBATA
3d4ea45411 Removed Solaris conditions from library directory 2025-04-02 16:24:47 +09:00
Hiroshi SHIBATA
8cb61b00fd Removed Solaris conditions from core directory 2025-04-02 16:24:47 +09:00
Hiroshi SHIBATA
6bd5a51ab5 Removed Solaris conditions from test files
We no longer execute those files with Solaris platforms.
2025-04-02 16:24:47 +09:00
git
ca97302dd4 Update bundled gems list as of 2025-04-01 2025-04-02 07:01:44 +00:00
Hiroshi SHIBATA
938db05361 Removed the warning targets for Ruby 3.1 because 3.1 is already EOL 2025-04-02 10:52:26 +09:00