Skip to content

Conversation

@phanen
Copy link

@phanen phanen commented Jun 30, 2025

uv.write accept string table but don't accept empty table.

local uv = require('luv')
uv.write(uv.new_pipe(false), {})

(assert: https://github.com/libuv/libuv/blob/3a9a6e3e6bc78565ddf94cf462c9877c1004bb62/src/unix/stream.c#L1298)

Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/usr/bin/luajit a.lua'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007f48e41f3813 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89
#2  0x00007f48e4199dc0 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007f48e418157a in __GI_abort () at abort.c:73
#4  0x00007f48e41814e3 in __assert_fail_base (fmt=<optimized out>, assertion=0x7f48e4020969 "nbufs > 0", file=<optimized out>, line=<optimized out>,
    function=<optimized out>) at assert.c:118
#5  0x00007f48e3fe6273 in uv_write2[cold] () from /home/phan/.luarocks/lib/lua/5.1/luv.so
#6  0x00007f48e3ffcbe8 in luv_write () from /home/phan/.luarocks/lib/lua/5.1/luv.so
#7  0x00007f48e4352f06 in lj_BC_FUNCC () at buildvm_x86.dasc:857
#8  0x00007f48e4369a90 in lua_pcall (L=L@entry=0x7f48e43ea380, nargs=nargs@entry=0, nresults=nresults@entry=-1, errfunc=errfunc@entry=2)
    at /usr/src/debug/luajit/LuaJIT-f9140a622a0c44a99efb391cc1c2358bc8098ab7/src/lj_api.c:1122
#9  0x000055890091e504 in docall (L=L@entry=0x7f48e43ea380, narg=narg@entry=0, clear=clear@entry=0)
    at /usr/src/debug/luajit/LuaJIT-f9140a622a0c44a99efb391cc1c2358bc8098ab7/src/luajit.c:137
#10 0x000055890091f656 in handle_script (L=0x7f48e43ea380, argx=<optimized out>)
    at /usr/src/debug/luajit/LuaJIT-f9140a622a0c44a99efb391cc1c2358bc8098ab7/src/luajit.c:307
#11 pmain (L=0x7f48e43ea380) at /usr/src/debug/luajit/LuaJIT-f9140a622a0c44a99efb391cc1c2358bc8098ab7/src/luajit.c:565
#12 0x00007f48e4352f06 in lj_BC_FUNCC () at buildvm_x86.dasc:857
#13 0x00007f48e4369af3 in lua_cpcall (L=L@entry=0x7f48e43ea380, func=func@entry=0x55890091ee00 <pmain>, ud=ud@entry=0x0)
    at /usr/src/debug/luajit/LuaJIT-f9140a622a0c44a99efb391cc1c2358bc8098ab7/src/lj_api.c:1179
#14 0x000055890091e079 in main (argc=2, argv=0x7ffeb2f70308) at /usr/src/debug/luajit/LuaJIT-f9140a622a0c44a99efb391cc1c2358bc8098ab7/src/luajit.c:596

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant