Issue #15953 has been updated by luke-gru (Luke Gruber).


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

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

Thanks,

----------------------------------------
Bug #15953: Wrong heap size given to ruby_sized_xfree when freeing shared root arrays
https://bugs.ruby-lang.org/issues/15953#change-78804

* Author: luke-gru (Luke Gruber)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
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,



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>