Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1050600: pdns_control: list-zones appears to require a type filter, returns empty without

42 views
Skip to first unread message

наб

unread,
Aug 26, 2023, 5:32:07 PM8/26/23
to
Package: pdns-server
Version: 4.7.1-1
Severity: normal
File: /usr/bin/pdns_control

Dear Maintainer,

pdns_control(1):
list-zones [primary,secondary,native]
Show a list of zones, optionally filter on the type of zones to show.
but
# pdns_control list-zones slave
All zonecount:0
# pdns_control list-zones master
All zonecount:0
# pdns_control list-zones native
ws.co.ls.
All zonecount:1
# pdns_control list-zones


Clearly this is wrong.

Best,
наб

-- System Information:
Debian Release: trixie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: amd64, i386

Kernel: Linux 6.3.0-2-amd64 (SMP w/2 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages pdns-server depends on:
ii adduser 3.137
ii libboost-program-options1.74.0 1.74.0+ds1-22
ii libc6 2.37-6
ii libcurl4 7.86.0-2
ii libgcc-s1 13.1.0-8
ii liblua5.3-0 5.3.6-2
ii libp11-kit0 0.25.0-3
ii libsodium23 1.0.18-1
ii libsqlite3-0 3.42.0-1
ii libssl3 3.0.10-1
ii libstdc++6 13.1.0-8
ii libsystemd0 254~rc3-3

Versions of packages pdns-server recommends:
ii pdns-backend-bind 4.7.1-1

Versions of packages pdns-server suggests:
ii pdns-backend-bind [pdns-backend] 4.7.1-1

-- Configuration Files:
/etc/powerdns/pdns.conf [Errno 13] Permission denied: '/etc/powerdns/pdns.conf'

-- no debconf information
signature.asc

наб

unread,
Aug 26, 2023, 5:40:04 PM8/26/23
to
Control: retitle -1 pdns-server: pdns_control list-zones (no filters) segfaults pdns?

An unrelated run with journalctl -f& revealed:
-- >8 --
nabijaczleweli@szarotka:/etc/powerdns$ sudo pdns_control list-zones

nabijaczleweli@szarotka:/etc/powerdns$ Aug 26 23:17:13 szarotka sudo[17695]: nabijaczleweli : TTY=pts/2 ; PWD=/etc/powerdns ; USER=root ; COMMAND=/bin/pdns_control list-zones
Aug 26 23:17:13 szarotka sudo[17695]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Aug 26 23:17:13 szarotka pdns_server[17668]: Got a signal 11, attempting to print trace:
Aug 26 23:17:13 szarotka pdns_server[17668]: /usr/sbin/pdns_server(+0x14d282) [0x56776282]
Aug 26 23:17:13 szarotka pdns_server[17668]: /lib/x86_64-linux-gnux32/libc.so.6(+0x35160) [0xf705f160]
Aug 26 23:17:13 szarotka pdns_server[17668]: /lib/x86_64-linux-gnux32/libc.so.6(+0x166d40) [0xf7190d40]
Aug 26 23:17:13 szarotka pdns_server[17668]: /lib/x86_64-linux-gnux32/libstdc++.so.6(_ZNSt15basic_streambufIcSt11char_traitsIcEE6xsputnEPKci+0x4f) [0xf732387f]
Aug 26 23:17:13 szarotka pdns_server[17668]: /lib/x86_64-linux-gnux32/libstdc++.so.6(_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i+0x16f) [0xf731648f]
Aug 26 23:17:13 szarotka pdns_server[17668]: /usr/sbin/pdns_server(_Z11DLListZonesRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEi+0x5aa) [0x5682c38a]
Aug 26 23:17:13 szarotka pdns_server[17668]: /usr/sbin/pdns_server(_ZN11DynListener11theListenerEv+0x41a) [0x5683536a]
Aug 26 23:17:13 szarotka pdns_server[17668]: /lib/x86_64-linux-gnux32/libstdc++.so.6(+0xbe2b5) [0xf72be2b5]
Aug 26 23:17:13 szarotka pdns_server[17668]: /lib/x86_64-linux-gnux32/libc.so.6(+0x8215b) [0xf70ac15b]
Aug 26 23:17:13 szarotka pdns_server[17668]: /lib/x86_64-linux-gnux32/libc.so.6(__clone+0x40) [0xf712be10]
Aug 26 23:17:14 szarotka sudo[17695]: pam_unix(sudo:session): session closed for user root
Aug 26 23:17:14 szarotka systemd[1]: pdns.service: Main process exited, code=killed, status=6/ABRT
Aug 26 23:17:14 szarotka systemd[1]: pdns.service: Failed with result 'signal'.
Aug 26 23:17:15 szarotka systemd[1]: pdns.service: Scheduled restart job, restart counter is at 5.
Aug 26 23:17:15 szarotka systemd[1]: Starting pdns.service - PowerDNS Authoritative Server...
Aug 26 23:17:15 szarotka pdns_server[17707]: Loading '/usr/lib/x86_64-linux-gnux32/pdns/libbindbackend.so'
Aug 26 23:17:15 szarotka pdns_server[17707]: This is a standalone pdns
Aug 26 23:17:15 szarotka pdns_server[17707]: Listening on controlsocket in '/run/pdns/pdns.controlsocket'
Aug 26 23:17:15 szarotka pdns_server[17707]: UDP server bound to 0.0.0.0:53
Aug 26 23:17:15 szarotka pdns_server[17707]: TCP server bound to 0.0.0.0:53
Aug 26 23:17:15 szarotka pdns_server[17707]: PowerDNS Authoritative Server 4.7.1 (C) 2001-2022 PowerDNS.COM BV
Aug 26 23:17:15 szarotka pdns_server[17707]: Using 32-bits mode. Built using gcc 12.2.0.
Aug 26 23:17:15 szarotka pdns_server[17707]: PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2.
Aug 26 23:17:15 szarotka pdns_server[17707]: [bindbackend] Parsing 1 domain(s), will report when done
Aug 26 23:17:15 szarotka pdns_server[17707]: [bindbackend] Done parsing domains, 0 rejected, 1 new, 0 removed
Aug 26 23:17:15 szarotka pdns_server[17707]: Creating backend connection for TCP
Aug 26 23:17:15 szarotka pdns_server[17707]: Only asked for 1 backend thread - operating unthreaded
Aug 26 23:17:15 szarotka systemd[1]: Started pdns.service - PowerDNS Authoritative Server.
-- >8 --

Installed -dbgsyms, attached debugger, got
-- >8 --
Thread 2 "pdns/ctrlListen" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xf5ddc900 (LWP 20241)]
__memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memmove-ssse3.S:90
90 ../sysdeps/x86_64/multiarch/memmove-ssse3.S: No such file or directory.
(gdb) bt
#0 __memcpy_ssse3 () at ../sysdeps/x86_64/multiarch/memmove-ssse3.S:90
#1 0xf732387f in std::char_traits<char>::copy (__n=5, __s2=0x0, __s1=<optimized out>)
at /build/gcc-13-wGgrWt/gcc-13-13.2.0/build/x86_64-linux-gnux32/libstdc++-v3/include/bits/char_traits.h:445
#2 std::basic_streambuf<char, std::char_traits<char> >::xsputn (this=0xf5ddba04, __s=0x0, __n=37)
at /build/gcc-13-wGgrWt/gcc-13-13.2.0/build/x86_64-linux-gnux32/libstdc++-v3/include/bits/streambuf.tcc:90
#3 0xf731648f in std::basic_streambuf<char, std::char_traits<char> >::sputn (__n=37, __s=0x0, this=<optimized out>)
at /build/gcc-13-wGgrWt/gcc-13-13.2.0/build/x86_64-linux-gnux32/libstdc++-v3/include/streambuf:457
#4 std::__ostream_write<char, std::char_traits<char> > (__n=37, __s=0x0, __out=...)
at /build/gcc-13-wGgrWt/gcc-13-13.2.0/build/x86_64-linux-gnux32/libstdc++-v3/include/bits/ostream_insert.h:53
#5 std::__ostream_insert<char, std::char_traits<char> > (__out=..., __s=0x0, __n=37)
at /build/gcc-13-wGgrWt/gcc-13-13.2.0/build/x86_64-linux-gnux32/libstdc++-v3/include/bits/ostream_insert.h:104
#6 0x5676538a in std::operator<< <char, std::char_traits<char>, std::allocator<char> > (__str=..., __os=...)
at /usr/include/c++/12/bits/basic_string.h:233
#7 DLListZones (parts=..., ppid=<optimized out>) at ./pdns/dynhandler.cc:403
#8 0x5676e36a in DynListener::theListener (this=<optimized out>) at ./pdns/dynlistener.cc:347
#9 0xf72be2b5 in std::execute_native_thread_routine (__p=0x58326a10)
at ../../../../../src/libstdc++-v3/src/c++11/thread.cc:104
#10 0xf70ac15b in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:444
#11 0xf712be10 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
-- >8 --

Clearly {ostream} << (char*)nullptr I think? Or << string_view{nullptr, 37}?
Looks like something to that effect.
signature.asc

наб

unread,
Aug 26, 2023, 6:00:05 PM8/26/23
to
GDB says
│ 402 if (kind == DomainInfo::All) { │
│ > 403 ret<<parts[1]<<" zonecount:"<<count; │
│ 404 } │
│ 405 else { │
│ 406 ret<<"All zonecount:"<<count; │
│ 407 } │


But the function starts with
│ 378 string DLListZones(const vector<string>&parts, Utility::pid_t ppid) │
│ 379 { │
│ 380 UeberBackend B; │
│ 381 g_log<<Logger::Notice<<"Received request to list zones."<<endl; │
...
│ 386 if (parts.size() > 1) { │
│ 387 kind = DomainInfo::stringToKind(parts[1]); │
│ 388 } │
│ 389 else { │
│ 390 kind = DomainInfo::All; │
│ 391 } │

So... (kind == DomainInfo::All) <=> (parts.size() == 0)
but it'sreading parts[1]?

Reeks of a lua momento :v

Best,
signature.asc

Peter van Dijk

unread,
Aug 26, 2023, 6:40:05 PM8/26/23
to
This was fixed upstream in https://github.com/PowerDNS/pdns/pull/12181
which is part of version 4.7.3

наб

unread,
Aug 26, 2023, 6:50:04 PM8/26/23
to
Control: tags -1 + patch
"(kind == DomainInfo::All) <=> (parts.size() == 1)" of course.

Confirmed and fixed by 403s/1/0/
# pdns_control list-zones master
All zonecount:0
# pdns_control list-zones slave
All zonecount:0
# pdns_control list-zones native
ws.co.ls.
All zonecount:1
# pdns_control list-zones
ws.co.ls.
LIST-ZONES zonecount:1

Patch attached.

Best,
1050600
signature.asc

наб

unread,
Aug 26, 2023, 8:10:04 PM8/26/23
to
Control: tags -1 + fixed-upstream

Broken upstream by f115fbc97b9760bdfbff307e4de72a9cb3df0990, fixed
upstream by 0928e129fbd21c17a2f2e6e6066a58dad8102943.

$ git tag --contains 0928e129fbd21c17a2f2e6e6066a58dad8102943 | grep auth
auth-4.8.0-alpha1
auth-4.8.0-beta1
auth-4.8.0
auth-4.8.1

And what's worse, packages.d.o says
sid (unstable) (net): extremely powerful and versatile nameserver
4.8.1-2: amd64 arm64 ia64 mips64el ppc64 ppc64el riscv64 s390x sparc64
4.8.1-1 [debports]: alpha
4.7.1-1 [debports]: x32
4.4.1-4 [debports]: hppa m68k sh4
so release arches and alpha
(and hppa m68k sh4,
since f115fbc97b9760bdfbff307e4de72a9cb3df0990 appears in 4.7)
have a working version but x32 doesn't?

https://buildd.debian.org/status/package.php?p=pdns for 4.8.1-2 for x32
says "BD-Uninstallable", with
Dependency installability problem for pdns on x32:
pdns build-depends on missing:
- architecture-is-64-bit:x32
?!?

d/changelog says
pdns (4.7.3-2) unstable; urgency=medium

* Build-Depend on architecture-is-64-bit (for time_t) (Closes: #1011259)

-- Chris Hofstaedtler <ze...@debian.org> Sun, 25 Dec 2022 10:43:16 +0000
which. idk bro. x32 has a 64-bit time_t. Hell. x32 /only/ has 64-bit time_t!

Quoth /usr/include/x86_64-linux-gnux32/bits/timesize.h:
-- >8 --
/* Bit size of the time_t type at glibc build time, x86-64 and x32 case.
Copyright (C) 2018-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.

The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */

#include <bits/wordsize.h>

#if defined __x86_64__ && defined __ILP32__
/* For x32, time is 64-bit even though word size is 32-bit. */
# define __TIMESIZE 64
#else
/* For others, time size is word size. */
# define __TIMESIZE __WORDSIZE
#endif
/* Bit size of the time_t type at glibc build time, x86-64 and x32 case.
Copyright (C) 2018-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.

The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */

#include <bits/wordsize.h>

#if defined __x86_64__ && defined __ILP32__
/* For x32, time is 64-bit even though word size is 32-bit. */
# define __TIMESIZE 64
#else
/* For others, time size is word size. */
# define __TIMESIZE __WORDSIZE
#endif
-- >8 --

I'm hoping this is an "i forgor 💀" moment.

Attaching patch against current Salsa HEAD
(e993d4ff18ff126c43aa9a4d8dd79f301d8db055),
also opened
https://salsa.debian.org/dns-team/pdns/-/merge_requests/2

Best,
signature.asc

наб

unread,
Aug 26, 2023, 8:10:04 PM8/26/23
to
signature.asc
0 new messages