Package: luajit
Version: 2.1.0+openresty20251030-1
Severity: important
X-Debbugs-Cc: [email protected], [email protected]
User: [email protected]
Usertags: riscv64

Dear maintainer,

while debugging a autopkgtest regression in python-mpv after switching
mpv to luajit, I tried to run some commands with luajit directly to
identify the issue. At some point I came across a comment on Github

https://github.com/LuaJIT/LuaJIT/pull/1267#issuecomment-2495376529

And indeed, luajit -e 'print(pcall(pcall))' on riscv64 causes a
SIGSEGV. On amd64 it produces:

$ luajit -e 'print(pcall(pcall))'
false   bad argument #1 to '?' (value expected)

>From gdb on ricci.d.o/riscv64:

Starting program: /usr/bin/luajit -e print\(pcall\(pcall\)\)
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/riscv64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
lj_err_callermsg (L=L@entry=0x3ff7d88380, msg=0x3ff7d8a7b8 "bad argument #1 to 
'?' (value expected)") at ./src/lj_err.c:1022
warning: 1022   ./src/lj_err.c: No such file or directory
(gdb) bt
#0  lj_err_callermsg (L=L@entry=0x3ff7d88380, msg=0x3ff7d8a7b8 "bad argument #1 
to '?' (value expected)") at ./src/lj_err.c:1022
#1  0x0000002aaaadf7ae in err_argmsg (L=0x3ff7d88380, narg=<optimized out>, 
narg@entry=1, msg=<optimized out>) at ./src/lj_err.c:1074
#2  0x0000002aaaadf7e0 in lj_err_arg (L=<optimized out>, narg=narg@entry=1, 
em=em@entry=LJ_ERR_NOVAL) at ./src/lj_err.c:1091
#3  0x0000002aaaae04a8 in lj_lib_checkany (L=<optimized out>, narg=1) at 
./src/lj_lib.c:192
#4  lj_ffh_pcall (L=<optimized out>) at ./src/lib_base.c:357
#5  0x0000002aaab0c154 in lj_fff_fallback () at ./src/buildvm_riscv.dasc:2931
#6  0x0000002aaaafd304 in lua_pcall (L=L@entry=0x3ff7d88380, 
nargs=nargs@entry=0, nresults=nresults@entry=0, errfunc=errfunc@entry=2) at 
./src/lj_api.c:1151
#7  0x0000002aaaab24b0 in docall (L=L@entry=0x3ff7d88380, narg=narg@entry=0, 
clear=clear@entry=1) at ./src/luajit.c:137
#8  0x0000002aaaab2742 in dostring (L=L@entry=0x3ff7d88380, s=0x3ffffffe33 
"print(pcall(pcall))", name=name@entry=0x2aaab0cfb0 "=(command line)")
    at ./src/luajit.c:191
#9  0x0000002aaaab2c96 in runargs (L=<optimized out>, argv=<optimized out>, 
argn=<optimized out>) at ./src/luajit.c:473
#10 pmain (L=0x3ff7d88380) at ./src/luajit.c:560
#11 0x0000002aaab0a05c in lj_BC_FUNCC () at ./src/buildvm_riscv.dasc:1279
#12 0x0000002aaaafd428 in lua_cpcall (L=L@entry=0x3ff7d88380, 
func=func@entry=0x2aaaab2906 <pmain>, ud=ud@entry=0x0) at ./src/lj_api.c:1179
#13 0x0000002aaaab1fe6 in main (argc=3, argv=0x3ffffffb78) at ./src/luajit.c:595

I am not sure if this is anyway related to the issue I was debugging in
mpv, but I think it would be good to have it fixed anway.

Cheers

(data below is from reporting reportbug on my amd64 machine, so s not
reall helpful)

-- System Information:
Debian Release: forky/sid
  APT prefers unstable-debug
  APT policy: (650, 'unstable-debug'), (650, 'unstable'), (601, 'testing'), 
(600, 'experimental-debug'), (600, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.17.13+deb14-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages luajit depends on:
ii  libc6                 2.43-7
ii  libgcc-s1             16.2.0-4
ii  libluajit-5.1-2       2.1.0+openresty20251030-1+b2
ii  libluajit-5.1-common  2.1.0+openresty20251030-1

luajit recommends no packages.

luajit suggests no packages.

-- 
Sebastian Ramacher

Reply via email to