lua-lluv icon indicating copy to clipboard operation
lua-lluv copied to clipboard

bad argument #1 to 'start' (number expected, got nil)

Open stuart-little opened this issue 4 years ago • 2 comments

I am literally copy-pasting the signals example, and running it produces

lua: ./toy.lua:7: bad argument #1 to 'start' (number expected, got nil)                                   
stack traceback:                                             
[C]: in method 'start'                               
./toy.lua:7: in main chunk                           
[C]: in ?

This is on Lua 5.3.3, Linux x86_64.

stuart-little avatar Jul 15 '21 22:07 stuart-little

Aha! I checked that this was because on this system lluv does not see SIGBREAK. In a Lua repl:

Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
> require("luarocks.loader")                         
table: 0x55bb66bcfc20
> uv=require "lluv"
> uv
table: 0x55bb66c2c7a0
> uv.SIGINT
2
> uv.SIGBREAK
nil
> uv.SIGHUP
1
> uv.SIGWINCH
28

stuart-little avatar Jul 15 '21 23:07 stuart-little

All those constnat is a compile time. So it depeends on header files only

moteus avatar Jul 17 '21 09:07 moteus