NLnetLabs / unbound

Unbound is a validating, recursive, and caching DNS resolver.
https://nlnetlabs.nl/unbound
BSD 3-Clause "New" or "Revised" License
3.07k stars 349 forks source link

When num-threads set not 1, will be crash after running awhile (malloc(): unaligned tcache chunk detected) #1013

Closed hezhijie0327 closed 4 months ago

hezhijie0327 commented 8 months ago

Describe the bug A clear and concise description of what the bug is.

To reproduce Steps to reproduce the behavior:

  1. set num-threads to 2 or others
  2. restart unbound
  3. wait for awhile, crash with malloc(): unaligned tcache chunk detected

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

System:

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


**Additional information**
Add any other information that you may have gathered about the issue here.

cachedb: backend: 'redis' cachedb-no-store: no redis-expire-records: yes redis-logical-db: 0 redis-server-host: 127.0.0.1 redis-server-password: '' redis-server-path: '' redis-server-port: 6379 redis-timeout: 1000 remote-control: control-interface: 0.0.0.0 control-interface: ::0 control-enable: yes control-port: 8953 control-use-cert: no server: access-control: 0.0.0.0/0 allow access-control: ::/0 allow add-holddown: 2592000 aggressive-nsec: yes answer-cookie: yes auto-trust-anchor-file: '/etc/unbound/data/root.key' cache-max-negative-ttl: 3600 cache-max-ttl: 86400 cache-min-ttl: 0 caps-whitelist: yes chroot: '' client-subnet-always-forward: no del-holddown: 2592000 delay-close: 0 deny-any: yes directory: '/etc/unbound' disable-dnssec-lame-check: no disable-edns-do: no do-daemonize: yes do-ip4: yes do-ip6: yes do-nat64: no do-not-query-localhost: no do-tcp: yes do-udp: yes ede-serve-expired: yes ede: yes edns-buffer-size: 1232 edns-client-string-opcode: 65001 edns-tcp-keepalive-timeout: 120000 edns-tcp-keepalive: yes extended-statistics: yes fast-server-num: 3 fast-server-permil: 0 harden-algo-downgrade: yes harden-below-nxdomain: yes harden-dnssec-stripped: yes harden-glue: yes harden-large-queries: yes harden-referral-path: yes harden-short-bufsize: yes harden-unknown-additional: yes hide-http-user-agent: yes hide-identity: yes hide-trustanchor: yes hide-version: yes http-endpoint: '/dns-query' http-max-streams: 100 http-nodelay: yes http-notls-downstream: no http-query-buffer-size: 4m http-response-buffer-size: 4m http-user-agent: '' https-port: 3353 identity: '' ignore-cd-flag: no incoming-num-tcp: 10 infra-cache-max-rtt: 120000 infra-cache-min-rtt: 50 infra-cache-numhosts: 10000 infra-cache-slabs: 4 infra-host-ttl: 900 infra-keep-probing: yes insecure-lan-zones: no interface: 0.0.0.0@3553 interface: ::0@3553 interface-automatic: no ip-freebind: yes ip-ratelimit: 0 ip-ratelimit-backoff: yes ip-ratelimit-factor: 10 ip-ratelimit-size: 4m ip-ratelimit-slabs: 4 ip-transparent: yes jostle-timeout: 200 keep-missing: 31622400 key-cache-size: 64m key-cache-slabs: 4 log-destaddr: no log-identity: '' log-local-actions: yes log-queries: no log-replies: no log-servfail: no log-tag-queryreply: no log-time-ascii: yes max-client-subnet-ipv4: 24 max-client-subnet-ipv6: 56 max-ecs-tree-size-ipv4: 100 max-ecs-tree-size-ipv6: 100 max-query-restarts: 11 max-reuse-tcp-queries: 200 max-sent-count: 32 max-udp-size: 1232 min-client-subnet-ipv4: 0 min-client-subnet-ipv6: 0 minimal-responses: yes module-config: 'subnetcache validator cachedb iterator' msg-buffer-size: 65552 msg-cache-size: 64m msg-cache-slabs: 4 nat64-prefix: 64:ff9b::/96 neg-cache-size: 16m num-queries-per-thread: 1024 num-threads: 2 outbound-msg-retry: 5 outgoing-num-tcp: 10 outgoing-range: 4096 pad-queries-block-size: 128 pad-queries: yes pad-responses-block-size: 468 pad-responses: yes permit-small-holddown: no pidfile: '/etc/unbound/work/unbound.pid' port: 3553 prefer-ip4: yes prefer-ip6: no prefetch-key: yes prefetch: yes qname-minimisation-strict: no qname-minimisation: yes ratelimit: 0 ratelimit-backoff: yes ratelimit-factor: 10 ratelimit-size: 4m ratelimit-slabs: 4 root-hints: '/etc/unbound/data/root.hints' root-key-sentinel: yes rrset-cache-size: 64m rrset-cache-slabs: 4 rrset-roundrobin: yes send-client-subnet: 0.0.0.0/0 send-client-subnet: ::/0 serve-expired-client-timeout: 1800 serve-expired-reply-ttl: 30 serve-expired-ttl: 259200 serve-expired-ttl-reset: yes serve-expired: yes serve-original-ttl: yes so-rcvbuf: 0 so-reuseport: yes so-sndbuf: 0 sock-queue-timeout: 3 statistics-cumulative: no statistics-inhibit-zero: yes statistics-interval: 0 stream-wait-size: 4m target-fetch-policy: '3 2 1 0 0' tcp-auth-query-timeout: 3000 tcp-idle-timeout: 30000 tcp-reuse-timeout: 60000 tcp-upstream: no tls-cert-bundle: '/etc/ssl/certs/ca-certificates.crt' tls-port: 3533 tls-service-key: '/etc/unbound/cert/private.key' tls-service-pem: '/etc/unbound/cert/fullchain.cer' tls-upstream: no tls-use-sni: no trust-anchor-signaling: yes udp-connect: yes udp-upstream-without-downstream: yes unblock-lan-zones: no unknown-server-time-limit: 376 unwanted-reply-threshold: 10000000 use-caps-for-id: no use-systemd: no username: '' use-syslog: no val-bogus-ttl: 60 val-clean-additional: yes val-log-level: 0 val-max-restart: 5 val-nsec3-keysize-iterations: '1024 150 2048 150 4096 150' val-override-date: 0 val-permissive-mode: yes val-sig-skew-max: 86400 val-sig-skew-min: 3600 verbosity: 0 version: '' zonemd-permissive-mode: no

hezhijie0327 commented 4 months ago

Fixed by building with --without-pthreads