On 11/26/25 09:06, Ben Greear wrote:
On 11/26/25 09:03, Ben Greear wrote:
On 11/26/25 08:19, John Thacker wrote:
On Wed, Nov 26, 2025 at 10:50 AM John Thacker <johnthacker@xxxxxxxxx <mailto:johnthacker@xxxxxxxxx>> wrote:
Unfortunately, Lua doesn't have a great way to determine the patch level release (LUA_VERSION_NUM only gives the major and minor release numbers) to
determine that you're running precisely 5.4.6 or later, which is where `lua_closethread` is available. Luckily the "deprecation" isn't actually enforced. As
a comment in the code in `epan/wslua/init_wslua.c` notes, the plan is to use an ifdef by the time Lua 5.5 is released (where they may, or may not, actually
deprecate it for real.).
Lua 5.4 has LUA_VERSION_RELEASE_NUM (Lua 5.3 has the release number only separate or as a string) which makes it easier to check. I'm not particularly >
interested in fixing the issue for one broken release of Lua, but if you really have to get it running on that version it's not too hard to patch that file.
This seems to fix the build on F36. Would you want this patch upstream assuming
it works for others?
[greearb@vb-f36-64 wireshark]$ git diff
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c
index e33b2b2ae4..79cdcd1a0d 100644
--- a/epan/wslua/init_wslua.c
+++ b/epan/wslua/init_wslua.c
@@ -283,7 +283,11 @@ static void lua_resetthread_cb(void *user_data) {
// relies on garbage collection only.
// lua_closethread(..., NULL) was introduced in 5.4.6 to replace
// lua_resetthread() but it's not mandatory yet (maybe in 5.5?)
+#if LUA_VERSION_RELEASE_NUM == 50404
+ lua_resetthread(L1, NULL);
+#else
lua_resetthread(L1);
+#endif
#endif
// The thread was pushed onto the global stack when created. Each thread
// should be taken off the stack in order.
Thanks,
Ben
Bleh, Fedora 34 would then break, I'll try again.
--Ben
Ok, too ugly for upstream, but maybe it will help someone else.
Only compile tested at the moment, I hope second arg can just
be NULL.
[greearb@vb-f36-64 wireshark]$ git show
commit df3e59be7f72b233568d53ea8583a109a89c4764 (HEAD -> master, origin/master, origin/HEAD)
Author: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date: Wed Nov 26 09:03:42 2025 -0800
wireshark: Fix lau_resetthread api breakage on Fedora-36.
Lua project has issues with backwards compat, so add special
hack to compile on lua 5.4.4
Signed-off-by: Ben Greear <greearb@xxxxxxxxxxxxxxx>
diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c
index e33b2b2ae4..cbebcf8975 100644
--- a/epan/wslua/init_wslua.c
+++ b/epan/wslua/init_wslua.c
@@ -283,7 +283,15 @@ static void lua_resetthread_cb(void *user_data) {
// relies on garbage collection only.
// lua_closethread(..., NULL) was introduced in 5.4.6 to replace
// lua_resetthread() but it's not mandatory yet (maybe in 5.5?)
+#ifdef LUA_HACK_RESETTHREAD_2ARG
+ // Fedora 34 and F36 have identical lau.h, except for this one API change on F36.
+ // So, you cannot check any versioning info.
+ // To get this to compile on this broken lau, edit lua.h and/or otherwise
+ // define LUA_HACK_RESETTHREAD_2ARG so we call this version.
+ lua_resetthread(L1, NULL);
+#else
lua_resetthread(L1);
+#endif
#endif
// The thread was pushed onto the global stack when created. Each thread
// should be taken off the stack in order.
Thanks,
Ben