Re: SIGSEGV in LuaJIT 2.1 VM

  • From: Demi Obenour <demiobenour@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 27 Nov 2016 10:47:12 -0500

Can you submit a patch?  Random crashes are bad.

On Nov 26, 2016 5:48 AM, "Nick Zavaritsky" <mejedi@xxxxxxxxx> wrote:


On 26 Nov 2016, at 09:00, Igor Ehrlich <igor.a.ehrlich@xxxxxxxxx> wrote:

The main problem with LuaJIT here is that it changes memory protection
of the same page of memory due to trace additions/patches. I believe this
could've been avoided even in LuaJIT by mcode management re-design

It could be done without flipping memory protection, the same way LMDB
does it. Basically, you write() the changes using the fd of the
corresponding memory object.

I.e:

fd = shm_open(…);
mmap(…, fd, 0); /* map once with PROT_EXEC | PROT_READ */
/* later */
write(fd, …);

Other related posts: