Re: SEGV in in lua_resume after lua_yield from hook.

  • From: Theo Schlossnagle <jesus@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 3 Apr 2022 15:57:12 -0400

On Sun, Apr 3, 2022 at 4:09 AM Mike Pall <mikelj-2204@xxxxxxx> wrote:

Theo Schlossnagle wrote:
On Wed, Mar 30, 2022 at 4:59 PM Mike Pall <mikelj-2203@xxxxxxx> wrote:
Other things to check for would be whether lj_dispatch_ins() sets
everything up correctly before calling the hook function.

In my testing, I see lj_dispatch_ins setup right before my yield in all
cases except in the event of BC_FUNCF.  For that operation, I never enter
lj_dispatch_ins at all.  Is that expected?

Ah, sorry, I meant lj_dispatch_call().

--Mike


Thanks for all the pointers.  I've been able to avoid the crash during
resume by having the lj_dispatch_call function adopt some of the behavior
of lj_dispatch_ins.

FWIW, if we enter lj_dispatch_call with a COUNT hook set that cals
lua_yield, I segfault on lua_resume 100% of the time...  With this change
my test environment seems to conquer that scenario correctly.

https://github.com/postwait/LuaJIT/commit/b7dbb256eb2673099bdc2041c6cffdf1cc637468

-- 

Theo Schlossnagle

Other related posts: