Bug #8510
closedassertion failed in ary_resize_capa
Description
-DARRAY_DEBUG を付けていると enc.mk のあたりで make が通りません。
generating enc.mk
miniruby: .../ruby/array.c:153: ary_resize_capa: Assertion `!(!!((!(((VALUE)(ary) & RUBY_IMMEDIATE_MASK) || !!(((VALUE)(ary) & ~((VALUE)RUBY_Qnil)) == 0)) && (int)(((struct RBasic*)(ary))->flags & RUBY_T_MASK) != RUBY_T_NODE)?(((struct RBasic*)(ary))->flags&((((VALUE)1)<<11))):((((int)(long)(ary))&RUBY_FIXNUM_FLAG)||((((int)(long)(ary))&RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG))))' failed.
Aborted (core dumped)
原因を調べてみたところ、 ary_make_shared で
else if (OBJ_FROZEN(ary)) {
ary_resize_capa(ary, ARY_HEAP_LEN(ary));
という条件で ary_resize_capa を呼び出しているのに、ary_resize_capa の中に
assert(!OBJ_FROZEN(ary));
があるからのようです。
Updated by znz (Kazuhiro NISHIYAMA) over 11 years ago
- Status changed from Open to Assigned
- Assignee set to nobu (Nobuyoshi Nakada)
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r41227.
Kazuhiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
array.c: fix false assertion in ary_make_shared
- array.c (ary_shrink_capa): shrink the capacity so it fits just with
the length. - array.c (ary_make_shared): release never used elements from frozen
array to be shared. [ruby-dev:47416] [Bug #8510]