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

82210 Коммитов

Автор SHA1 Сообщение Дата
John Hawthorn f1b7424cbe FREE_AT_EXIT: Don't free main stack post-fork
When a forked process was started in a thread, this would result in a
double-free during the child process exit.

    RUBY_FREE_AT_EXIT=1 ./miniruby -e 'Thread.new { fork { } }.join; Process.waitpid'

This is because the main thread in the forked process was not the
initial VM thread, and the new thread's stack was freed as part of
objectspace iteration.

This change also allows rb_threadptr_root_fiber_release to run without
EC being available.
2023-12-22 18:07:22 -08:00
John Hawthorn 339978ef38 Free default_rand_key after freeing Ractors
Ractor's free iterates through its TLS keys so we need to keep this
memory available until after Ractors are freed.

Minimal reproduction:

    RUBY_FREE_AT_EXIT=1 ./miniruby -e rand
2023-12-22 18:07:22 -08:00
John Hawthorn 697a096c9b Remove EC argument from clean_hooks_check
This argument doesn't seem used anymore. Since we want to free these
objects during VM destruction when RUBY_FREE_AT_EXIT is set they must
work without an EC.

This avoids a use-after-free running `RUBY_FREE_AT_EXIT=1 ./miniruby -e ''`
2023-12-22 18:07:22 -08:00
git 24ff13d8da Update default gems list at 7d7a84e99f [ci skip] 2023-12-23 00:35:43 +00:00
Hiroshi SHIBATA 7d7a84e99f Merge RubyGems-3.5.3 and Bundler-2.5.3 2023-12-23 09:34:26 +09:00
Koichi Sasada fa5de8f68d MN: skip waiting on fiber schedulers
If the Fiber is nonblocking mode, fiber scheduler needs to handle
IO events.
2023-12-23 08:10:41 +09:00
Koichi Sasada beec3d07c9 MN: skip waiting on `read_nonblock'
if the IO for `IO#read_nonblock` is not ready, it needs
to return (or raise) immediately.
2023-12-23 08:10:41 +09:00
Koichi Sasada 2fe9e08578 MN: skip RUBY_DESCRIPTION spec on MN enabled 2023-12-23 08:10:41 +09:00
Koichi Sasada a4b737213e MN: ceil timeout milli seconds
`hrrel / RB_HRTIME_PER_MSEC` floor the timeout value and it can
return wrong value by `Mutex#sleep` (return Integer even if
it should return nil (timeout'ed)).

This patch ceil the value and the issue was solved.
2023-12-23 05:56:02 +09:00
Koichi Sasada c974ee1abe ensure to restart antoher thread 2023-12-23 05:56:02 +09:00
Koichi Sasada bbfc262c99 MN: fix "raise on close"
Introduce `thread_io_wait_events()` to make 1 function to call
`thread_sched_wait_events()`.

In ``thread_io_wait_events()`, manipulate `waiting_fd` to raise
an exception when closing the IO correctly.
2023-12-23 05:56:02 +09:00
Takashi Kokubun 19d082dcfa RJIT: Distinguish Pointer with Array
This is more convenient for accessing those fields.
2023-12-22 11:24:04 -08:00
Nobuyoshi Nakada 40e3f782dd Extract `forwarding_arg_check` function 2023-12-22 23:08:10 +09:00
Nobuyoshi Nakada 11c2aa035b Extract `arg_splat` nonterminal symbol 2023-12-22 23:08:10 +09:00
Jun Aruga 426f2334dd .travis.yml: Try another way to be notified.
I <jaruga@ruby-lang.org> haven't received the notifications since August 2022.
So, try another way to be notified written on the document below.

https://docs.travis-ci.com/user/notifications/#configuring-email-notifications
2023-12-22 15:06:47 +01:00
Kouhei Yanagita e8639098ed [Bug #19977] Fix (nil..nil) === x not to raise TypeError 2023-12-22 16:15:33 +09:00
Takashi Kokubun f263e44746 RJIT: Avoid retaining unrelated local variables in memory 2023-12-21 23:00:18 -08:00
Kouhei Yanagita ef4797bb03 [DOC] Fix NEWS markup 2023-12-22 15:53:41 +09:00
TSUYUSATO Kitsune 17e351057e Add Regexp updates to NEWS.md 2023-12-22 15:28:33 +09:00
yui-knk e364436c5f [DOC] NEWS entries for Parser 2023-12-22 15:15:05 +09:00
Takashi Kokubun f3c82df944 RJIT: Minimize string allocations in InsnCompiler 2023-12-21 21:59:33 -08:00
Takashi Kokubun 2e0277b133 RJIT: Make --rjit-trace actually work 2023-12-21 21:46:19 -08:00
Takashi Kokubun 4c6f07eeca RJIT: Update bindgen 2023-12-21 21:10:19 -08:00
Takashi Kokubun 64c52cd1c2 RJIT: Add --rjit-trace to allow TracePoint during JIT 2023-12-21 21:05:13 -08:00
John Hawthorn c18edc5b5d Avoid underflow of rb_yjit_live_iseq_count
This value is only incremented when rb_iseq_translate_threaded_code is
called, which doesn't happen for iseqs which result in a syntax error.

This is easy to hit by running a debug build with RUBY_FREE_AT_EXIT=1,
but any build and options could underflow this value by running enough
evals.
2023-12-21 20:43:01 -08:00
Koichi Sasada cae11dd857 debug.gem v1.9.1 2023-12-22 12:45:31 +09:00
Yuta Saito fa0f7522c4 coroutine/arm64: Skip saving/restoring x30 twice and use `autiasp`
We don't need to save/restore x30 twice, and we can just use `ret`,
which uses x30 as return address register instead of explicit `ret <reg>`
instruction. This also allows us to use `autiasp` instead of `autia1716`
and we can skip setting SP/LR to x16/x17.

Also the size of register save area is shrunk by 16 bytes due to the
removal of extra x30 save/restore.
2023-12-22 11:30:00 +09:00
Yuta Saito 2d004decde coroutine/arm64/Context.S: Append PAC/BTI note section if needed
Fixes https://bugs.ruby-lang.org/issues/20029
2023-12-22 11:30:00 +09:00
Yuta Saito 35587150e2 coroutine/arm64/Context.S: Insert `bti c` as BTI landing pad 2023-12-22 11:30:00 +09:00
Yuta Saito d9e5564ccd coroutine/arm64: Sign return address if PAC enabled 2023-12-22 11:30:00 +09:00
Takashi Kokubun 9a3c49ee5d RJIT: Convert opt_case_dispatch keys with #to_value
comptime_key is a Ruby object and the value is not valid in machine code.

This PR also implements `CMP r/m64, imm32 (Mod 01: [reg]+disp8)` that is
now needed for running mail.gem benchmark.
2023-12-21 17:47:36 -08:00
Alan Wu 0c05551f58 Typo fixes for public headers [ci skip] 2023-12-21 20:34:49 -05:00
Takashi Kokubun 009968a700 RJIT: Avoid incrementing vm_insns_count
during compilation
2023-12-21 17:12:40 -08:00
Takashi Kokubun 3c18277629 RJIT: Clean up unnecessary documentation 2023-12-21 16:47:13 -08:00
Takashi Kokubun 18a97affa3 RJIT: Fix a wrong comparison in set_local_type 2023-12-21 16:45:37 -08:00
Takashi Kokubun 68bcca4c2b RJIT: Fix unwanted shadowing in set_local_type
local_idx should not be overwritten.
2023-12-21 15:48:37 -08:00
John Hawthorn ffa5f16273 Make rb_profile_frames return 0 for NULL ec
When using M:N threads, EC is set to NULL in the shared native thread
when nothing is scheduled. This previously caused a segfault when we try
to examine the EC.

Returning 0 instead means we may miss profiling information, but a
profiler relying on this isn't thread aware anyways, and observing that
"nothing" is running is probably correct.

Fixes [Bug #20017]

Co-authored-by: Dustin Brown <dbrown9@gmail.com>
2023-12-21 15:23:19 -08:00
Takashi Kokubun 78b27ce62a RJIT: Streamline RJIT enablement check
in bootstrap tests so that `make btest-bruby` skips the right tests.
2023-12-21 14:32:03 -08:00
Takashi Kokubun c73959cff4 RJIT: Rename pause/resume to disable/enable
like YJIT. They don't work in the same way yet, but it's nice to make
the naming consistent first so that we will not need to rename them
later.
2023-12-21 14:25:41 -08:00
git 69bed94cea Update default gems list at 82496f2b38 [ci skip] 2023-12-21 22:24:52 +00:00
Hiroshi SHIBATA 82496f2b38 Merge RubyGems-3.5.2 and Bundler-2.5.2 2023-12-22 07:24:04 +09:00
Victor Shepelev fc549b2b3a
[DOC] Improve NEWS.md rendering and add missing features (#9308)
* Fix rendering of the file on docs.ruby-lang.org:
  * More indentation for code;
  * Properly qualified methods to link to docs;
* Add two minor yet notable changes:
  * Time.new stricter parsing of strings;
  * NoMethodError rendering logic change.
2023-12-21 23:12:36 +02:00
Victor Shepelev e04197aba7
[DOC] Fix NoMethodError example of rendering (#9309)
Fix NoMethodError example of rendering
2023-12-21 22:27:18 +02:00
John Hawthorn 1f0304218c Use main_thread->ec from rb_vm_main_ractor_ec
rb_vm_main_ractor_ec was introduced to allow rb_postponed_job_* to work
when fired on non-Ruby threads, which have no EC set, and that is its
only use.

When RUBY_MN_THREADS=1 is set ractor->threads.running_ec is NULL when
the shared thread is sleeping. This instead grabs the EC directly from
the main thread which seems to always be set.

Fixes [Bug #20016]

Co-authored-by: Dustin Brown <dbrown9@gmail.com>
2023-12-21 09:17:22 -08:00
John Hawthorn 1710eb9367 [DOC] Fix rb_postponed_job_register_once typo
Co-authored-by: Dustin Brown <dbrown9@gmail.com>
2023-12-21 09:17:22 -08:00
Peter Zhu e191bf42d2 Fix ary_make_partial_step for compaction
ary could change embeddedness due to compaction, so we should only get
the pointer after allocations.

The included test was crashing with:

    TestArray#test_slice_gc_compact_stress
    ruby/lib/pp.rb:192: [BUG] Segmentation fault at 0x0000000000000038
2023-12-21 10:39:03 -05:00
Jean Boussier fd4735130e Fix a typo in NEWS.md 2023-12-21 13:02:25 +01:00
Hiroshi SHIBATA bcb4706dac
Added limitation of bundled gems warning feature with bootsnap 2023-12-21 14:16:09 +09:00
git 28e3886689 Update bundled gems list at d587852cf7 [ci skip] 2023-12-21 01:26:44 +00:00
Soutaro Matsumoto d587852cf7
Bundle RBS 3.4.0 (#9293)
Bundle RBS 3.4.0 and TypeProf 0.21.9.
2023-12-21 01:26:08 +00:00