From: Vladimir T. <vtz...@gm...> - 2017-05-29 10:57:18
|
Hi Bruno, On Sun, May 28, 2017 at 5:20 PM, Vladimir Tzankov <vtz...@gm...> wrote: > > The stream object has been moved due to compaction but strm_encoding has >> > either not moved (unlikely - its heap has shrunk) or has not been >> updated. >> >> I'd also guess that it has not been updated. Is the reclength of the >> stream appropriate? Has the reclength been changed since the >> allocate_stream >> call? >> > > Stream record looks ok but encoding object is not getting marked during GC. > The problem is GC mark phase. Streams with strmtype equal to Rectype_Weakpointer or Rectype_Weakpointer are not getting marked since SXrecord_nonweak_length() returns 0 for them! Here is gdb output for this case: (gdb) p /x *(Stream)0xb0000005ac0 $32 = {header = {_GCself = 0xb0000005ac0, flags = {0xb0000005ac0}}, strmtype = 0x11, strmflags = 0x41, reclength = 0x15, recxlength = 0x60, strm_rd_by = 0x464b98, strm_rd_by_array = 0x464b80, strm_wr_by = 0x464b68, strm_wr_by_array = 0x464b50, strm_rd_ch = 0x462df0, strm_pk_ch = 0x45af68, strm_rd_ch_array = 0x462918, strm_rd_ch_last = 0x2000000000a, strm_wr_ch = 0x464b08, strm_wr_ch_array = 0x464af0, strm_wr_ch_npnl = 0x464b08, strm_wr_ch_array_npnl = 0x464af0, strm_wr_ch_lpos = 0x200000000000, strm_other = 0xb0000005b38} (gdb) p /x *(Record)0xb0000005ac0 $33 = {header = {_GCself = 0xb0000005ac0, flags = {0xb0000005ac0}}, rectype = 0x11, recflags = 0x41, reclength = 0x6015, recdata = 0xb0000005ad0} (gdb) p /x Rectype_Weakpointer $34 = 0x11 And SXrecord_nonweak_length() explicitly uses Record_type() to check for weak pointers. This also explains why I experience this only in non-libffcall builds. With DYNAMIC_FFI, Rectype_Weakpointer is 0x14 because of the three additional FFI record types. |