Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hezhijie0327 opened this issue Feb 10, 2024 · 1 comment

Comments

@hezhijie0327
Copy link

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:

  • Unbound version: Latest commit, self-build
  • OS: Ubuntu 22.04
  • unbound -V output:
Configure line: --enable-cachedb --enable-dnscrypt --enable-event-api --enable-fully-static --enable-ipsecmod --enable-ipset --enable-linux-ip-local-port-range --enable-pie --enable-relro-now --enable-subnet --enable-tfo-client --enable-tfo-server --with-dynlibmodule --with-libbsd --with-libevent=/tmp/BUILDLIB --with-libexpat=/tmp/BUILDLIB --with-libhiredis=/tmp/BUILDLIB --with-libmnl=/tmp/BUILDLIB --with-libnghttp2=/tmp/BUILDLIB --with-libsodium=/tmp/BUILDLIB --with-pthreads --with-ssl=/tmp/BUILDLIB --without-solaris-threads
Linked libs: libevent 2.1.12-stable (it uses epoll), OpenSSL 3.2.1 30 Jan 2024
Linked modules: dns64 dynlib cachedb ipsecmod subnetcache ipset respip validator iterator
DNSCrypt feature available
TCP Fastopen feature available

BSD licensed, see LICENSE in source package for details.
Report bugs to [email protected] 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
Copy link
Author

Fixed by building with --without-pthreads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant