lua-users home
lua-l archive

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


> does anyone know what triggers this particular error in luasocket?

Answering my own question: the code in luasocket is using aux buffers,
which may use stack slots, which overwrite (at least in Lua 5.4.3)
optional values when these are not provided (thanks to Ashwin Hirschi
for details).

I submitted a patch
(https://github.com/diegonehab/luasocket/pull/334), which needs to be
reviewed. It also turned out that a similar patch was submitted for
luasec (https://github.com/brunoos/luasec/commit/34252fb10ad4038cf6bf713f4f4d1c21ee948812).
Not sure who can merge one of them into luasocket though.

Paul.



On Sun, Jun 20, 2021 at 4:00 PM Paul K <paul@zerobrane.com> wrote:
>
> It's been reported that luasocket receive() call fails on Lua 5.4.3
> with "bad argument #1 to 'receive' (string expected, got light
> userdata)" (see https://github.com/diegonehab/luasocket/issues/331).
> The earlier versions of Lua don't throw this error.
>
> While the fix is simple (use `receive("*l")` instead of `receive()`),
> does anyone know what triggers this particular error in luasocket?
> Thanks.
>
> Paul.