Skip to content

Specific arity kwargs undefined#7494

Merged
enebo merged 2 commits intojruby:masterfrom
headius:specific_arity_kwargs_undefined
Nov 28, 2022
Merged

Specific arity kwargs undefined#7494
enebo merged 2 commits intojruby:masterfrom
headius:specific_arity_kwargs_undefined

Conversation

@headius
Copy link
Member

@headius headius commented Nov 28, 2022

This seems to fix an issue locally running railsbench under indy mode
that is superficially similar to #7434.

The issue occurs in our own Kernel#initialize_dup when running with JIT
and indy enabled. The originator is a Hash#merge that does a dup of an
empty hash, ultimately attempting to convert our UndefinedValue into a
hash object for the dup/replace logic. It seems like there's a rogue
keyword flag in the CallInfo at this point, such that it assumes the
incoming hash is supposed to be used as kwargs. Since it is empty, it
returns undefined which replaces the single hash argument passed in.
That value then goes on to be to_hash'ed and blows up.

It is unclear why this requires indy mode. There may be something
broken with CallInfo clearing alonst some indy path, or the non-indy
call path may not be using this single-argument kwarg-munging logic.

See #7434

This path also dups the identity flag so we don't need to do that
separately.
This seems to fix an issue locally running railsbench under indy mode
that is superficially similar to jruby#7434.

The issue occurs in our own Kernel#initialize_dup when running with JIT
and indy enabled. The originator is a Hash#merge that does a dup of an
empty hash, ultimately attempting to convert our UndefinedValue into a
hash object for the dup/replace logic. It seems like there's a rogue
keyword flag in the CallInfo at this point, such that it assumes the
incoming hash is supposed to be used as kwargs. Since it is empty, it
returns undefined which replaces the single hash argument passed in.
That value then goes on to be to_hash'ed and blows up.

It is unclear why this requires indy mode. There may be something
broken with CallInfo clearing alonst some indy path, or the non-indy
call path may not be using this single-argument kwarg-munging logic.

See jruby#7434
@headius headius added this to the JRuby 9.4.1.0 milestone Nov 28, 2022
@enebo enebo merged commit 2723fc1 into jruby:master Nov 28, 2022
@headius headius deleted the specific_arity_kwargs_undefined branch November 30, 2022 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants