You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On creating my initial config for dnsdist I copy/pasted a snippet from https://doc.powerdns.com/authoritative/guides/recursion.html. Unfortunately the syntax for the newServer lines is missing 'address=', which causes an error (Fatal Lua error: invalid key to 'next') when compiled against Lua (tested with 5.2 and 5.3), but causes a segfault with LuaJIT.
Environment
Operating system: FreeBSD 11.1-RELEASE-p5
Software version: 1.2.0
Software source: port + local changes to build/link against luajit
Steps to reproduce
Build and install dnsdist linked against luajit
Use a config that contains an error like described above
Start dnsdist
Expected behaviour
I would expect the same error to show as when compiled against Lua
Actual behaviour
[(Fri Dec 01 16:00) root@lan /tmp]# gdb --args dnsdist -C dnsdist.conf
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) go
Undefined command: "go". Try "help".
(gdb) run
Starting program: /tmp/dnsdist -C dnsdist.conf
Program received signal SIGSEGV, Segmentation fault.
check_action_record (context=0x7fffffffdaa8, lsda=0x7fffffffd7a0, action_record=0x72f2c3 "", ex=<value optimized out>, selector=0x7fffffffd7d8, adjustedPtr=@0x80302d158)
at /usr/src/contrib/libcxxrt/exception.cc:935
935 bool is_ptr = ex ? ex_type->__is_pointer_p() : false;
(gdb) bt
#0 check_action_record (context=0x7fffffffdaa8, lsda=0x7fffffffd7a0, action_record=0x72f2c3 "", ex=<value optimized out>, selector=0x7fffffffd7d8, adjustedPtr=@0x80302d158)
at /usr/src/contrib/libcxxrt/exception.cc:935
#1 0x00000008021b8fdc in __gxx_personality_v0 (version=<value optimized out>, actions=<value optimized out>, exceptionClass=<value optimized out>, exceptionObject=<value optimized out>, context=0x7fffffffdaa8)
at /usr/src/contrib/libcxxrt/exception.cc:1144
#2 0x00000008025f1d47 in _Unwind_RaiseException (exc=0x80302d160) at unwind.inc:117
#3 0x00000008021b89ef in __cxa_rethrow_primary_exception (thrown_exception=<value optimized out>) at /usr/src/contrib/libcxxrt/exception.cc:774
#4 0x0000000801f2c99c in std::rethrow_exception (p=<value optimized out>) at /usr/src/contrib/libc++/src/exception.cpp:318
#5 0x000000000043d0e4 in LuaContext::callRaw (state=0x1378, functionAndArguments=<value optimized out>, outArguments=0) at LuaContext.hpp:1360
#6 0x000000000051f871 in _ZN10LuaContext4callINSt3__15tupleIJEEEJEEET_P9lua_StateNS_12PushedObjectEDpOT0_ (state=0x1378, toCall=<value optimized out>) at LuaContext.hpp:1328
#7 0x000000000051e44a in LuaContext::executeCode (this=0x9bbac8, code=<value optimized out>) at LuaContext.hpp:232
#8 0x0000000000479cb3 in setupLua (client=Unhandled dwarf expression opcode 0x9d
) at dnsdist-lua.cc:1815
#9 0x0000000000423913 in main (argc=<value optimized out>, argv=<value optimized out>) at dnsdist.cc:1936
Other information
Usecase
Description
The text was updated successfully, but these errors were encountered:
I've tested some more and luajit seems to be the badboy here, since
compiling dnsdist with LLVM 5.0 didn't help and still makes it crash (I found a PR about LLVM doing incorrect unwinds causing luajit to segfault, but the example to reproduce doesn't crash, so that wasn't the culprit).
Also, compiling against Lua 5.1, 5.2 and 5.3 all work fine.
Also noticed dnsdist+luajit crashes when using the console to add an incorrect newServer line. When compiled against Lua (5.1+) it displays a nice error (Error: Parsing function parameters, did you forget parameter name?>).
So it seems LuaWrapper + LuaJIT is unable to process exceptions very well, which might also cause trouble for auth and rec, but I haven't ran into that yet nor received any reports from users.
Closing this since it doesn't seem to crash anymore. We also refactored our exception handling since the last update so it might be fix in recent versions, I will re-open if a new report comes in.
Short description
On creating my initial config for dnsdist I copy/pasted a snippet from https://doc.powerdns.com/authoritative/guides/recursion.html. Unfortunately the syntax for the newServer lines is missing 'address=', which causes an error (
Fatal Lua error: invalid key to 'next'
) when compiled against Lua (tested with 5.2 and 5.3), but causes a segfault with LuaJIT.Environment
Steps to reproduce
Expected behaviour
I would expect the same error to show as when compiled against Lua
Actual behaviour
Other information
Usecase
Description
The text was updated successfully, but these errors were encountered: