-
Notifications
You must be signed in to change notification settings - Fork 532
core dumped on Arch Linux with lua #2558
Comments
Note that Lua 5.4.3 is a part of Arch' testing repository. And it is where you see the issue. The stable Arch repo still uses lua 5.4.2. |
Indeed, it seems with lua 5.4.2 everything works fine, with lua 5.4.3 it's crashing. |
Btw does hexchat recompilation for the new lua help? |
No, I've tried that and it didn't help. Also just downgrading lua on my machine makes it work so I suspect a bug in lua then. |
I've tried bisecting that, but failed miserably, rebuilding |
Here is the dump info produced with non-stripped lua library:
|
My lua bisecting points to this lua commit as the root of the crash lua/lua@511d53a |
One thing that happened in this commit is that lua started enforcing 5.4.0 compat mode and following compatibility behavior has been dropped. I wonder if it is something that needs to be adjusted at hexchat side.
cc @culb who might have some ideas what how this change affects hexchat plugin. |
@invidian Lua makefile does not provide a way to build *.so (used at Arch) so for bisecting I had to build *.so manually. Here is a way how I ran my bisecting:
Here is my bisect log
|
Cross-posting https://bugs.archlinux.org/task/70213 reply to @invidian I would not call it "lua regression". From my findings above Lua 5.4.3 has dropped lua 5.3 compatibility behavior. And Lua developer(s) are known for their aggressive language evolution without focusing too much on the backward compatibility. So if it is confirmed that the reason for this crash is broken compatibility then there are 2 choices:
It might be worth checking with Lua upstream about this change to check how users expect to deal with this compatibility breakage. |
It seems following patch make it work for both lua 5.4.2 and 5.4.3: diff --git plugins/lua/lua.c plugins/lua/lua.c
index d73fbb23..681576cd 100644
--- plugins/lua/lua.c
+++ plugins/lua/lua.c
@@ -1193,7 +1193,6 @@ static void patch_clibs(lua_State *L)
}
lua_pop(L, 1);
}
- lua_pop(L, 1);
}
static GPtrArray *scripts; I was not able to trigger |
Indeed there seem to be too many pops. This should be the correct implementation: static void patch_clibs(lua_State *L)
{
lua_pushnil(L); /* push nil key to start iteration */
while(lua_next(L, LUA_REGISTRYINDEX)) /* pop key. push key and value if ret != 0 */
{
if(lua_type(L, -2) == LUA_TLIGHTUSERDATA && lua_type(L, -1) == LUA_TTABLE)
{
lua_setfield(L, LUA_REGISTRYINDEX, "_CLIBS"); /* pop value */
lua_pop(L, 1); /* pop key */
break;
}
lua_pop(L, 1); /* pop value */
}
} |
Closes hexchat#2558 Co-authored-by: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
Created #2559, as far as I understand, it's a bug exposed by latest version of Lua, which should be fixed. |
@anatol interesting. My bisecting pointed at lua/lua@81c6021 and it seems reverting either this commit or lua/lua@511d53a you pointed fixes the issue. |
Closes #2558 Co-authored-by: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
On latest version of Arch Linux, with
lua
package installed, hexchat does not start but crashes with the following error:Backtrace:
Lua version:
Hexchat version:
What's interesting, testing it in Docker seems to work:
The text was updated successfully, but these errors were encountered: