summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-07-26bump teenynagachika
2024-07-22bump rexml version to 3.3.2.nagachika
2024-07-21merge revision(s) b15e88e0fcccb03b9cc5e4c1478ec9b10e26c961: [Backport #19619]nagachika
[Bug #19619] Preserve numbered parameters context Preserve numbered parameters context across method definitions
2024-07-20merge revision(s) e1104017e3080fd432c0b5fdc3ae6e004ffd0834: [Backport #19781]nagachika
YJIT: Fix cfp inconsistency on tailcall (#8107) [Bug #19781]
2024-07-20merge revision(s) a3eb5e5c70eaee12964cdd807b8f19950003141f: [Backport #20573]nagachika
Don't call `Warning.warn` unless the category is enabled (#10981) Don't call `Warning.warn` unless the category is enabled The warning category should be enabled if we want to call `Warning.warn`. This commit speeds up the following benchmark: ```ruby eval "def test; " + 1000.times.map { "' '.chomp!" }.join(";") + "; end" def run_benchmark count i = 0 while i < count start = Process.clock_gettime(Process::CLOCK_MONOTONIC) yield ms = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start puts "itr ##{i}: #{(ms * 1000).to_i}ms" i += 1 end end run_benchmark(25) do 250.times do test end end ``` On `master` this runs at about 92ms per iteration. With this patch, it is 7ms per iteration. [Bug #20573]
2024-07-20merge revision(s) fba8aff7af450e476e97b62385427dfa51850955, ↵nagachika
d8c6e91748871ab2287d7703347847fe18a292d2: [Backport #20592] [Bug #20592] Fix segfault when sending NULL to freeaddrinfo On alpine freeaddrinfo does not accept NULL pointer Fix dangling `else`
2024-07-20merge revision(s) 2dd46bb82ffc4dff01d7ea70922f0e407acafb4e: [Backport #20468]nagachika
[Bug #20468] Fix safe navigation in `for` variable
2024-07-15Revert "merge revision(s) 5fa6ba9568e87e43e08a4daeba1572254c589fb1: ↵nagachika
[Backport #20500]" This reverts commit fc5b9ffad1b0710bd999521d0bf9631af6b762c2.
2024-07-15merge revision(s) 05553cf22d43dd78b8f30cc4591230b5c000c538: [Backport #20517]nagachika
[Bug #20517] Make a multibyte character one token at meta escape
2024-07-15merge revision(s) d503e1b95a40e45d7767e0175de60092de4ba54e: [Backport #20030]nagachika
[Bug #20030] dispatch invalid escaped character without ignoring it
2024-07-15merge revision(s) 5fa6ba9568e87e43e08a4daeba1572254c589fb1: [Backport #20500]nagachika
[Bug #20500] Search non-default directories for jemalloc Co-Authored-by: lish82 (Hiroki Katagiri)
2024-07-15[Bug #20633] Fix the condition for `atomic_signal_fence`kimuraw (Wataru Kimura)
`AC_CHECK_DECLS` defines `HAVE_DECL_SYMBOL` to 1 if declared, 0 otherwise, not undefined.
2024-07-15merge partially d292a9b98ce03c76dbe13138d20b9fbf613cc02d. Just add the test ↵nagachika
to ensure the issue doesn't exit in ruby_3_2 branch.
2024-07-15merge revision(s) 58918788abd63901588e4aa1e39b5c057321c10a: [Backport #20342]nagachika
[Bug #20342] Consider wrapped load in `main` methods
2024-07-15update GitHub Action spec_guards workflow.nagachika
2024-07-15follow-up for a6b7aad954680e23e7db81d69a7e8e44583bf8b4. suppress compiler ↵nagachika
warning.
2024-07-15merge revision(s) 7e4b1f8e1935a10df3c41ee60ca0987d73281126: [Backport #20322]nagachika
[Bug #20322] Fix rb_enc_interned_str_cstr null encoding The documentation for `rb_enc_interned_str_cstr` notes that `enc` can be a null pointer, but this currently causes a segmentation fault when trying to autoload the encoding. This commit fixes the issue by checking for NULL before calling `rb_enc_autoload`.
2024-07-15merge revision(s) c7ce2f537f96ab2cf2f5fc2982d6147866ff5340: [Backport #20304]nagachika
Fix memory leak in setting encodings There is a memory leak in Encoding.default_external= and Encoding.default_internal= because the duplicated name is not freed when overwriting. 10.times do 1_000_000.times do Encoding.default_internal = nil end puts `ps -o rss= -p #{$$}` end Before: 25664 41504 57360 73232 89168 105056 120944 136816 152720 168576 After: 9648 9648 9648 9680 9680 9680 9680 9680 9680 9680
2024-07-15merge revision(s) 1faeb44dfcf777ace28321e80d0ebf942161a0a7, ↵nagachika
7f87ad9fc4bc45faf8cd33602a025f27c094b2fd: [Backport #20431] Check if macros are defined before using Assume macros with the same prefix would be defined together. Refer autoconfigured endian macro (#10572) Remove the case `RB_IO_BUFFER_HOST_ENDIAN` is not defined.
2024-07-15Revert "merge revision(s) 5e0c17145131e073814c7e5b15227d0b4e73cabe: ↵nagachika
[Backport #20169]" This reverts commit 6b73406833dd22e489114fa77c1c80c4b7af2ed0.
2024-07-15Revert "merge revision(s) e04146129ec6898dd6a9739dad2983c6e9b68056, ↵nagachika
d5080f6e8b77364483ff6727b1065e45e180f05d: [Backport #20292]" This reverts commit a54c717c7a74b91a3cdf20742c355e3ea42052d1.
2024-07-15Revert "follow-up for a54c717c7a74b91a3cdf20742c355e3ea42052d1."nagachika
This reverts commit 715633ba6e982dc5404abeafc5246c31af92ac10.
2024-07-15follow-up for a54c717c7a74b91a3cdf20742c355e3ea42052d1.nagachika
2024-07-15merge revision(s) dc146babf47a84bbd1f176d766637d4a40327019, ↵nagachika
f23d5028059078a346efc977287b669d494a5a3f, a0f7de814ae5c299d6ce99bed5fb308a05d50ba0: [Backport #20296] [Bug #20296] Clear errinfo when `exception: false` [Bug #20296] Refine the test [Bug #20296] Fix the default assertion message
2024-07-15merge revision(s) e04146129ec6898dd6a9739dad2983c6e9b68056, ↵nagachika
d5080f6e8b77364483ff6727b1065e45e180f05d: [Backport #20292] [Bug #20292] Truncate embedded string to new capacity Fix -Wsign-compare on String#initialize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../string.c:1886:57: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘long int’ [-Wsign-compare] 1886 | if (STR_EMBED_P(str)) RUBY_ASSERT(osize <= str_embed_capa(str)); | ^~
2024-07-15merge revision(s) 5e0c17145131e073814c7e5b15227d0b4e73cabe: [Backport #20169]nagachika
Make io_fwrite safe for compaction [Bug #20169] Embedded strings are not safe for system calls without the GVL because compaction can cause pages to be locked causing the operation to fail with EFAULT. This commit changes io_fwrite to use rb_str_tmp_frozen_no_embed_acquire, which guarantees that the return string is not embedded.
2024-07-13follow-up for 3faef1d40dc1d6eea8ffcd624528f431ccaf0a5b.nagachika
2024-07-13merge revision(s) f36a71e26995b69ff72bc132bbcf40ad89571414: [Backport #20307]nagachika
[Bug #20307] Fix `Hash#update` to make frozen copy of string keys
2024-07-13Extract `RHASH_STRING_KEY_P`Nobuyoshi Nakada
2024-07-13Extract `RHASH_IDENTHASH_P`Nobuyoshi Nakada
2024-07-13merge revision(s) d19d683a354530a27b4cbb049223f8dc70c75849: [Backport #20250]nagachika
rb_obj_setup: do not copy RUBY_FL_SEEN_OBJ_ID [Bug #20250] We're seting up a new instance, so it never had an associated object_id.
2024-07-07merge revision(s) 82b57d7bfeefd717c10f7a5a3484aca6b3e708a3: [Backport #20162]nagachika
Fix memory leak when duplicating too complex object [Bug #20162] Creating a ST table then calling st_replace leaks memory because the st_replace overwrites the ST table without freeing any of the existing memory. This commit changes it to use st_copy instead. For example: RubyVM::Shape.exhaust_shapes o = Object.new o.instance_variable_set(:@a, 0) 10.times do 100_000.times { o.dup } puts `ps -o rss= -p #{$$}` end Before: 23264 33600 42672 52160 61600 71728 81056 90528 100560 109840 After: 14752 14816 15584 15584 15664 15664 15664 15664 15664 15664
2024-07-07merge revision(s) e626da82eae3d437b84d4f9ead0164d436b08e1a, ↵nagachika
f3af5ae7e6c1c096bbfe46d69de825a02b1696cf: [Backport #20311] Don't pin named structs defined in Ruby [Bug #20311] `rb_define_class_under` assumes it's called from C and that the reference might be held in a C global variable, so it adds the class to the VM root. In the case of `Struct.new('Name')` it's wasteful and make the struct immortal. Make Struct memory leak test faster [Bug #20311] It times out on some platform, so we can reduce iterations. On my machine it completes in 250ms and RSS grows 8X.
2024-07-06[Backport #11036 to 3.2] Add explicit compiler fence when pushing frames to ↵Ivo Anjo
ensure safe profiling **What does this PR do?** This PR tweaks the `vm_push_frame` function to add an explicit compiler fence (`atomic_signal_fence`) to ensure profilers that use signals to interrupt applications (stackprof, vernier, pf2, Datadog profiler) can safely sample from the signal handler. This is a backport of #11036 to Ruby 3.2 . **Motivation:** The `vm_push_frame` was specifically tweaked in https://github.com/ruby/ruby/pull/3296 to initialize the a frame before updating the `cfp` pointer. But since there's nothing stopping the compiler from reordering the initialization of a frame (`*cfp =`) with the update of the cfp pointer (`ec->cfp = cfp`) we've been hesitant to rely on this on the Datadog profiler. In practice, after some experimentation + talking to folks, this reordering does not seem to happen. But since modern compilers have a way for us to exactly tell them not to do the reordering (`atomic_signal_fence`), this seems even better. I've actually extracted `vm_push_frame` into the "Compiler Explorer" website, which you can use to see the assembly output of this function across many compilers and architectures: https://godbolt.org/z/3oxd1446K On that link you can observe two things across many compilers: 1. The compilers are not reordering the writes 2. The barrier does not change the generated assembly output (== has no cost in practice) **Additional Notes:** The checks added in `configure.ac` define two new macros: * `HAVE_STDATOMIC_H` * `HAVE_DECL_ATOMIC_SIGNAL_FENCE` Since Ruby generates an arch-specific `config.h` header with these macros upon installation, this can be used by profilers and other libraries to test if Ruby was compiled with the fence enabled. **How to test the change?** As I mentioned above, you can check https://godbolt.org/z/3oxd1446K to confirm the compiled output of `vm_push_frame` does not change in most compilers (at least all that I've checked on that site).
2024-07-06merge revision(s) 75aaeb35b82da26359b9418d2963384d0c55839c: [Backport #20239]nagachika
[Bug #20239] Fix overflow at down-casting
2024-07-06merge revision(s) 3a04ea2d0379dd8c6623c2d5563e6b4e23986fae: [Backport #20305]nagachika
[Bug #20305] Fix matching against an incomplete character When matching against an incomplete character, some `enclen` calls are expected not to exceed the limit, and some are expected to return the required length and then the results are checked if it exceeds.
2024-07-06merge revision(s) 78d9fe69479d32214a52ad7291c3973f1b6b7f6f, ↵nagachika
04729fe68dceddab045be7324e26c2bb15aa62c7: [Backport #20286] [Backport #20286] Ensure that exiting thread invokes end-of-life behaviour. (#10039) Fix exception handling in `rb_fiber_scheduler_set`. (#10042)
2024-07-06merge revision(s) a7ff264477105b5dc0ade6facad4176a1b73df0b: [Backport #20393]nagachika
Don't clear pending interrupts in the parent process. (#10365)
2024-07-06merge revision(s) 5d1702e01a36e11b183fe29ce10780a9b1a41cf0: [Backport #20414]nagachika
Enumerator should use a non-blocking fiber, change `rb_fiber_new` to be non-blocking by default. (#10481)
2024-07-06merge revision(s) 1e08a9f0e9058186db18f29efc6458c00f10a856: [Backport #20499]nagachika
[Bug #20499] Use Xcode owned tools for Xcode clang Xcode has its own version tools that may be incompatible with genuine LLVM tools, use the tools in the same directory.
2024-07-05Added macos-13 and removed macos-11Hiroshi SHIBATA
2024-06-19bump patchlevel.nagachika
2024-06-19bump rexml version to 3.2.9.nagachika
2024-06-18added redirect wrapper for envutilHiroshi SHIBATA
2024-06-18Load Rake::TaskLib when missing itHiroshi SHIBATA
2024-06-18Show prerequisites for compile taskNobuyoshi Nakada
2024-06-18Allow test-unit-ruby-core files to be loaded from bundled gemsNobuyoshi Nakada
Separate the directly from the customized test-unit, since it may not work with bundled gems.
2024-06-18merge revision(s) ↵nagachika
9f708d48f6df37ee9600db9d51b57a156609a13b,0301473fb523c71d8cdc4966971f31f502001185,7f0e26b7f99bf76408569892ce20318501f74729: [Backport #20516] Clear runtime dependencies if default gems is specified. The current build system uses runtime dependencies from only `.bundle` directory. We shouldn't install runtime dependencies from rubygems.org when `make test-bundled-gems` is invoked. Fixed dependencies list format Re-use strscan with ruby repo
2024-06-18partially merge revision(s) 70ad58cb62b195ba86a5ef07a565b22b02a040ea: ↵nagachika
[Backport #20516] Update bundled_gems
2024-06-18Revert "merge revision(s) 18eaf0be905e3e251423b42d6f4e56b7cae1bc3b: ↵nagachika
[Backport #20494]" This reverts commit ec30266267b2a063089b8ce7967203bcbadbdf4e.