Segfaults in lj_snap_shrink

  • From: Denis Golovan <denis.golovan@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 30 Nov 2016 11:57:31 +0200

Hi all

I am getting segfaults in lj_snap_shrink

...
  snap->nent = (uint8_t)m;
  nlim = J->cur.nsnapmap - snap->mapofs - 1;
  while (n <= nlim) map[m++] = map[n++];  /* Move PC + frame links
down. */  <---------HERE
  J->cur.nsnapmap = (uint16_t)(snap->mapofs + m);  /* Free up space in map. */
...

Unfortunately it seems it's caused by evaluating large source files at
"require" step.
Trying to narrow the test case was not successful so far.

Reproduces under 2.1 3ad2bbf58600f8ba2918b56b0a7ab305df19cfe5 both
GC64 on and off.
Could anybody suggest a solution?

BR,
Denis

Other related posts: