lua-users home
lua-l archive

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


Hi all,

I find there is an invocation to lua_unlock() after luaG_errormsg(), which will never return because it calls longjmp(). So the lua_unlock() is deadcode, and it seems an unbalanced lock/unlock bug.

I Googled and found two previous mail threads talking about this problem. The two threads are both closed, but I think their conclusions are not satisfactory to me.

One says, when a long-jump happens because of the luaG_errormsg(), the control is still within Lua and there must be another lua_unlock() waiting for. But, I think that lua_unlock() is paired with another lua_lock(), so the lua_lock() immediately before the long-jump is still unpaired.

Another says it found the missing lua_unlock() in luaD_throw(). But I think the only lua_unlock() within luaD_throw() is in a branch which is hit only when there is no protected call at all.

So what's the status of this problem? Still a bug, no harm only because lua_unlock() happen to be no-op on most build?

Thanks,
Dong