Skip to content

Fixes #8948. SassC - array size too big#8950

Merged
enebo merged 1 commit intojruby:masterfrom
enebo:topic/fix_8948
Aug 7, 2025
Merged

Fixes #8948. SassC - array size too big#8950
enebo merged 1 commit intojruby:masterfrom
enebo:topic/fix_8948

Conversation

@enebo
Copy link
Member

@enebo enebo commented Aug 7, 2025

At some point during JRuby 10 we decided to pre-alloc get_array_of_string. Later JRuby API changes made it appear like those new APIs caused this but it was pre-alloc.

The problem is sassc (or FFI) decides to ask for an array or strings and the size of the memory alloced is MAX_LONG (big question on why unrelated to this issue). get_array_of_strings has an if check for null memory and immediately exits the fill loop and basically makes a zero length array. By pre-allocing we basically do not ever see that this is a small array.

I reverted to using an empty array like 9.4 still does.

At some point during JRuby 10 we decided to pre-alloc
get_array_of_string.  Later JRuby API changes made it appear
like those new APIs caused this but it was pre-alloc.

The problem is sassc (or FFI) decides to ask for an array
or strings and the size of the memory alloced is MAX_LONG (big
question on why unrelated to this issue).  get_array_of_strings
has an if check for null memory and immediately exits the fill
loop and basically makes a zero length array.  By pre-allocing
we basically do not ever see that this is a small array.

I reverted to using an empty array like 9.4 still does.
@enebo enebo added this to the JRuby 10.0.2.0 milestone Aug 7, 2025
@enebo enebo merged commit f523070 into jruby:master Aug 7, 2025
70 of 72 checks passed
@enebo enebo deleted the topic/fix_8948 branch August 7, 2025 15:39
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.

1 participant