79677 Commits

Author SHA1 Message Date
Kevin Newton
746eede412 [ruby/yarp] Constant on block parameter node
https://github.com/ruby/yarp/commit/2cd9a67150
2023-09-06 18:18:10 +00:00
Peter Zhu
08929b344d Try to fix flaky test_warmup_frees_pages
This test sometimes fails with:

```
  1) Failure:
TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2750]:
<202> expected but was
<203>.
```
2023-09-06 13:31:50 -04:00
Takashi Kokubun
a334077b7b
YJIT: Make compiled_* stats available by default (#8379)
* YJIT: Make compiled_* stats available by default

* Update comment about default counters [ci skip]

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>

---------

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2023-09-06 09:29:33 -07:00
Kevin Newton
dee383b262 [ruby/yarp] Constants on classes and modules
(https://github.com/ruby/yarp/pull/1409)

https://github.com/ruby/yarp/commit/0a11ec579f
2023-09-06 16:19:43 +00:00
Jemma Issroff
1d4d9a016a
[YARP] ClassNode and ModuleNode use name_constant (#8384) 2023-09-06 12:19:23 -04:00
Peter Zhu
b3b57f70cc Fix missing write barrier in iseq instruction list
There's a missing write barrier for operands in the iseq instruction
list, which can cause crashes.

It can be reproduced when Ruby is compiled with `-DRUBY_DEBUG_ENV=1`.
Using the following command:

```
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=0 RUBY_DEBUG=gc_stress ruby -w --disable=gems -Itool/lib -W0 test.rb
```

The following script crashes:

```
require "test/unit"
```
2023-09-06 11:18:50 -04:00
Kevin Newton
a52ac350cc [ruby/yarp] Fix assert_raises in YARP
https://github.com/ruby/yarp/commit/8f8f3530aa
2023-09-06 14:30:55 +00:00
Jemma Issroff
ae41bdac1e
[YARP] Use constant_id lookups where possible (#8374)
This commit extracts a `yp_constant_id_lookup` method and uses yp_constant_id_lookup where possible
2023-09-06 10:28:29 -04:00
Kevin Newton
5537169ef0 [ruby/yarp] Temporarily add name_constant to replace name on ClassNode/ModuleNode
https://github.com/ruby/yarp/commit/8f87686e9c
2023-09-06 14:20:13 +00:00
Kevin Newton
dae6a0a295 [ruby/yarp] Introduce YARP::Pattern
https://github.com/ruby/yarp/commit/2a12e9637b
2023-09-06 14:19:58 +00:00
Kevin Newton
4c9a036606 [ruby/yarp] Add constants and constants
https://github.com/ruby/yarp/commit/d7eaa89bc3
2023-09-06 13:00:23 +00:00
Peter Zhu
6778d2c582 Support freeing the lowest memory address page
This should help fix the following flaky test:

```
  1) Failure:
TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2751]:
<0> expected but was
<1>.
```
2023-09-06 08:43:14 -04:00
Benoit Daloze
6408da70b0 [ruby/yarp] Add deprecated aliases of the form YP_NODE_<name>_NODE
https://github.com/ruby/yarp/commit/ae1f45ff52
2023-09-06 12:30:36 +00:00
Benoit Daloze
6356f6d3cd [ruby/yarp] Rename YP_NODE_*_NODE to YP_*_NODE
https://github.com/ruby/yarp/commit/d93b93f342
2023-09-06 12:30:36 +00:00
Kazuki Yamaguchi
5ba480e4ea
Use the test-unit-ruby-core gem for Test::Unit::CoreAssertions
test/lib/core_assertions.rb and its dependencies are now packaged in
the gem test-unit-ruby-core. Let's use it instead.
2023-09-06 19:51:53 +09:00
Kazuki Yamaguchi
3fd90c0158 [ruby/openssl] test/openssl/test_pkey_ec.rb: refactor tests for EC.builtin_curves
Check that OpenSSL::PKey::EC.builtin_curves returns an array in the
expected format.

Similarly to OpenSSL::Cipher.ciphers, OpenSSL::PKey::EC.builtin_curves
returns a list of known named curves rather than actually usable ones.

https://github.com/ruby/openssl/issues/671 found that the list may
include unapproved (and thus unusable) curves when the FIPS module is
loaded.

https://github.com/ruby/openssl/commit/c53cbabe00
2023-09-06 19:31:11 +09:00
Kazuki Yamaguchi
1d4a43e7b0 [ruby/openssl] test/openssl/test_ossl.rb: relax assertion for error messages
The test case test_error_data utilizes the error message generated by
X509V3_EXT_nconf_nid(). The next commit will use X509V3_EXT_nconf(),
which generates a slightly different error message. Let's adapt the
check to it.

https://github.com/ruby/openssl/commit/9cdfa3a4d1
2023-09-06 19:30:55 +09:00
Michael Richardson
91e5f51607 [ruby/openssl] x509ext: let X509::ExtensionFactory#create_ext take a dotted OID string
instead of looking of NIDs and then using X509V3_EXT_nconf_nid,
instead just pass strings to X509V3_EXT_nconf, which has all the logic for
processing dealing with generic extensions
also process the oid through ln2nid() to retain compatibility.

[rhe: tweaked commit message and added a test case]

https://github.com/ruby/openssl/commit/9f15741331
2023-09-06 19:30:32 +09:00
Kazuki Yamaguchi
98d8f6128e [ruby/openssl] x509ext: test OpenSSL::X509::ExtensionFactory#create_ext with ln
OpenSSL::X509::ExtensionFactory#create_ext and #create_extensions
accepts both sn (short names) and ln (long names) for registered OIDs.

This is different from the behavior of the openssl command-line utility
which accepts only sn in openssl.cnf keys.

Add a test case to check this.

https://github.com/ruby/openssl/commit/91ae46c8d7
2023-09-06 19:28:47 +09:00
Petrik
9b6128c541 [ruby/openssl] Fix OCSP documentation
`port` should be called on the `ocsp_uri` URI instead of `ocsp`, which
is just a string.

https://github.com/ruby/openssl/commit/89a1c82dd0
2023-09-06 19:26:27 +09:00
Mau Magnaguagno
60a6de81a8 [ruby/openssl] Prefer String#unpack1
(https://github.com/ruby/openssl/pull/586)

String#unpack1 avoids the intermediate array created by String#unpack
for single elements, while also making a call to Array#first/[0]
unnecessary.

https://github.com/ruby/openssl/commit/8eb0715a42
2023-09-06 19:24:53 +09:00
Kazuki Yamaguchi
b6d7cdc2ba [ruby/openssl] ssl: use ffdhe2048 from RFC 7919 as the default DH group parameters
In TLS 1.2 or before, if DH group parameters for DHE are not supplied
with SSLContext#tmp_dh= or #tmp_dh_callback=, we currently use the
self-generated parameters added in commit https://github.com/ruby/openssl/commit/bb3399a61c03 ("support 2048
bit length DH-key", 2016-01-15) as the fallback.

While there is no known weakness in the current parameters, it would be
a good idea to switch to pre-defined, more well audited parameters.

This also allows the fallback to work in the FIPS mode.

The PEM encoding was derived with:

	# RFC 7919 Appendix A.1. ffdhe2048
	print OpenSSL::PKey.read(OpenSSL::ASN1::Sequence([OpenSSL::ASN1::Integer((<<-END).split.join.to_i(16)), OpenSSL::ASN1::Integer(2)]).to_der).to_pem
	    FFFFFFFF FFFFFFFF ADF85458 A2BB4A9A AFDC5620 273D3CF1
	    D8B9C583 CE2D3695 A9E13641 146433FB CC939DCE 249B3EF9
	    7D2FE363 630C75D8 F681B202 AEC4617A D3DF1ED5 D5FD6561
	    2433F51F 5F066ED0 85636555 3DED1AF3 B557135E 7F57C935
	    984F0C70 E0E68B77 E2A689DA F3EFE872 1DF158A1 36ADE735
	    30ACCA4F 483A797A BC0AB182 B324FB61 D108A94B B2C8E3FB
	    B96ADAB7 60D7F468 1D4F42A3 DE394DF4 AE56EDE7 6372BB19
	    0B07A7C8 EE0A6D70 9E02FCE1 CDF7E2EC C03404CD 28342F61
	    9172FE9C E98583FF 8E4F1232 EEF28183 C3FE3B1B 4C6FAD73
	    3BB5FCBC 2EC22005 C58EF183 7D1683B2 C6F34A26 C1B2EFFA
	    886B4238 61285C97 FFFFFFFF FFFFFFFF
	END

https://github.com/ruby/openssl/commit/a5527cb4f4
2023-09-06 19:24:43 +09:00
Mau Magnaguagno
4a042b2255 [ruby/openssl] Refactor Buffering consume_rbuff and getbyte methods
Prefer ``slice!`` for ``Buffering#consume_rbuff`` and safe navigation with ``ord`` for ``Buffering#getbyte``, similar to ``each_byte``.

https://github.com/ruby/openssl/commit/5f6abff178
2023-09-06 19:24:02 +09:00
Kazuki Yamaguchi
912f1cda0d [ruby/openssl] Remove OSSL_DEBUG compile-time option
Remove the OSSL_DEBUG flag and OpenSSL.mem_check_start which is only
compiled when the flag is given. They are meant purely for development
of Ruby/OpenSSL.

OpenSSL.mem_check_start helped us find memory leak bugs in past, but
it is no longer working with the recent OpenSSL versions. Let's just
remove it now.

https://github.com/ruby/openssl/commit/8c7a6a17e2
2023-09-06 19:20:57 +09:00
Nobuyoshi Nakada
779cab6655
RHASH_AR_TABLE never returns NULL now [ci skip] 2023-09-06 17:46:36 +09:00
Nobuyoshi Nakada
abd0b9b28a
Exclude -Wmisleading-indentation when -save-temps
That option may be triggered wrongly by pre-processed files.
2023-09-06 14:06:26 +09:00
Jemma Issroff
ae96232161
[YARP] Fix warning on compiling constant test (#8377) 2023-09-05 17:29:32 -04:00
Kevin Newton
767f984017 [ruby/yarp] Flatten CallAndWriteNode, CallOrWriteNode, and CallOperatorWriteNode
https://github.com/ruby/yarp/commit/8f26ffa0b2
2023-09-05 19:13:30 +00:00
Kevin Newton
95e4bdcd62 [ruby/yarp] Rename CallNode#operator_loc to CallNode#call_operator_loc
https://github.com/ruby/yarp/commit/fbcd307a54
2023-09-05 19:13:29 +00:00
Alan Wu
6c4df555fd YJIT: Silence Clippy for bindgen generated code
New Clippy lint in 1.72.0 is breaking our build as GitHub has updated
their image. No point hearing about lints from generated code we don't
manually write.
2023-09-05 14:46:44 -04:00
Kevin Newton
c384ef0799 [ruby/yarp] Introduce a BlockLocalVariableNode
This is a tradeoff that I think is worth it. Right now we have a
location list that tracks the location of each of the block locals.
Instead, I'd like to make that a node list that has a proper node
in each spot in the list. In doing so, we eliminate the need to have
a location list at all, making it simpler on all of the various
consumers as we have one fewer field type. There should be minimal
memory implications here since this syntax is exceedingly rare.

https://github.com/ruby/yarp/commit/04d329ddf0
2023-09-05 18:41:51 +00:00
Peter Zhu
9a8398a18f Introduce rb_gc_remove_weak
If we're during incremental marking, then Ruby code can execute that
deallocates certain memory buffers that have been called with
rb_gc_mark_weak, which can cause use-after-free bugs.
2023-09-05 14:32:15 -04:00
Peter Zhu
06a1d16dc2 Reuse allocated buffer in WeakMap
If the key exists in WeakMap and WeakKeyMap, then we can reuse the
buffer and we can avoid an allocation.
2023-09-05 14:32:15 -04:00
Jemma Issroff
bdfa885f87
[YARP] Fix aliasing instructions to use INT2FIX (#8373) 2023-09-05 13:58:16 -04:00
Burdette Lamar
a17a1cd535
[DOC] Fix for RDoc for Process.kill (#8370) 2023-09-05 12:53:11 -04:00
Nobuyoshi Nakada
88b25294b0
Suppress macro redefinition warnings
When building with ruby, `snprintf` is replaced with `ruby_snprintf`.
2023-09-06 01:23:35 +09:00
Peter Zhu
ab9d1910ef Rename shady to uncollectible_wb_unprotected
The term "shady object" was renamed to "uncollectible write barrier
unprotected object", so rename `has_uncollectible_shady_objects` to
`has_uncollectible_wb_unprotected_objects` for consistency.
2023-09-05 10:55:23 -04:00
Jemma Issroff
e3210177e3
[YARP] Implemented Compiler for Constant(Or/Operator/And)Nodes (#8355) 2023-09-05 10:54:21 -04:00
Peter Zhu
7a930cf0e4 Pool more slots for large size pools
We always sweep at least 2048 slots per sweep step, but only pool one
page. For large size pools, 2048 slots is many pages but one page is
very few slots. This commit changes it so that at least 1024 slots are
placed in the pooled pages per sweep step.
2023-09-05 10:52:35 -04:00
Kevin Newton
790df7d383 [ruby/yarp] Fix up CI for Ruby 2.5
https://github.com/ruby/yarp/commit/462cb561a9
2023-09-05 14:24:00 +00:00
Nobuyoshi Nakada
89a4fd6745 [ruby/yarp] Switch ERB.new at startup
https://github.com/ruby/yarp/commit/b87b4450cc
2023-09-05 13:47:54 +00:00
Nobuyoshi Nakada
e1713fa6a3 [ruby/yarp] Read template in UTF-8
https://github.com/ruby/yarp/commit/864b4ce99f
2023-09-05 13:47:52 +00:00
Benoit Daloze
6110f415cd [ruby/yarp] The value field of ClassVariableWriteNode is never null/nil
https://github.com/ruby/yarp/commit/2ddd2eff94
2023-09-05 13:47:41 +00:00
git
dbe9b8520f Update default gems list at d83b5ea09d537431ff39d68de8832d [ci skip] 2023-09-05 13:43:51 +00:00
Stan Lo
d83b5ea09d [ruby/irb] Bump version to 1.8.1
(https://github.com/ruby/irb/pull/706)

https://github.com/ruby/irb/commit/c7c838a4bf
2023-09-05 13:42:21 +00:00
Peter Zhu
ef65183692 Add check for T_NONE in rb_gc_mark_weak
This commit adds a check for T_NONE in rb_gc_mark_weak, just like
gc_mark_ptr. This will help debugging.
2023-09-05 09:27:11 -04:00
Nobuyoshi Nakada
5b157997e2
[DOC] Fix up markup 2023-09-05 21:09:41 +09:00
Nobuyoshi Nakada
7c8932365f
[DOC] Fix signal list
- Signal names can be symbols, as stated above.
- Supported signals and those values are platform dependent.
- Key sequences to send signal are configurable.
- Fix description of signal 0.

Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2023-09-05 20:36:45 +09:00
Yusuke Endoh
5b146eb5a1 Prevent "ambiguous first argument" warnings
```
/home/chkbuild/chkbuild/tmp/build/20230905T063003Z/ruby/test/yarp/compiler_test.rb:16: warning: ambiguous first argument; put parentheses or a space even after `+' operator
/home/chkbuild/chkbuild/tmp/build/20230905T063003Z/ruby/test/yarp/compiler_test.rb:17: warning: ambiguous first argument; put parentheses or a space even after `-' operator
/home/chkbuild/chkbuild/tmp/build/20230905T063003Z/ruby/test/yarp/compiler_test.rb:28: warning: ambiguous first argument; put parentheses or a space even after `+' operator
/home/chkbuild/chkbuild/tmp/build/20230905T063003Z/ruby/test/yarp/compiler_test.rb:29: warning: ambiguous first argument; put parentheses or a space even after `-' operator
```

http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230905T063003Z.log.html.gz
2023-09-05 17:35:28 +09:00
Yusuke Endoh
77db0ca6c8 Prevent a warning: method redefined; discarding old included
```
[ 3463/25719] JSONGeneratorTest#test_string_ext_included_calls_super/home/chkbuild/chkbuild/tmp/build/20230905T063003Z/ruby/test/json/json_generator_test.rb:411: warning: method redefined; discarding old included
/home/chkbuild/chkbuild/tmp/build/20230905T063003Z/ruby/test/json/json_generator_test.rb:399: warning: previous definition of included was here
```

http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230905T063003Z.log.html.gz
2023-09-05 17:29:53 +09:00