kresd fails on arm64 with "PANIC: unprotected error in call to Lua API (bad light userdata pointer)"
here's what i'm seeing on amdahl, the debian arm64 porterbox, where kresd.conf is an empty file:
0 $ gdb /usr/sbin/kresd
GNU gdb (Debian 8.1-4) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/kresd...Reading symbols from /usr/lib/debug/.build-id/76/a5136c4d835203c93718fa64f4a252b5a8f499.debug...done.
done.
(gdb) break lua_pushlightuserdata
Breakpoint 1 at 0x6f44
(gdb) run -c kresd.conf
Starting program: /usr/sbin/kresd -c kresd.conf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Breakpoint 1, lua_pushlightuserdata (L=0x2dbdd75cd378, p=p@entry=0xfffffffff038) at lj_api.c:699
699 lj_api.c: No such file or directory.
(gdb) bt
#0 lua_pushlightuserdata (L=0x2dbdd75cd378, p=p@entry=0xfffffffff038) at lj_api.c:699
#1 0x0000aaaaaaab594c in init_state (engine=0xfffffffff038) at daemon/engine.c:679
#2 engine_init (engine=0xfffffffff038, pool=0xffffffffef80) at daemon/engine.c:722
#3 0x0000aaaaaaab2348 in main (argc=<optimized out>, argv=<optimized out>) at daemon/main.c:680
(gdb) cont
Continuing.
PANIC: unprotected error in call to Lua API (bad light userdata pointer)
[Inferior 1 (process 4706) exited with code 01]
(gdb)
by contrast, on amd64, i see it continuing after the first invocation with no problem:
$ gdb /usr/sbin/kresd
GNU gdb (Debian 8.1-4) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/sbin/kresd...Reading symbols from /usr/lib/debug/.build-id/19/ab3dcf739a6495245566f5c7692a180a3bfff1.debug...done.
done.
(gdb) break lua_pushlightuserdata
Breakpoint 1 at 0x76f0
(gdb) run -c kresd.conf
Starting program: /usr/sbin/kresd -c kresd.conf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, lua_pushlightuserdata (L=0x40000378, p=0x7fffffffdfd0)
at lj_api.c:699
699 lj_api.c: No such file or directory.
(gdb) bt
#0 lua_pushlightuserdata (L=0x40000378, p=0x7fffffffdfd0) at lj_api.c:699
#1 0x00005555555606b3 in init_state (engine=0x7fffffffdfd0) at daemon/engine.c:679
#2 engine_init (engine=0x7fffffffdfd0, pool=<optimized out>) at daemon/engine.c:722
#3 0x000055555555cc12 in main (argc=<optimized out>, argv=<optimized out>) at daemon/main.c:680
(gdb) cont
Continuing.
Breakpoint 1, lua_pushlightuserdata (L=0x40000378, p=p@entry=0x7ffff59a8010) at lj_api.c:699
699 in lj_api.c
(gdb) cont
see the initial debian report in more detail at:
https://bugs.debian.org/907729
I'll continue to try to debug it as i have time, but i'd also welcome any help sorting this out from upstream.