[Pdns-users] PowerDNS-recursor 4.0.4 exiting on signal 11 while using dq:addAnswer LUA code on FreeBSD 10.3

Marc van Houtum marc at dutchsecurity.net
Fri Jan 20 07:28:09 UTC 2017


Hello,

I've installed PowerDNS-recursor 4.0.4 on a new FreeBSD 10.3 server. I 
want to use a LUA script and the preresolve function to have the server 
answer with a different IP address for a record than is configured in 
it's zone. The LUA code is:

 > function preresolve(dq)
 > if(dq.qname:equal("support.customer.com"))
 >     then
 >         pdnslog("Got query for "..dq.qname:toString(), 
pdns.loglevels.All)
 >         dq:addAnswer(pdns.A, "10.20.30.40")
 >         return true;
 >     end
 >     return false;
 > end


However, while querying support.customer.com the following behavior is 
displayed:

 > Jan 20 07:36:21 dns1 pdns_recursor[12428]: 1 [2/1] question for 
'support.customer.com|A' from 127.0.0.1
 > Jan 20 07:36:21 dns1 pdns_recursor[12428]: Got query for 
support.customer.com.
 > Jan 20 07:36:21 dns1 kernel: pid 12428 (pdns_recursor), uid 120: 
exited on signal 11


I've debugged the code and it seems that the 'dq:addAnswer' line is 
causing it to crash, commenting out the line logs the query using the 
pdnslog function, and the recursor sends an empty answer as expected. 
Other queries are also working just fine. The daemon is compiled using 
Poudriere and clang 3.4.1.

I've been unable to generate a core file so I've attached GDB to the 
running process, but it didn't seem to provide much useful information, 
see attached file PowerDNS-recursor GDB.txt.

Is this a bug in PowerDNS-recursor?

Best regards,
Marc van Houtum
-------------- next part --------------
root at dns1:~ # gdb /usr/local/sbin/pdns_recursor 12622
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"...(no debugging symbols found)...
Attaching to program: /usr/local/sbin/pdns_recursor, process 12622
Reading symbols from /lib/libcrypto.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypto.so.7
Reading symbols from /usr/local/lib/libboost_context.so.1.63.0...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libboost_context.so.1.63.0
Reading symbols from /usr/local/lib/liblua-5.2.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/liblua-5.2.so
Reading symbols from /lib/libm.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/local/lib/libboost_thread.so.1.63.0...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libboost_thread.so.1.63.0
Reading symbols from /usr/local/lib/libboost_system.so.1.63.0...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libboost_system.so.1.63.0
Reading symbols from /usr/lib/libc++.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libc++.so.1
Reading symbols from /lib/libcxxrt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libcxxrt.so.1
Reading symbols from /lib/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/libthr.so.3...(no debugging symbols found)...done.
[New Thread 803007800 (LWP 100373/pdns_recursor)]
[New Thread 803007400 (LWP 100372/pdns_recursor)]
[New Thread 803007000 (LWP 100371/pdns_recursor)]
[New Thread 803006400 (LWP 100091/pdns_recursor)]
Loaded symbols for /lib/libthr.so.3
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/lib/libboost_chrono.so.1.63.0...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libboost_chrono.so.1.63.0
Reading symbols from /usr/lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done.
Loaded symbols for /libexec/ld-elf.so.1
[Switching to Thread 803007800 (LWP 100373/pdns_recursor)]
0x00000008024d302a in _kevent () from /lib/libc.so.7
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00000008024ef40b in strlen () from /lib/libc.so.7
(gdb) bt
#0  0x00000008024ef40b in strlen () from /lib/libc.so.7
#1  0x00000000004be728 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#2  0x00000000004be59e in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#3  0x00000000004be3bc in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#4  0x00000000004be344 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#5  0x0000000801231c45 in lua_getinfo () from /usr/local/lib/liblua-5.2.so
#6  0x000000080123f4bb in lua_close () from /usr/local/lib/liblua-5.2.so
#7  0x00000008012321e2 in lua_getinfo () from /usr/local/lib/liblua-5.2.so
#8  0x00000008012316f3 in lua_getinfo () from /usr/local/lib/liblua-5.2.so
#9  0x00000008012326a8 in lua_yieldk () from /usr/local/lib/liblua-5.2.so
#10 0x000000080122d4c1 in lua_pcallk () from /usr/local/lib/liblua-5.2.so
#11 0x000000000049a4f8 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#12 0x000000000049a25b in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#13 0x000000000049a0b0 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#14 0x0000000000474262 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#15 0x0000000000475034 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#16 0x0000000000528d3f in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#17 0x000000000054f479 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append<char*> ()
#18 0x000000000051bce1 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
#19 0x000000080101f2bf in make_fcontext () from /usr/local/lib/libboost_context.so.1.63.0
#20 0x0000000000000000 in ?? ()
(gdb) thread apply all bt full

Thread 4 (Thread 803006400 (LWP 100091/pdns_recursor)):
#0  0x000000080219c13c in pthread_cleanup_pop () from /lib/libthr.so.3
No symbol table info available.
#1  0x0000000000539a0e in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#2  0x000000000054149e in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#3  0x000000000040d32f in ?? ()
No symbol table info available.
#4  0x0000000800a28000 in ?? ()
No symbol table info available.
#5  0x0000000000000000 in ?? ()
No symbol table info available.

Thread 3 (Thread 803007000 (LWP 100371/pdns_recursor)):
#0  0x00000008024d302a in _kevent () from /lib/libc.so.7
No symbol table info available.
#1  0x0000000802193302 in pthread_suspend_all_np () from /lib/libthr.so.3
No symbol table info available.
#2  0x00000000005ef611 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::insert<char const*> ()
No symbol table info available.
#3  0x000000000053b56f in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#4  0x0000000802190855 in pthread_create () from /lib/libthr.so.3
No symbol table info available.
#5  0x0000000000000000 in ?? ()
No symbol table info available.

Thread 2 (Thread 803007400 (LWP 100372/pdns_recursor)):
#0  0x00000008024d302a in _kevent () from /lib/libc.so.7
No symbol table info available.
#1  0x0000000802193302 in pthread_suspend_all_np () from /lib/libthr.so.3
No symbol table info available.
#2  0x00000000005ef611 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::insert<char const*> ()
No symbol table info available.
#3  0x000000000053b56f in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#4  0x0000000802190855 in pthread_create () from /lib/libthr.so.3
No symbol table info available.
#5  0x0000000000000000 in ?? ()
No symbol table info available.

Thread 1 (Thread 803007800 (LWP 100373/pdns_recursor)):
#0  0x00000008024ef40b in strlen () from /lib/libc.so.7
No symbol table info available.
#1  0x00000000004be728 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#2  0x00000000004be59e in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#3  0x00000000004be3bc in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#4  0x00000000004be344 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#5  0x0000000801231c45 in lua_getinfo () from /usr/local/lib/liblua-5.2.so
No symbol table info available.
#6  0x000000080123f4bb in lua_close () from /usr/local/lib/liblua-5.2.so
No symbol table info available.
#7  0x00000008012321e2 in lua_getinfo () from /usr/local/lib/liblua-5.2.so
No symbol table info available.
#8  0x00000008012316f3 in lua_getinfo () from /usr/local/lib/liblua-5.2.so
No symbol table info available.
#9  0x00000008012326a8 in lua_yieldk () from /usr/local/lib/liblua-5.2.so
No symbol table info available.
#10 0x000000080122d4c1 in lua_pcallk () from /usr/local/lib/liblua-5.2.so
No symbol table info available.
#11 0x000000000049a4f8 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#12 0x000000000049a25b in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#13 0x000000000049a0b0 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#14 0x0000000000474262 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#15 0x0000000000475034 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#16 0x0000000000528d3f in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#17 0x000000000054f479 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append<char*> ()
No symbol table info available.
#18 0x000000000051bce1 in std::__1::__tree_remove<std::__1::__tree_node_base<void*>*> ()
No symbol table info available.
#19 0x000000080101f2bf in make_fcontext () from /usr/local/lib/libboost_context.so.1.63.0
No symbol table info available.
#20 0x0000000000000000 in ?? ()
No symbol table info available.
(gdb)


More information about the Pdns-users mailing list