[GH-ISSUE #1913] Trustdns panic, When query non-existence domain names. (windows) #816

Closed
opened 2026-03-16 00:21:37 +03:00 by kerem · 1 comment
Owner

Originally created by @mokeyish on GitHub (Mar 27, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1913

Describe the bug
Trustdns panic, When query non-existence domain names. (windows)

To Reproduce
Steps to reproduce the behavior:

test.conf

listen_port = 53
listen_addrs_ipv4 = ["127.0.0.1"]

[[zones]]
zone = "."
zone_type = "Forward"
stores = { type = "forward", name_servers = [
  { socket_addr = "223.5.5.5:53", protocol = "udp", trust_nx_responses = false },
  { socket_addr = "223.5.5.5:53", protocol = "tcp", trust_nx_responses = false },
] }

  1. start trust-dns

    .\target\debug\trust-dns.exe -c .\test.toml
    
  2. query with nslookup (repeat about 10 times)

    nslookup -qtype=a lan.lan.  127.0.0.1
    
  3. trust-dns panic!!!

    1679917039:ERROR:trust_dns:496:Trust-DNS 0.22.0 has encountered an error: unexpected close of UDP socket
    thread 'main' panicked at 'Trust-DNS 0.22.0 has encountered an error: unexpected close of UDP socket', bin\src/trust-dns.rs:497:13
    

Expected behavior
Keep running

System:

  • OS: Windows 11
  • Architecture: x86_64
  • Version: 11
  • rustc version: 1.65.0 (897e37553 2022-11-02), 1.68.1 (8460ca823 2023-03-20)

Version:
Crate: trust-dns
Version: commit 14c7424

Originally created by @mokeyish on GitHub (Mar 27, 2023). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1913 **Describe the bug** Trustdns panic, When query non-existence domain names. (windows) **To Reproduce** Steps to reproduce the behavior: test.conf ```toml listen_port = 53 listen_addrs_ipv4 = ["127.0.0.1"] [[zones]] zone = "." zone_type = "Forward" stores = { type = "forward", name_servers = [ { socket_addr = "223.5.5.5:53", protocol = "udp", trust_nx_responses = false }, { socket_addr = "223.5.5.5:53", protocol = "tcp", trust_nx_responses = false }, ] } ``` 1. start trust-dns ```ps1 .\target\debug\trust-dns.exe -c .\test.toml ``` 2. query with nslookup (repeat about 10 times) ```ps1 nslookup -qtype=a lan.lan. 127.0.0.1 ``` 3. trust-dns panic!!! ```log 1679917039:ERROR:trust_dns:496:Trust-DNS 0.22.0 has encountered an error: unexpected close of UDP socket thread 'main' panicked at 'Trust-DNS 0.22.0 has encountered an error: unexpected close of UDP socket', bin\src/trust-dns.rs:497:13 ``` **Expected behavior** Keep running **System:** - OS: Windows 11 - Architecture: x86_64 - Version: 11 - rustc version: 1.65.0 (897e37553 2022-11-02), 1.68.1 (8460ca823 2023-03-20) **Version:** Crate: trust-dns Version: commit 14c7424
kerem closed this issue 2026-03-16 00:21:43 +03:00
Author
Owner

@mokeyish commented on GitHub (Mar 27, 2023):

It seems that we shouldn't break here

github.com/bluejekyll/trust-dns@14c742467d/crates/server/src/server/server_future.rs (L69-L74)

If I replace break with continue, it will not panic, but keep reporting error (It is no problem to query other domain names.).

How to reset the buf_stream?

<!-- gh-comment-id:1485030625 --> @mokeyish commented on GitHub (Mar 27, 2023): It seems that we shouldn't break here https://github.com/bluejekyll/trust-dns/blob/14c742467d92656a62ac4af387c72456e5b4805c/crates/server/src/server/server_future.rs#L69-L74 If I replace `break` with `continue`, it will not panic, but keep reporting error (It is no problem to query other domain names.). How to `reset` the `buf_stream`?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#816
No description provided.