Project

General

Profile

Actions

Bug #15953

closed

Wrong heap size given to ruby_sized_xfree when freeing shared root arrays

Added by luke-gru (Luke Gruber) almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:93325]

Description

In ary_heap_free, the macro ARY_HEAP_CAPA is used to pass on to rb_sized_xfree. However, ARY_HEAP_CAPA uses the aux.capa field,
which is actually the number of shared strings that are using the root array, if a shared root is getting freed. The actually capa is RARRAY_LEN(ary).

I'll add a PR to fix this.

Thanks,

Updated by luke-gru (Luke Gruber) almost 5 years ago

PR here: https://github.com/ruby/ruby/pull/2253

I ran the make test-all suite with #define ARRAY_DEBUG 1, no failed assertions (I added a new assertion in a macro).

Thanks,

Actions #2

Updated by luke-gru (Luke Gruber) almost 5 years ago

  • Status changed from Open to Closed

Applied in changeset git|97b4fe2ff6bffe8728952236f2027aa6242f8f40.


array.c: Wrong heap size given to ruby_sized_xfree when freeing shared roots

Fixes [Bug #15953]

Closes: https://github.com/ruby/ruby/pull/2253

Actions

Also available in: Atom PDF

Like0
Like0Like0