On Fri 2018-08-31 19:53:42 -0400, Daniel Kahn Gillmor wrote:
> On the arm64 build daemons, kresd fails with the error:
>
>      PANIC: unprotected error in call to Lua API (bad light userdata pointer)
>
> https://buildd.debian.org/status/fetch.php?pkg=knot-resolver&arch=arm64&ver=3.0.0-4&stamp=1535740254&raw=0
>
> This happens despite all the official upstream test suites passing.
>
> This same failure causes the test suite for hddemux 0.4-5 to fail on
> this platform, which is why i'm marking this bug as affecting hddemux.
>
> The error message seems to be derived from LJ_ERR_BADLU, which i think
> is raised by the checklightudptr within luajit, from either
> lua_pushlightuserdata() or lua_cpcall() [0].  i have not tracked down
> the specific instance yet (i'm not on an arm64 machine at the moment).
> But as the knot-resolver codebase never invokes lua_cpcall(), i suspect it
> is lua_pushlightuserdata() that is causing the crash.

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


perhaps someone who knows lua better than me can make an even simpler
reproducer?

        --dkg

Reply via email to