lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi Roberto,
Could you please confirm that the Lua 5.2.0 work 3 includes the fix to this GC-in-another-thread-while-jump issue? I can see that the mechanics of the dojump have changed (i.e. using savedpc, and not calling threadyield).

On 02/12/2009 19:08, Roberto Ierusalimschy wrote:
Consequently, I have changed the "dojump" macro in lvm.c to now be:

    #define dojump(L,pc,i) { (pc) += (i); luai_threadyield(); *base =
L->base; *}

/Now, I know that some "dojump" calls are also wrapped inside "Protect"
and therefore the "base = L->base" is going to be duplicated in those
cases. Of course, my optimising compiler removes the redundancy./

Guess what - the problem has gone away and Lua is not failing its
assertions anymore (and my Lua code isn't running off the rails)!!


Any thoughts or comments??
One possible culprit is the resize of stacks in the garbage collector.
In one phase of the garbage gollection, the collector may shrink
some stacks if they seem too big. So, I guess it may happen that the
collector running in one thread shrinks the stack of another thread.
(Of course that never crossed my mind until now..)

-- Roberto