Skip to content

error: "memory exhausted" when defining more than 9994 local-zones #1127

@markus-t314

Description

@markus-t314

Describe the bug
unbound 1.21 does not start anymore with the same config files that worked in 1.20. The error originates when parsing the config file:

# unbound-checkconf 
/etc/unbound/blocklist.conf:9994: error: memory exhausted
read /etc/unbound/unbound.conf failed: 1 errors in configuration file

Minimal unbound.conf

server:
        access-control-view: 192.168.0.0/16 adware_view
view:
        name: "adware_view"
        include: /etc/unbound/blocklist.conf

With blocklist.conf containing LOTS of entries like
local-zone: "some.domain.com" always_nxdomain

Sample configuration files are here:
config_files.tar.gz

If blocklist.conf is stripped down to 9993 lines, it works and unbound consumes around ~12M memory. So, this doesn't look like an OOM error.
With unbound 1.20 I had around 170k local-zone entries and with a memory consumption of around ~75M.
If this setup is somehow not supported anymore, how would I change it?

To reproduce

  1. Use attached config files
  2. Execute unbound-checkconf

Expected behavior
unbound still works.

System:

  • Unbound version: 1.21
  • OS: Linux Arch
  • unbound -V output:
 Version 1.21.0

Configure line: --prefix=/usr --sysconfdir=/etc --localstatedir=/var --sbindir=/usr/bin --disable-rpath --enable-dnscrypt --enable-dnstap --enable-pie --enable-relro-now --enable-subnet --enable-systemd --enable-tfo-client --enable-tfo-server --enable-cachedb --with-libhiredis --with-conf-file=/etc/unbound/unbound.conf --with-pidfile=/run/unbound.pid --with-rootkey-file=/etc/trusted-key.key --with-libevent --with-libnghttp2 --with-pyunbound
Linked libs: libevent 2.1.12-stable (it uses epoll), OpenSSL 3.3.1 4 Jun 2024
Linked modules: dns64 cachedb subnetcache respip validator iterator
DNSCrypt feature available
TCP Fastopen feature available

BSD licensed, see LICENSE in source package for details.
Report bugs to unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions