Skip to content

fatal error: Could not initialize thread / error: reading root hints #1038

Description

@kulikov-a

Hi!
Describe the bug
Sporadic fatal errors possible at unbound start if the root-hints option is used.
The server may become unresponsive as a result.

The copy of the https://www.internic.net/domain/named.root is used for root-hints.
Errors seen (can occur either during one start attempt or be limited to one error per unsuccessful attempt):
error: reading root hints /root.hints 19:1: Empty label
error: reading root hints /root.hints 2:37: Syntax error, could not parse the RR's type
error: reading root hints /root.hints 2:9: Syntax error, could not parse the RR's type
error: reading root hints /root.hints 8:14: Syntax error, could not parse the RR's class
error: reading root hints /root.hints 13:15: Conversion error, ip6 addr expected
and so on..
so it ends up with:
error: Could not set root or stub hints and fatal error: Could not initialize thread (for one or more threads)

The sporadic nature of the errors and their content (error in reading the record type in a comment line, mismatch between the record type and the address type) suggest that there may be a thread race when reading a file?

To reproduce
Steps to reproduce the behavior:

  1. Use root-hints option
  2. Сreate conditions for periodic unbound restart
  3. Wait

Expected behavior
A clear and concise description of what you expected to happen.

System:

  • Unbound version: 1.19.3
  • OS: FreeBSD 13.2-RELEASE-p10
  • unbound -V output:
 --with-libexpat=/usr/local --with-ssl=/usr/local --enable-dnscrypt --disable-dnstap --with-libnghttp2 --with-dynlibmodule --enable-ecdsa --disable-event-api --enable-gost --with-libevent --with-pythonmodule=yes --with-pyunbound=yes ac_cv_path_SWIG=/usr/local/bin/swig LDFLAGS=-L/usr/local/lib --disable-subnet --disable-tfo-client --disable-tfo-server --with-pthreads --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/share/man --infodir=/usr/local/share/info/ --build=amd64-portbld-freebsd13.2
Linked libs: libevent 2.1.12-stable (it uses kqueue), OpenSSL 3.0.13 30 Jan 2024
Linked modules: dns64 python dynlib respip validator iterator
DNSCrypt feature available

Additional information
not yet

Thanks!

cc @fichtner

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