summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2025-03-13Merge strscan-3.0.7Hiroshi SHIBATA
2025-03-13Merge strscan-3.0.6Hiroshi SHIBATA
2025-02-28merge revision(s) 2b6fc9ea7212543a1be26768403f59c7a759b5ea: [Backport #21092]Hiroshi SHIBATA
[Bug #21092] Fallback variables after execonf has done When reading from a dummy makefile, the global variables initialized in `init_mkmf` may not be overridden. --- ext/extmk.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
2024-09-26merge revision(s) 0d16c36d0ab2afa2ec79b72b229e69c141ebdaba: [Backport #13831]nagachika
[win32/registry] Fallback to UTF-8 for unknown codepages There are some codepages like cp708 for which no ruby encoding exists: $ ruby -e "Encoding.find('cp708')" Traceback (most recent call last): 1: from -e:1:in `<main>' -e:1:in `find': unknown encoding name - cp708 (ArgumentError) win32/registry uses ENCODING to transcode error messages and expand environment variables from UTF-16LE, so using UTF-8 seems like the best choice and is better than a hard failure. This should resolve [Bug #13831]
2024-08-18merge revision(s) 97449338d6cb42d9dd7c9ca61550616e7e6b6ef6: [Backport #20649]nagachika
[Bug #20649] Allow `nil` as 2nd argument of `assign_error` Fallback to the last token element in that case, for the backward compatibilities.
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-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-05-16merge revision(s) ae8990aef098410ecc2b5f48fea9d7d171a3c5f6: [Backport #20183]nagachika
Alias init functions The extension library has each initialization function named "Init_" + basename. If multiple extensions have the same base name (such as cgi/escape and erb/escape), the same function will be registered for both names. To fix this conflict, rename the initialization functions under sub directories using using parent names, when statically linking.
2024-03-10merge revision(s) d2cd903c85f38f42c6aefc6d97a1558f74d8d9db:nagachika
[ruby/openssl] pkey/ec: constify https://github.com/ruby/openssl/commit/6fb3499a7b --- ext/openssl/ossl_pkey_ec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2024-01-18merge revision(s) b8a3f1bd456f92866c4a7bd83235f78c574784a8:nagachika
Fix crash in tracing object allocations ObjectSpace.trace_object_allocations_start could crash since it adds a TracePoint for when objects are freed. However, TracePoint could crash since it modifies st tables while inside the GC that is trying to free the object. This could cause a memory allocation to happen which would crash if it triggers another GC. See a crash log: http://ci.rvm.jp/results/trunk@ruby-sp1/4373707 --- ext/objspace/depend | 1 + ext/objspace/object_tracing.c | 7 +++++++ gc.h | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-)
2024-01-18merge revision(s) 051a874325c177e040301878069c2b28f5d06ce6: [Backport #20096]nagachika
Fix memory overread in registry.rb The terminator is not actually getting filled in; we're simply passing (two) bytes of empty memory as the NUL terminator. This can lead to garbage characters getting written to registry values. Fix this by explicitly putting a WCHAR_NUL character into the string to be sent to the registry API, like we do in the MULTI_SZ case. [Bug #20096] --- ext/win32/lib/win32/registry.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
2023-09-30merge revision(s) 6b66b5fdedb2c9a9ee48e290d57ca7f8d55e01a2: [Backport #19902]nagachika
[Bug #19902] Update the coderange regarding the changed region --- ext/-test-/string/set_len.c | 10 ++++++++++ string.c | 27 +++++++++++++++++++++++++++ test/-ext-/string/test_set_len.rb | 29 +++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+)
2023-07-01Fix cvar caching when class is clonedeileencodes
The class variable cache that was added in https://github.com/ruby/ruby/pull/4544 changed the behavior of class variables on cloned classes. As reported when a class is cloned AND a class variable was set, and the class variable was read from the original class, reading a class variable from the cloned class would return the value from the original class. This was happening because the IC (inline cache) is stored on the ISEQ which is shared between the original and cloned class, therefore they share the cache too. To fix this we are now storing the `cref` in the cache so that we can check if it's equal to the current `cref`. If it's different we don't want to read from the cache. If it's the same we do. Cloned classes don't share the same cref with their original class. This will need to be backported to 3.1 in addition to 3.2 since the bug exists in both versions. We also added a marking function which was missing. Fixes [Bug #19379] Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2023-02-07merge revision(s) fad48fefe19cc282a5b209944244a3713359b47f: [Backport #19399]NARUSE, Yui
[Bug #19399] Parsing invalid heredoc inside block parameter Although this is of course invalid as Ruby code, allow to just parse and tokenize. --- ext/ripper/lib/ripper/lexer.rb | 2 +- test/ripper/test_lexer.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
2023-01-31merge revision(s) 21dced8b01823a991829b66ffdc8ffc635965c76: [Backport #19389]NARUSE, Yui
[ruby/stringio] [Bug #19389] Fix chomping with longer separator https://github.com/ruby/stringio/commit/eb322a9716 --- ext/stringio/stringio.c | 5 +++-- test/stringio/test_stringio.rb | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-)
2022-12-23Revert the additional change from openssl-3.1.0Hiroshi SHIBATA
Revert "[ruby/openssl] pkey/ec: constify" This reverts commit d2cd903c85f38f42c6aefc6d97a1558f74d8d9db.
2022-12-23[ruby/openssl] pkey/ec: constifyNobuyoshi Nakada
https://github.com/ruby/openssl/commit/6fb3499a7b
2022-12-23Bump version to 1.6.2Hiroshi SHIBATA
2022-12-23Bump up Racc parser versionHiroshi SHIBATA
2022-12-23[ruby/racc] Removed old originalId in commentJohnny Willemsen
https://github.com/ruby/racc/commit/1dfbef8e99
2022-12-23[ruby/openssl] Ruby/OpenSSL 3.1.0Kazuki Yamaguchi
https://github.com/ruby/openssl/commit/c2f7d775c6
2022-12-23[ruby/openssl] Ruby/OpenSSL 3.0.2Kazuki Yamaguchi
https://github.com/ruby/openssl/commit/48b79333e0
2022-12-23[ruby/openssl] Ruby/OpenSSL 2.2.3Kazuki Yamaguchi
https://github.com/ruby/openssl/commit/04acccd692
2022-12-23[ruby/openssl] pkey/ec: check private key validity with OpenSSL 3Joe Truba
The behavior of EVP_PKEY_public_check changed between OpenSSL 1.1.1 and 3.0 so that it no longer validates the private key. Instead, private keys can be validated through EVP_PKEY_private_check and EVP_PKEY_pairwise_check. [ky: simplified condition to use either EVP_PKEY_check() or EVP_PKEY_public_check().] https://github.com/ruby/openssl/commit/e38a63ab3d
2022-12-23[ruby/openssl] Undefine `OpenSSL::SSL` for no socket platformsYuta Saito
This fixes a linkage error about `ossl_ssl_type` on platforms which do not have socket, like WASI. Even before this patch, some items are disabled under `OPENSSL_NO_SOCK` since https://github.com/ruby/ruby/commit/ee22fad45d394818690c4a7586d7bb576ba67c56 However, due to some new use of OpenSSL::SSL::Socket over the past few years, the build under `OPENSSL_NO_SOCK` had been broken. This patch guards whole `OpenSSL::SSL` items by `OPENSSL_NO_SOCK`. [ky: adjusted to apply on top of my previous commit that removed the OpenSSL::ExtConfig, and added a guard to lib/openssl/ssl.rb.] https://github.com/ruby/openssl/commit/b0cfac6a96
2022-12-23[ruby/openssl] ssl: remove OpenSSL::ExtConfigKazuki Yamaguchi
This module was introduced in 2015 for internal use within this library. Neither of the two constants in it is used anymore. I don't think we will be adding a new constant in the foreseeable future, either. OPENSSL_NO_SOCK is unused since commit https://github.com/ruby/openssl/commit/998d66712a78 (r55191). HAVE_TLSEXT_HOST_NAME is unused since commit https://github.com/ruby/openssl/commit/4eb4b3297a92. https://github.com/ruby/openssl/commit/eed3894bda
2022-12-23[ruby/openssl] ssl: disable NPN support on LibreSSLKazuki Yamaguchi
As noted in commit https://github.com/ruby/openssl/commit/a2ed156cc9f1 ("test/test_ssl: do not run NPN tests for LibreSSL >= 2.6.1", 2017-08-13), NPN is known not to work properly on LibreSSL. Disable NPN support on LibreSSL, whether OPENSSL_NO_NEXTPROTONEG is defined or not. NPN is less relevant today anyway. Let's also silence test suite when it's not available. https://github.com/ruby/openssl/commit/289f6e0e1f
2022-12-23[ruby/openssl] ssl: update TLS1_3_VERSION workaround for older LibreSSL versionsKazuki Yamaguchi
The macro is now defined by default in LibreSSL 3.4+. Let's document it for future readers. https://github.com/ruby/openssl/commit/935698e9f9
2022-12-23[ruby/openssl] Suppress deprecation warnings by OpenSSL 3Nobuyoshi Nakada
https://github.com/ruby/openssl/commit/91657a7924
2022-12-23[ruby/openssl] Constify when building with OpenSSL 3Nobuyoshi Nakada
https://github.com/ruby/openssl/commit/c0023822fe
2022-12-23[ruby/openssl] Check for functions with argumentsNobuyoshi Nakada
https://github.com/ruby/openssl/commit/b67aaf925d
2022-12-23[ruby/openssl] pkey/ec: fix ossl_raise() calls using cEC_POINT instead of ↵Joe Truba
eEC_POINT https://github.com/ruby/openssl/commit/b2e9f5e132
2022-12-23[ruby/openssl] raise when EC_POINT_cmp or EC_GROUP_cmp error instead of ↵Joe Truba
returning true https://github.com/ruby/openssl/commit/e1e8f3cebe
2022-12-19[ruby/date] Bump version to 3.3.3Hiroshi SHIBATA
https://github.com/ruby/date/commit/ea3644a7c4
2022-12-18[ruby/date] Adjust format [ci skip]Nobuyoshi Nakada
https://github.com/ruby/date/commit/71c35b4054
2022-12-18[ruby/date] Extract `head_match_p` and abbreviated name length constantsNobuyoshi Nakada
https://github.com/ruby/date/commit/3f666fa882
2022-12-18[ruby/date] Consider the length of string to parseNobuyoshi Nakada
https://github.com/ruby/date/commit/3bfed83ce7
2022-12-18[ruby/date] Remove `extz_pats` tableNobuyoshi Nakada
https://github.com/ruby/date/commit/945e26e243
2022-12-18[ruby/date] Remove `merid_names` tableNobuyoshi Nakada
https://github.com/ruby/date/commit/7fe2bd5f94
2022-12-18[ruby/date] Match abbreviated day and month names with head of full namesNobuyoshi Nakada
https://github.com/ruby/date/commit/a45f8f03c9
2022-12-16[ruby/date] Bump version to 3.3.2Hiroshi SHIBATA
https://github.com/ruby/date/commit/7afd9d4615
2022-12-16[ruby/io-console] Bump version to 0.6.0Hiroshi SHIBATA
https://github.com/ruby/io-console/commit/441528e3eb
2022-12-16[ruby/io-wait] Bump version to 0.3.0Hiroshi SHIBATA
https://github.com/ruby/io-wait/commit/940ba319d3
2022-12-15Indicate if a shape is too_complex in ObjectSpace#dumpJemma Issroff
Notes: Merged: https://github.com/ruby/ruby/pull/6939
2022-12-15Transition complex objects to "too complex" shapeJemma Issroff
When an object becomes "too complex" (in other words it has too many variations in the shape tree), we transition it to use a "too complex" shape and use a hash for storing instance variables. Without this patch, there were rare cases where shape tree growth could "explode" and cause performance degradation on what would otherwise have been cached fast paths. This patch puts a limit on shape tree growth, and gracefully degrades in the rare case where there could be a factorial growth in the shape tree. For example: ```ruby class NG; end HUGE_NUMBER.times do NG.new.instance_variable_set(:"@unique_ivar_#{_1}", 1) end ``` We consider objects to be "too complex" when the object's class has more than SHAPE_MAX_VARIATIONS (currently 8) leaf nodes in the shape tree and the object introduces a new variation (a new leaf node) associated with that class. For example, new variations on instances of the following class would be considered "too complex" because those instances create more than 8 leaves in the shape tree: ```ruby class Foo; end 9.times { Foo.new.instance_variable_set(":@uniq_#{_1}", 1) } ``` However, the following class is *not* too complex because it only has one leaf in the shape tree: ```ruby class Foo def initialize @a = @b = @c = @d = @e = @f = @g = @h = @i = nil end end 9.times { Foo.new } `` This case is rare, so we don't expect this change to impact performance of most applications, but it needs to be handled. Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/6931
2022-12-15Add variation_count on classesJemma Issroff
Count how many "variations" each class creates. A "variation" is a a unique ordering of instance variables on a particular class. This can also be thought of as a branch in the shape tree. For example, the following Foo class will have 2 variations: ```ruby class Foo ; end Foo.new.instance_variable_set(:@a, 1) # case 1: creates one variation Foo.new.instance_variable_set(:@b, 1) # case 2: creates another variation foo = Foo.new foo.instance_variable_set(:@a, 1) # does not create a new variation foo.instance_variable_set(:@b, 1) # does not create a new variation (a continuation of the variation in case 1) ``` We will use this number to limit the amount of shapes that a class can create and fallback to using a hash iv lookup. Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/6931
2022-12-15Remove `require 'io/wait'` where it's no longer necessary. (#6932)Samuel Williams
* Remove `require 'io/wait'` as it's part of core now. * Update ruby specs using version gates. * Add note about why it's conditional. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-12-15socket.rb - simplify check for the methodNobuyoshi Nakada
2022-12-14objspace_dump.c: don't dump class of T_IMEMOJean Boussier
They don't actually have a class. Notes: Merged: https://github.com/ruby/ruby/pull/6925
2022-12-14[ruby/date] Fixed wrong minimum version of RubyHiroshi SHIBATA
Fixed https://github.com/ruby/date/issues/83 https://github.com/ruby/date/commit/9731a3e732