[GH-ISSUE #2791] VLESS: DNS resolution and TCP traffic fail while ping still works (tun2socks crash) #1270

Open
opened 2026-10-14 03:39:15 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @mevlat on GitHub (Jul 1, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/2791

Describe the bug
When using the VLESS protocol, DNS resolution and TCP/HTTPS traffic stop working entirely while ICMP (ping) through the tunnel keeps working normally. The tunnel interface (tun2) stays up and routes look correct, but no DNS queries (UDP or TCP, port 53) get a response from either the internal Amnezia DNS proxy (100.64.0.1) or the secondary DNS (8.8.4.4), and HTTPS connections to arbitrary IPs are rejected by the client's own killswitch rules (since no traffic actually reaches the tunnel beyond ICMP).
Investigation traced this to the AmneziaVPN client process crashing with SIGSEGV inside XrayProtocol::startTun2Socks() (see attached coredump/stacktrace). After the crash, the tun2socks bridge between the tun2 interface and the local SOCKS5 proxy (127.0.0.1:, which talks to the Xray/VLESS backend) is no longer functioning, so traffic that should be forwarded through it goes nowhere — while ICMP, which is handled at the kernel routing level independently of tun2socks, continues to work, creating the misleading "ping works, nothing else does" symptom.
Disabling VLESS and switching to the classic AmneziaWG/WireGuard protocol immediately restores normal connectivity, with no changes to server or location. Switching servers/locations while still on VLESS does not fix the issue.

To Reproduce
Steps to reproduce the behavior:

  • Configure a connection to a VLESS server in AmneziaVPN.
  • Connect to the VPN.
  • Observe DNS resolution failures (resolvectl query or dig @ time out) and failed HTTPS/TCP connections, while ping to the VPN-assigned DNS servers or any IP through the tunnel succeeds
  • (Optional trigger that reliably reproduces the crash) Click Connect/Disconnect rapidly several times in succession — this consistently produces a SIGSEGV crash in the AmneziaVPN process, picked up by drkonqi/systemd-coredump, with the offending frame in XrayProtocol::startTun2Socks().
  • After the crash, the tunnel interface remains up (and may even show correct routes), but DNS/TCP traffic through it is permanently broken until the app is fully disconnected and reconnected (or restarted).

Expected behavior
VLESS connections should resolve DNS and pass TCP/HTTPS traffic reliably, the same as the WireGuard/AmneziaWG protocol does. The tun2socks/Xray bridge should not crash, and if it does crash, the client should detect the failure and either restart the bridge automatically or clearly report a broken connection instead of leaving the tunnel interface in a state that looks "connected" but silently drops everything except ICMP.

Log files

AmneziaVPN.cd6dd9587c004df8b57bd06b48741b28.7847.1782831669000000.txt

AmneziaVPN.log

Desktop (please complete the following information):

  • OS: Fedora Linux 44 (KDE Plasma 6.7.1, Wayland)
  • Version: AmneziaVPN 4.8.19.0, Linux x64, installed from the official website

Additional context

Diagnostic steps performed before isolating the root cause: confirmed DNS servers (100.64.0.1, 8.8.4.4) reachable via ICMP through tun2 but unreachable via dig over both UDP and TCP (port 53) — nc -zv 53 connects but receives no data back; iptables counters on the client confirm packets are accepted and sent out via tun2+ (so the local Amnezia killswitch rules are not the cause); tcpdump on the physical wlan0 interface shows zero packets to the VPN server IPs during a failed DNS query, indicating the failure occurs locally, before traffic reaches the network.
~/.cache/drkonqi/crashes/ contains multiple AmneziaVPN.*.ini crash records from different sessions, suggesting this crash is not a one-off.
Switching to WireGuard/AmneziaWG on the same client/server setup resolves the issue completely, isolating the bug to the VLESS/Xray code path specifically (XrayProtocol/tun2socks bridge startup).
Rapid repeated clicking of Connect/Disconnect appears to reliably trigger the crash, suggesting a race condition during tun2socks startup/teardown, though the crash may also occur without obvious rapid clicking in some sessions.

Originally created by @mevlat on GitHub (Jul 1, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/2791 **Describe the bug** When using the VLESS protocol, DNS resolution and TCP/HTTPS traffic stop working entirely while ICMP (ping) through the tunnel keeps working normally. The tunnel interface (tun2) stays up and routes look correct, but no DNS queries (UDP or TCP, port 53) get a response from either the internal Amnezia DNS proxy (100.64.0.1) or the secondary DNS (8.8.4.4), and HTTPS connections to arbitrary IPs are rejected by the client's own killswitch rules (since no traffic actually reaches the tunnel beyond ICMP). Investigation traced this to the AmneziaVPN client process crashing with SIGSEGV inside XrayProtocol::startTun2Socks() (see attached coredump/stacktrace). After the crash, the tun2socks bridge between the tun2 interface and the local SOCKS5 proxy (127.0.0.1:<port>, which talks to the Xray/VLESS backend) is no longer functioning, so traffic that should be forwarded through it goes nowhere — while ICMP, which is handled at the kernel routing level independently of tun2socks, continues to work, creating the misleading "ping works, nothing else does" symptom. Disabling VLESS and switching to the classic AmneziaWG/WireGuard protocol immediately restores normal connectivity, with no changes to server or location. Switching servers/locations while still on VLESS does not fix the issue. **To Reproduce** Steps to reproduce the behavior: - Configure a connection to a VLESS server in AmneziaVPN. - Connect to the VPN. - Observe DNS resolution failures (resolvectl query <domain> or dig @<vpn-dns> <domain> time out) and failed HTTPS/TCP connections, while ping to the VPN-assigned DNS servers or any IP through the tunnel succeeds - (Optional trigger that reliably reproduces the crash) Click Connect/Disconnect rapidly several times in succession — this consistently produces a SIGSEGV crash in the AmneziaVPN process, picked up by drkonqi/systemd-coredump, with the offending frame in XrayProtocol::startTun2Socks(). - After the crash, the tunnel interface remains up (and may even show correct routes), but DNS/TCP traffic through it is permanently broken until the app is fully disconnected and reconnected (or restarted). **Expected behavior** VLESS connections should resolve DNS and pass TCP/HTTPS traffic reliably, the same as the WireGuard/AmneziaWG protocol does. The tun2socks/Xray bridge should not crash, and if it does crash, the client should detect the failure and either restart the bridge automatically or clearly report a broken connection instead of leaving the tunnel interface in a state that looks "connected" but silently drops everything except ICMP. **Log files** [AmneziaVPN.cd6dd9587c004df8b57bd06b48741b28.7847.1782831669000000.txt](https://github.com/user-attachments/files/29550961/AmneziaVPN.cd6dd9587c004df8b57bd06b48741b28.7847.1782831669000000.txt) [AmneziaVPN.log](https://github.com/user-attachments/files/29550962/AmneziaVPN.log) **Desktop (please complete the following information):** - OS: Fedora Linux 44 (KDE Plasma 6.7.1, Wayland) - Version: AmneziaVPN 4.8.19.0, Linux x64, installed from the official website Additional context Diagnostic steps performed before isolating the root cause: confirmed DNS servers (100.64.0.1, 8.8.4.4) reachable via ICMP through tun2 but unreachable via dig over both UDP and TCP (port 53) — nc -zv <dns-ip> 53 connects but receives no data back; iptables counters on the client confirm packets are accepted and sent out via tun2+ (so the local Amnezia killswitch rules are not the cause); tcpdump on the physical wlan0 interface shows zero packets to the VPN server IPs during a failed DNS query, indicating the failure occurs locally, before traffic reaches the network. ~/.cache/drkonqi/crashes/ contains multiple AmneziaVPN.*.ini crash records from different sessions, suggesting this crash is not a one-off. Switching to WireGuard/AmneziaWG on the same client/server setup resolves the issue completely, isolating the bug to the VLESS/Xray code path specifically (XrayProtocol/tun2socks bridge startup). Rapid repeated clicking of Connect/Disconnect appears to reliably trigger the crash, suggesting a race condition during tun2socks startup/teardown, though the crash may also occur without obvious rapid clicking in some sessions.
Sign in to join this conversation.
No labels
pull-request
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
amnezia-vpn/amnezia-client#1270
No description provided.