| Age | Commit message (Collapse) | Author |
|
call-seq:
Ractor.sharable_proc(self: nil){} -> sharable proc
It returns shareable Proc object. The Proc object is
shareable and the self in a block will be replaced with
the value passed via `self:` keyword.
In a shareable Proc, the outer variables should
* (1) refer shareable objects
* (2) be not be overwritten
```ruby
a = 42
Ractor.shareable_proc{ p a }
#=> OK
b = 43
Ractor.shareable_proc{ p b; b = 44 }
#=> Ractor::IsolationError because 'b' is reassigned in the block.
c = 44
Ractor.shareable_proc{ p c }
#=> Ractor::IsolationError because 'c' will be reassigned outside of the block.
c = 45
d = 45
d = 46 if cond
Ractor.shareable_proc{ p d }
#=> Ractor::IsolationError because 'd' was reassigned outside of the block.
```
The last `d`'s case can be relaxed in a future version.
The above check will be done in a static analysis at compile time,
so the reflection feature such as `Binding#local_varaible_set`
can not be detected.
```ruby
e = 42
shpr = Ractor.shareable_proc{ p e } #=> OK
binding.local_variable_set(:e, 43)
shpr.call #=> 42 (returns captured timing value)
```
Ractor.sharaeble_lambda is also introduced.
[Feature #21550]
[Feature #21557]
|
|
The validation is relevant only for traceable userland ruby objects ruby
code could interact with. ZJIT's use of rb_vm_method_cfunc_is()
allocates a CC imemo and was failing this validation when it was
actually fine. Relax the check.
|
|
|
|
## Context
#14409
https://github.com/ruby/ruby/pull/14409#discussion_r2350238583
>You may have noticed that this doesn't produce a New range instruction. For that you probably need to use a local variable (makes it harder for the bytecode compiler to reason about, but the JIT sees through it). If you have time, please rewrite these tests.
https://github.com/ruby/ruby/pull/14409#discussion_r2350240389
>There's some code above to do this for you: see arguments_likely_fixnums and coerce something or other
## Changes
### Refactor tests
Modify tests force the usage of `NewRangeFixnum` instruction and make tests names more consistent.
### Refactor optimize ranges
Didn't found `arguments_likely_fixnums` to be applicable unless we enable profiling for `NewRange` and change the criteria of when the optimization fires. But there were other ways to clean up the code.
Simplify the logic and move it to `type_specialize`. Deleted the standalone `optimize_ranges` function.
|
|
* See https://bugs.ruby-lang.org/issues/21613
|
|
The stack layout is incompatible with the way we reify the stack for
generating fallback SendWithoutBlock: the receiver is an embedded VALUE
in the bytecode, not on the stack. Since we don't expect these to be
overridden often, instead of fussing about with the stack layout, just
hope for the best and PatchPoint/SideExit.
Fix https://github.com/Shopify/ruby/issues/760
|
|
https://github.com/ruby/prism/commit/d1b22f59a0
|
|
https://github.com/ruby/prism/commit/cb27f5a70a
|
|
arguments
https://bugs.ruby-lang.org/issues/21168#note-5
The added code samples align with `parse.y`, except for `foo(bar baz do end)` which `parse.y` currently rejects but shouldn't.
https://github.com/ruby/prism/commit/3a4e102d80
|
|
e.g.
```ruby
{ 1 => 2 }
```
The callback will be invoked for `1` as while it has a native JSON
equivalent, it's not legal as an object name.
|
|
Fix: https://github.com/ruby/json/issues/861
It's not incorrect to use scientific notation, but it tend
to throw people off a bit, so it's best to keep it for very large
numbers.
https://github.com/ruby/json/commit/1566cd01a6
|
|
Fix: https://github.com/ruby/json/issues/859
https://github.com/ruby/json/commit/67ebabec75
Co-Authored-By: Jean Boussier <jean.boussier@gmail.com>
|
|
https://github.com/ruby/json/commit/08b9eb0ee6
|
|
to prevent implicit file discovery missing files.
https://github.com/ruby/json/commit/6bded942c4
|
|
https://github.com/ruby/json/commit/5855f4f603
|
|
* ZJIT: Compile sendforward with dynamic dispatch
* Reload locals only if it has blockiseq
* Add a test case of ... with other args
|
|
If another ractor is calling for GC, we need to prevent the current one
from joining the barrier. Otherwise, our half-built object will be marked.
The repro script was:
test.rb:
```ruby
require "objspace"
1000.times do
ObjectSpace.trace_object_allocations do
r = Ractor.new do
_obj = 'a' * 1024
end
r.join
end
end
```
$ untilfail lldb -b ./exe/ruby -o "target create ./exe/ruby" -o "run test.rb" -o continue
It would fail at `ractor_port_mark`, rp->r was a garbage value. Credit to John for finding the
solution.
Co-authored-by: John Hawthorn <john.hawthorn@shopify.com>
|
|
* ZJIT: Support variadic C calls
This reduces the `dynamic_send_count` in `liquid-render` by ~21%
* ZJIT: Reuse gen_push_frame
* ZJIT: Avoid optimizing variadic C call when tracing is enabled
|
|
The test is no longer useful since
5c7dfe85a1dc49334e2828791f0ade42eee662db because Module#initialize_copy
is empty/not defined anymore.
|
|
|
|
|
|
|
|
and also `1 and foo = bar baz`
This is a partial fix for https://github.com/ruby/prism/issues/3106
It still accepts `a = b c and 1`
https://github.com/ruby/prism/commit/7a13d3535b
|
|
It crashes frequently on CI but I am not able to reproduce locally:
https://ci.rvm.jp/results/trunk-random1@ruby-sp2-noble-docker/5954509
https://ci.rvm.jp/results/trunk-random0@ruby-sp2-noble-docker/5954501
|
|
test_post_connect_check_with_anon_ciphers:
test_tmp_dh_callback:
test_tmp_dh:
DH missing the q value on unknown named parameters (ciphers) is not
FIPS-approved, according to the FIPS-186-4 APPENDIX B: Key Pair Generation -
B.1.1 Key Pair Generation Using Extra Random Bits, the inputs p, q, and g are
required. However, TLS doesn't send q.
https://csrc.nist.gov/pubs/fips/186-4/final
OpenSSL has a special workaround to recover the missing "q" value for known
named parameters, which is the reason why other tests that use the default
parameters in `lib/openssl/ssl.rb` are working.
Note that the test_post_connect_check_with_anon_ciphers test got the following error on
`OpenSSL.debug = true` in FIPS.
```
/home/jaruga/var/git/ruby/openssl/lib/openssl/ssl.rb:551: warning: error on stack: error:0A0C0103:SSL routines:tls_construct_server_key_exchange:internal error
```
test_get_ephemeral_key:
kRSA (PKCS1-v1_5 padding) is not allowed in FIPS according to the
NIST SP 800-131A Rev. 2 - 6 Key Agreement and Key Transport Using RSA -
Table 5: Approval Status for the RSA-based Key Agreement and Key Transport
Schemes - PKCS1-v1_5 padding - Disallowed after 2023
https://csrc.nist.gov/pubs/sp/800/131/a/r2/final
Note that the test_get_ephemeral_key test got the following error on
`OpenSSL.debug = true` in FIPS.
```
test/openssl/test_ssl.rb:2326: warning: error on stack: error:1C8000A8:Provider routines:rsa_encrypt:invalid padding mode
```
https://github.com/ruby/openssl/commit/ac3559e51e
|
|
failures
(https://github.com/ruby/openssl/pull/939)
* Add AuthTagError exception for AEAD authentication failures
- Add OpenSSL::Cipher::AuthTagError as a subclass of CipherError
- Raise AuthTagError specifically for AEAD cipher authentication tag verification failures
- Enhanced error messages: 'AEAD authentication tag verification failed' for auth failures
- Precise detection: Only EVP_CipherFinal_ex failures in AEAD ciphers raise AuthTagError
- All other errors (key setup, IV setup, update failures, etc.) still raise CipherError
- Comprehensive test coverage for GCM/CCM modes and error inheritance
- Fully backwards compatible: AuthTagError < CipherError
https://github.com/ruby/openssl/commit/9663b09040
|
|
OSSL_DECODER"
This reverts commit https://github.com/ruby/openssl/commit/5347880c6eb0 and
https://github.com/ruby/openssl/commit/985ba27d6339.
These commits attempted to stop processing after the first relevant PEM
block, whether it is successful or not, when the input contains multiple
keys.
It turned out that it cannot be reliably determined using the
OSSL_DECODER API. There is an edge case where OSSL_DECODER_from_bio()
reports "unsupported" even though the input actually contains an error:
https://redirect.github.com/ruby/openssl/pull/931#discussion_r2347813807
Revert the changes for now and keep the existing behavior, as partial
support does not seem worth the added complexity.
https://github.com/ruby/openssl/commit/319cd4952a
|
|
This reverts commit 0dc1cd407e7775610f2bcaef6c1282369867f91c.
1213adfe5526d65cce81a9fb127074130c8faea7 is fixed this issue.
|
|
In the Ruby test suite, this test class is causing trouble because
ostruct is not available. Having an autoload for JSON::GenericObject but
causing it not to define the constant causes a warning.
See https://github.com/ruby/json/commit/0dc1cd407e77 and
https://github.com/ruby/json/commit/caa5d8cdd748 in ruby.
We can skip defining the test class entirely instead when ostruct is not
available.
https://github.com/ruby/json/commit/6f6a4cdfd7
|
|
|
|
|
|
If a character literal was followed by a string concatenation, then
the forced encoding of the string concatenation could accidentally
overwrite the explicit encoding of the character literal. We now
handle this properly.
https://github.com/ruby/prism/commit/125c375d74
|
|
|
|
This reverts commit https://github.com/ruby/prism/commit/4052d93cf852, reversing
changes made to https://github.com/ruby/prism/commit/47143d17b3f7.
https://github.com/ruby/prism/commit/f117ec6354
|
|
Fixes [Bug #21256]
Co-Authored-By: Earlopain <14981592+Earlopain@users.noreply.github.com>
|
|
It depends on ostruct gem that is no longer a part of the default
gems, and the all tests are just skipped with a warning.
|
|
|
|
|
|
|
|
Prism implemented https://bugs.ruby-lang.org/issues/20925 but
parse.y doesn't seem to support it yet and is failing related Prism tests
on CI.
This adds excludes for the tests that are failing.
|
|
|
|
This was a limitation of parse.y that prism intentionally replicated.
https://github.com/ruby/prism/commit/8fd12d594c
|
|
https://github.com/ruby/prism/commit/3f58fa7705
|
|
Since cb419e3912f0514b8151469b0a4a4b83cbbcce78 we're no longer testing
this case because foo is redefined on obj1.
|
|
Continue processing only when OSSL_DECODER_from_bio() returns the error
code ERR_R_UNSUPPORTED. Otherwise, raise an exception without retrying
decoding the input in another format.
This fixes another case where OpenSSL::PKey.read prompts for a
passphrase multiple times when the input contains multiple
passphrase-protected PEM blocks and the first one cannot be decoded.
I am not entirely sure if the error code ERR_R_UNSUPPORTED is considered
part of the public interface of OpenSSL, but this seems to be the only
option available and is the approach used internally by the
PEM_read_bio_*() functions.
Fixes https://github.com/ruby/openssl/issues/927
https://github.com/ruby/openssl/commit/985ba27d63
|
|
Specify OSSL_DECODER_CTX_set_pem_password_cb() only when we expect a
passphrase-protected private key.
OSSL_DECODER appears to try to decrypt every PEM block in the input even
when the PEM header does not match the requested selection. This can
cause repeated prompts for a passphrase in a single OpenSSL::PKey.read
call.
https://github.com/ruby/openssl/commit/933503f49f
|
|
Add tests covering edge cases in the current behavior to prevent
accidental regressions. The next patches will update the OpenSSL 3.x
path.
https://github.com/ruby/openssl/commit/468f8ceea2
|
|
|
|
|
|
TestRubyOptimization#test_block_given_aset_aref
|