lunarmodules / luasocket

Network support for the Lua language
http://lunarmodules.github.io/luasocket/
MIT License
1.86k stars 630 forks source link

bind fails with an error #375

Open Tieske opened 2 years ago

Tieske commented 2 years ago
Tieskes-MBP:copas thijs$ lua -v -e "require('socket').bind('*', 20000)"
LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2020 Mike Pall. https://luajit.org/
lua: ...esty@1.19.3.2/1.19.3.2/luarocks/share/lua/5.1/socket.lua:35: attempt to call field 'tcp4' (a nil value)
stack traceback:
        ...esty@1.19.3.2/1.19.3.2/luarocks/share/lua/5.1/socket.lua:35: in function 'bind'
        (command line):1: in main chunk
        [C]: at 0x081a6fd9
Tieskes-MBP:copas thijs$

This is with LuaSocket 3.0.0.

There seem to be more issues, I will revert Copas to the RC, see https://github.com/lunarmodules/copas/pull/114

Copas CI just hangs, see this run: https://github.com/lunarmodules/copas/actions/runs/2167022261

alerque commented 2 years ago

This appears to be a Lua 5.1/LuaJIT specific problem, I can replicate this on LuaJIT but it works fire on vanilla Lua >= 5.2.

alerque commented 2 years ago

I take back my last comment. My testing environment for 5.1 had other issues. I rebuilt luasocket using the correct Lua 5.1 headers and now it works for me both on vanilla Lua 5.1 and LuaJIT.

alerque commented 2 years ago

I've poked at this a bit more and can't come up with any sort of verification that there is an issue at all. Can you review your test case MWE? I'm not saying there is no problem, but I can't help track it down much if I can't get my hands on something that's failing.