lua-users home
lua-l archive

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


> Sadly I have no idea what I have missed between Lua versions 5.4.2 and
> 5.4.3+, that makes my C++ code to always fail in "PANIC: unprotected error
> in call to Lua API (attempt to call a nil value)" error and crash the
> application. The only thing I could dig up is this comment (
> http://lua-users.org/lists/lua-l/2021-03/msg00042.html ). I could find
> similar case in this issue ( https://github.com/hexchat/hexchat/issues/2558
> ), but I don't really understand what the actual problem is.

The change discussed in msg00042 was reversed before 5.4.3 final, so
that should be a non-issue. The discussion in hexchat doesn't seem to
be about standard Lua. (They found a bug in function 'patch_clibs',
which does not exist in the standard distribution.)


> Please suggest me what is wrong with this code, because I'm really not able
> to find the issue myself. Google doesn't produce many results on this
> issue, I guess because this is too recent issue.

1. Can you try bil til's suggestion? "set a breakpoint in the lua panic
function and look at your call stack"

2. You could compile Lua with the option LUA_USE_APICHECK and see if
semething pops up.

-- Roberto