Commit graph

8729 commits

Author SHA1 Message Date
Nobuyoshi Nakada
0a2bf5f1e2 [ruby/zlib] Check for functions with arguments and the header
With arguments, mkmf skips compilation check for the function as RHS.

9ed9d6d36e
2023-01-09 10:46:02 +00:00
Lars Kanis
f6952a94eb [ruby/psych] Fix wrong package name of MSYS2/MINGW dependency
There is no package called "libyaml-devel". "libyaml" is enough.
2023-01-09 09:39:08 +00:00
Nobuyoshi Nakada
69a2687a27 [ruby/bigdecimal] Fix format specifiers for size_t
99db3c9754
2023-01-07 03:15:27 +00:00
Nobuyoshi Nakada
dcf63b58cf [ruby/psych] Strip trailing spaces [ci skip]
e07b16ad8b
2023-01-06 06:37:01 +00:00
dsisnero
f877805a0c [ruby/psych] Add msys2 dependencies for windows
9a3816d903
2023-01-06 06:33:08 +00:00
Peter Zhu
2056c0a7c6 Add embedded status to dumps of T_OBJECT
This commit adds `"embedded":true` in ObjectSpace.dump for T_OBJECTs
that are embedded.
2023-01-05 16:00:36 -05:00
Peter Zhu
b8a3f1bd45 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
2023-01-04 09:10:58 -05:00
Nobuyoshi Nakada
f527a0911d
[DOC] [Bug #19290] fix formatting 2023-01-01 14:50:39 +09:00
Kevin Murphy
b3d330c39e
Coverage.supported? recognizes oneshot_lines mode (#7040)
This adds oneshot_lines as a mode of coverage that is supported.
2022-12-29 21:23:25 +13:00
Marco Costa
5e54c57d83 [DOC] Surface existing MonitorMixin documentation 2022-12-26 17:40:11 +09:00
Sutou Kouhei
10c9ce9d4c bump up to 3.0.5 2022-12-26 15:09:21 +09:00
Sutou Kouhei
79ad045214 [ruby/strscan] Bump version
3ada12613d
2022-12-26 15:09:21 +09:00
Mau Magnaguagno
8df574a492 [ruby/fiddle] Prefer String#unpack1 in Fiddle::ValueUtil
(https://github.com/ruby/fiddle/pull/118)

String#unpack1 is available since Ruby 2.4, and support for older than
Ruby 2.5 was dropped by #85.
Also simplified a common return statement.
2022-12-26 15:09:21 +09:00
Sutou Kouhei
1dc8c18b72 [ruby/fiddle] Bump version
3033266902
2022-12-26 15:09:21 +09:00
Hiroshi SHIBATA
cd6c7613f3
Apply the accidental commits again before Ruby 3.2.
Reverts the following commits:

  eb8d4d7b51
  edb83dc3a2
  d40064d184
2022-12-26 12:07:42 +09:00
Hiroshi SHIBATA
edb83dc3a2
Revert the additional change from openssl-3.1.0
Revert "[ruby/openssl] pkey/ec: constify"

  This reverts commit d2cd903c85.
2022-12-23 19:37:24 +09:00
Nobuyoshi Nakada
d2cd903c85 [ruby/openssl] pkey/ec: constify
6fb3499a7b
2022-12-23 11:42:15 +09:00
Hiroshi SHIBATA
3ade713967
Bump version to 1.6.2 2022-12-23 09:51:52 +09:00
Hiroshi SHIBATA
ba34208800
Bump up Racc parser version 2022-12-23 09:51:35 +09:00
Johnny Willemsen
6438f3cad6 [ruby/racc] Removed old originalId in comment
1dfbef8e99
2022-12-23 09:46:59 +09:00
Kazuki Yamaguchi
2d2baaf2f4 [ruby/openssl] Ruby/OpenSSL 3.1.0
c2f7d775c6
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi
a778305919 [ruby/openssl] Ruby/OpenSSL 3.0.2
48b79333e0
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi
046aadb89b [ruby/openssl] Ruby/OpenSSL 2.2.3
04acccd692
2022-12-23 09:39:15 +09:00
Joe Truba
0e11d2c3f8 [ruby/openssl] pkey/ec: check private key validity with OpenSSL 3
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().]

e38a63ab3d
2022-12-23 09:39:15 +09:00
Yuta Saito
782777a803 [ruby/openssl] Undefine OpenSSL::SSL for no socket platforms
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
ee22fad45d
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.]

b0cfac6a96
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi
e6ca644329 [ruby/openssl] ssl: remove OpenSSL::ExtConfig
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 998d66712a (r55191).
HAVE_TLSEXT_HOST_NAME is unused since commit 4eb4b3297a.

eed3894bda
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi
dd6f3276e0 [ruby/openssl] ssl: disable NPN support on LibreSSL
As noted in commit a2ed156cc9 ("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.

289f6e0e1f
2022-12-23 09:39:15 +09:00
Kazuki Yamaguchi
d6c16dd3e6 [ruby/openssl] ssl: update TLS1_3_VERSION workaround for older LibreSSL versions
The macro is now defined by default in LibreSSL 3.4+. Let's document it
for future readers.

935698e9f9
2022-12-23 09:39:15 +09:00
Nobuyoshi Nakada
6df4d272c3 [ruby/openssl] Suppress deprecation warnings by OpenSSL 3
91657a7924
2022-12-23 09:39:15 +09:00
Nobuyoshi Nakada
d7d1bb3e87 [ruby/openssl] Constify when building with OpenSSL 3
c0023822fe
2022-12-23 09:39:15 +09:00
Nobuyoshi Nakada
2bc7eac822 [ruby/openssl] Check for functions with arguments
b67aaf925d
2022-12-23 09:39:14 +09:00
Joe Truba
ca7a6b1553 [ruby/openssl] pkey/ec: fix ossl_raise() calls using cEC_POINT instead of eEC_POINT
b2e9f5e132
2022-12-23 09:39:14 +09:00
Joe Truba
13137236dc [ruby/openssl] raise when EC_POINT_cmp or EC_GROUP_cmp error instead of returning true
e1e8f3cebe
2022-12-23 09:39:14 +09:00
Hiroshi SHIBATA
1998d97908
[ruby/date] Bump version to 3.3.3
ea3644a7c4
2022-12-19 10:50:21 +09:00
Nobuyoshi Nakada
c316a5f2f1 [ruby/date] Adjust format [ci skip]
71c35b4054
2022-12-18 03:03:54 +00:00
Nobuyoshi Nakada
b8cc0992c6 [ruby/date] Extract head_match_p and abbreviated name length constants
3f666fa882
2022-12-18 02:58:51 +00:00
Nobuyoshi Nakada
df49bf8150 [ruby/date] Consider the length of string to parse
3bfed83ce7
2022-12-18 02:58:50 +00:00
Nobuyoshi Nakada
49dc424ff3 [ruby/date] Remove extz_pats table
945e26e243
2022-12-18 02:58:49 +00:00
Nobuyoshi Nakada
70c905963e [ruby/date] Remove merid_names table
7fe2bd5f94
2022-12-18 02:58:48 +00:00
Nobuyoshi Nakada
6efeaabef0 [ruby/date] Match abbreviated day and month names with head of full names
a45f8f03c9
2022-12-18 02:58:47 +00:00
Hiroshi SHIBATA
11f3bef260 [ruby/date] Bump version to 3.3.2
7afd9d4615
2022-12-16 06:36:03 +00:00
Hiroshi SHIBATA
d95ee11462 [ruby/io-console] Bump version to 0.6.0
441528e3eb
2022-12-16 03:45:11 +00:00
Hiroshi SHIBATA
7e26ff7dc0 [ruby/io-wait] Bump version to 0.3.0
940ba319d3
2022-12-16 02:36:21 +00:00
Jemma Issroff
e9ba3042e1 Indicate if a shape is too_complex in ObjectSpace#dump 2022-12-15 13:41:47 -08:00
Jemma Issroff
c1ab6ddc9a Transition complex objects to "too complex" shape
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>
2022-12-15 10:06:04 -08:00
Jemma Issroff
a3d552aedd Add variation_count on classes
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>
2022-12-15 10:06:04 -08:00
Samuel Williams
d20bd06a97
Remove require 'io/wait' where it's no longer necessary. (#6932)
* Remove `require 'io/wait'` as it's part of core now.

* Update ruby specs using version gates.

* Add note about why it's conditional.
2022-12-15 11:37:01 +13:00
Nobuyoshi Nakada
71dd8b3caa
socket.rb - simplify check for the method 2022-12-15 00:27:47 +09:00
Jean Boussier
1df6d0e578 objspace_dump.c: don't dump class of T_IMEMO
They don't actually have a class.
2022-12-14 15:53:41 +01:00
Hiroshi SHIBATA
bec7deba30 [ruby/date] Fixed wrong minimum version of Ruby
Fixed https://github.com/ruby/date/issues/83

9731a3e732
2022-12-14 07:56:09 +00:00