mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-10-15 05:42:07 +00:00
[GH-ISSUE #2933] Deadlock between AmneziaVPN-service and kernel network locks on lid close (macOS 26.6, app 5.0.0.5, VLESS) — configd killed by WATCHDOG #1337
Open
opened 2026-10-13 20:40:28 +00:00 by bsakaguchi
·
5 comments
No Branch/Tag specified
dev
feat/otp-login
feat/api-tests
fix/show-locked-xray-settings-page-for-servers-without-write-access
fix/serialize-log-record-writes-and-pin-log-date-format-locale
fix/libagw-review-fixes
fix/ios-xray-ipv6-leak
fix/macos-xray-ipv6-leak
feat/add-support-include-split-tunnel
fix/win-xray-app-split-tunneling
fix/bug-when-saving-after-canceling
fix/xray-reconnect-crash
fix/share-empty-config-on-ssh-timeout
fix/ssh-credentials-input
fix/updater-verify-signature
fix/async-ssh-threading
fix/xray-check-inet-and-liveness-monitor
fix/selfhosted-server-installations
feat/add-support-ikev2-macos
fix/icons-different-color-themes
feat/add_support_arm_windows
feat/add-deep-link
feat/fixed-push-notifications-on-VPN-connect-disconnect-2
feat/implement-QR-code-generation-and-scanning
feat/file-password-protection
feature/add-local-proxy
feat/add-support-split-tunnel-macos
feat/tests
fix/android-register-unacknowledged-purchase
fix/share_on_linux
mirroring-to-outside
feat_copy_docker_configs
feat/self-diagnostics-log
feat/amnezia-free-vless-switch
fix/conan_build_android_on_win
fix/linux-reconnect-dns-reliability
fix/windows-connection-stability
fix/linux-reconnect-refactoring
fix/ios-groupidentifier-order
feat/xray-subscription-link
fix/minor-fixes
fix/xray-config-inplace-edit
feat/amnezia-sdk-typed-api
feat/amnezia-sdk-integration
feat/force-update-native
refactor/marketplace-update-popup
feat/force-update
fix/valnurability_dev
chore-xcode-version
fix/empty-i1-i5
build_qt_6_10_1
master
feat/protocol-selection
fix/openvpn_install
feat/locations_change
feat/locations_change_rework
feature/local-proxy-integration
fix/filepicker_atv
fix_valnurability
fix/macos-ne-codesign-4.8.19.0
temp-branch-for-testing
fix/rebased_4_8_19_linux_fix_error
feat/proxy-storage-cache
fix/zeroed-params
fix/killswitch-blocknets-linux
update/translation_RU
fix/self_hosted_reinstall_error
feat/selfhosted-dns
fix/agp_version_up
feat/switch_to_alive_protocol
feat/support_multipeer
server_scripts_update
fix/extended-vless-configuration
chore/apple-ci-cd-macos-versions
feat/add-telemt
fix/android_keystore_read_error
feat/add-mtproxy
chore/bump-qt-version
fix/make_dbus_async
feature/dns
rebase/apple-tv-target-on-conan
fix/outbound_freedom_xray_with_dns_fix
feat/apk_support
feat/fallback-proxy
feat/apple-tv-target
fix/dns_reconnection_issue
feat/fixed-push-notifications-on-VPN-connect-disconnect
fix/linux-firewall
docker-regional-locks
appstore-review-popup
feat/storekit2
fix/uninstall-split-tunnelling-driver
revert-2376-chore/license-file
support_16kb_android
bump_version
feat_add_review_android
bugfix/translation-absence-on-subscription-key-page
feat/location-separation-by-region
bugfix/text-moving-when-resing-window
fix_backup
feature/add-purchase-android
bugfix/moved-text-while-resizing-window
bugfix/incorrect-killswitch-restore-from-backup
fix/backup-exclude-secondary-api-configs
feat/proxy-fields-for-dev-console
bugfix/ovpn-ios-fix
bugfix/linux-bundle-libraries
fix/xray-app-split-win
fix/upload-to-s3
chore/add-release-date-upload
feat_add_webview_support
feature/configuration-transfer-through-qr
feat/bot-key-unlink-device
fix/ad-link-lang-support
fix/qsecuresettings-with-android
feat/add-support-arm64-win
spanish-translations
fix/context-menu
feat/add-system-dns-support
fix/qt6-9-support
fix/qt6_9_support
bugfix/strict-killswitch-ui
android-7
chore/minor-bugfixes
feature/awg-net-fix-macos-wakeup
fixbug/ios18
bugfix/ios-ne-crash
fix/linux-tray-quit-button
cryptpad-support
bugfix/disable-linux-killswitch
fix/minor-ui-fixes
feature/setup-guid-tun2socks
feature/linux-ipsec
feature/ipsec-linux
refactoring/server-config-in-classes
feature/macos-ipsec
fix/ui-fixes-after-merge-with-d20ed4a
chore/focus_control_after_qt_6.9_migration
feature/integrate-xray-as-a-library
maxos-awg-fix
feature/add-new-awg-docker-image
chore/update-3rd-prebuild
feature/test-news
fix/api-conf-files
bugfix/split-tunneling-with-api-config
bugfix/ios-awg-new-fields
feature/special-handshake-2
feat/xray-api-support
fix/desktop-entry
bugfix/shadowsocks-cipher-setting-not-changing
feature/update-tap
bugfix/openvpn_import_fix
feature/ability-to-change-port-after-installing-xray
bugfix/strict-mode-ovpn
bugfix/win-ipv6-ovpn
bugfix/subnet-adress-setting
exception-podman-docker
bugfix/fix-listviewtype-scrolling
bugfix/win-disabled-ipv6
bugfix/win-ipv6-disabled-ovpn
feature/killswitch-strict-mode
feature/awg-network-check
feature/empty-split-tunneling-list
feature/support-info
chore/update-go-version
checking-Linux-version
update_server_scripts
bugfix/button-selection-easy-setup-page
feature/old-api-proxy
patch/user-checking
fix/correcting-version
support-podman
support_podman
user-checking-patch
feature/check-docker-version
feature/allowed-dns-list
without_lsof
chore/error-body
Update-amneziavpn_ru_RU
shiroow-patch-8
shiroow-patch-7
shiroow-patch-6
shiroow-patch-5
shiroow-patch-4
shiroow-patch-3
shiroow-patch-2
shiroow-patch-1
check_sudo_permissions
feature/euphoria
add_next_octet_to_ip_settings
bugfix/mobile-controllers-init
euphoria
bugfix/android-crush
feature/macox-network-extension
bugfix/pre-release-hotfixes
bugfix/ipsec-pfs
chore/ios-site-links
checking_sudo_permissions
feature/android-tv
improve_navigation_cpp
bugfix/linux-firewall-install
fixbug/wireguard-handshake-time
ReadmeRu_full
feature/xray-user-management
feature/subscription-end-date
chore/clang-format
feature/ru-in-readme
chore/increased-api-timeout
chore/deploy-workflow
bugfix/services-list-scroll
wheel_group_suppor
chore/bump-xcode-version
fixbug/mac-network-extension
feature/android-gpb
feature/page-home-drawer-country-selection
checking-sudo-users
bugfix/service-info-from-response
fixbug/build-macos-ne-2
android-qt-6.7.3
fixbug/build-macos-ne
bugfix/wg-windows-log-folder
feature/psk-key-api-request
bugfix/user-management-qml-warnings
fix/macos-network-extension
fixbug/macos-NE-build
bugfix/fixed-isDevEnv-initialization
bugfix/revert-ios-ovpn
feature/tun2socksSrv
fix/disable_singleapp
feature/awg-wg-name-resolving
feature/disable-dhcp
bugfix/allowed-ips-old-configs
feature/goodbyedpi
feature/add-exception-log
refactoring/remove-ipv6-from-default-routes
refactoring/singleapplication-submodule
macos-dirty-build
test/gateway
Update-amneziavpn_fa_IR.ts
bugfix/ipsec-win
fix/xray-custom-port
improve-tab-navigation
test-win-11
feature/android-tv-remote-control-support
KsZnak-patch-1
feature/awg-wg-qr
bugfix/fix-loopback-splittunel
fix/setup_host_firewall
feature/android-xray
feature/openvpn-pass
feature/connection-string
fix/clickable-errors
bugfix/api_1100_fix
feature/graphview
testsvg
feature/update-win-awg
feature/open-as-amnezia
feature/update-mozilla-upstream
bugfix/qr-code-cutting
feature/native-wg-psk
test/awg-centos
bugfix/hide_error
feature/add-uninstaller-checkbox
bugfix/cancel-button-on-install-page
bugfix/anchors-page-home-warning
awg-udptlspipe
button-focus-fix
revert-677-fix/logger
bugfix/Revert_PR_596
bugfix/allowed-ips-api-configs
bugfix/on-escape-pressed
feature/auto-scroll-for-server-selection-list
fix/ui-fixes
translations/update_fa_IR.ts
feature/new-awg-docker-container
bugfix/awg_ipv6_fix
feature/tab-navigation
fix/username-no-autocapitalization
sure
refactoring/servers-model-cleanup
feature/wg-mtu-setup-ios
3rd_adaptation_to_diff_OS
sudo_not_found
test/docker-ce
bugfix/double_clear_server_from_amnezia
fix/android
client/3rd-prebuilt
revert-559-KsZnak-translation-ru-ex
KsZnak-translation-ru-ex
KsZnak-br1
KsZnak-text-change
feature/api-awg
feature/error-code-output
feature/win_x32_builds
text/debug-output
feature/ovpn3-desktop-cli
bugfix/secureqsettings-deadlock
refactoring/change-settings-when-connected
files_check
ArchLinux-support
second_adaptation_to_diff_os
sudo
refactoring/android-build
adaptation_to_different_os
feature/online_installer_for_v4
update_to_r2
bugfix/return-after-installation
feature/custom_drawer_component
bugfix/split-tunneling
bugfix/existing-awg-container
revert-370-feature/custom_drawer_component
bugfix/adapted_awg_questiondrawer
bugfix/updated_drawer_height_pageserverdata
bugfix/translated_new_source_strings_to_chinese
feature/split-tunneling-config
feature/accessibility-support
branch_connectivity_change_fix
feature/ikev2_android
android_ss_transport
bugfix/macos_fixes
feature/nextcloud-support
feature/macos_network_extension
android_pt_transport_source
feature/ios-openvpn3-pluggable-transport-Cloak
bugfix/cloak_for_desktops_fix
arm-build-macos
fix-macos-build-brew
bugfix/ios-build-openvpnadapter-from-source
feature/download-native-wireguard-config-on-connect
feature/v2ray-container
bugfix/dpkg-busy-checking-stuck
feature/online-installer
dev-killswitch
dev-netadapters
5.0.3.0
5.0.2.1
5.0.2.0
5.0.1.5
5.0.0.5
5.0.0.2
4.8.21.0
4.8.19.0
4.8.18.0
4.8.17.0
4.8.16.0
4.8.15.4
4.8.15.0
4.8.14.5
4.8.14.1
4.8.12.9
4.8.12.8
4.8.12.7
4.8.12.6
4.8.11.4
4.8.11.3
4.8.11.2
4.8.11.1
4.8.11.0
4.8.10.0
4.8.9.2
4.8.9.1
4.8.9.0
4.8.8.3
4.8.8.2
4.8.8.1
4.8.7.2
4.8.7.1
4.8.7.0
4.8.6.0
4.8.5.0
4.8.4.5
4.8.4.4
4.8.4.3
4.8.4.2
4.8.4.1
4.8.4.0
4.8.3.2
4.8.3.1
4.8.2.3
4.8.1.9
4.8.1.0
4.8.0.5
4.7.0.0
4.6.0.3
4.6.0.1
4.5.3.0
4.5.0.0
4.4.0.0
4.3.0.0
4.2.1.0
4.2.0.1
4.1.2.0_cloak_pt_experimental
4.1.0.1
4.0.8
3.1.0
3.0.8
3.0.7
3.0.5
2.1.2
2.1.0
2.0.10
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.1
2.0
1.9.1
1.9
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0
No labels
pull-request
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#1337
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @romanovevgeniy on GitHub (Aug 4, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/2933
Summary
On macOS 26.6 (25G72), closing the MacBook lid while the VPN is connected reliably
deadlocks the system networking stack. A kernel lock cycle forms between
AmneziaVPN-serviceand the kernel,configd'sIPConfigurationAgentQueuestalls,and after 60 seconds the watchdog terminates
configd.This happens every single day, on every lid close with the VPN running.
Environment
tun2socksis present in the process list (41 threads), consistent with theXRay/VLESS userspace tunnel path
displayState: OFFSteps to reproduce
configdwatchdog report is generated.Actual result
configdis killed by the [watchdog]Root cause from the stackshot — four-way lock cycle
configdthread 103010 (IPConfigurationAgentQueue) waits on kernel mutex0xfffffe000c571830, owned by kernel thread 103456 (thread call high #27).0xfffffe000c5a4270for reading,owned by thread 104354.
mutex
0x5162d882b476c1c1, owned by kernel thread 5256.0xfffffe000c571830— back to 103456.The cycle never breaks, so the whole networking subsystem stalls.
Additional observations
AmneziaVPN-servicehad 259 threads and ~955 MB resident memory, with~592k page faults. Roughly 200 of those threads were parked on the same
0xfffffe000c571830mutex, and about a dozen more on the krwlock held by 104354.The thread and memory growth looks like a leak independent of the deadlock.
tun2socks(41 threads) is blocked on the same mutex.AmneziaVPNGUI process is also stuck: thread 16371 waits on krwlock0xfffffe000c5a4270for writing, owned by 104354.Likely trigger
On lid close macOS tears down Wi-Fi and reconfigures interfaces, so
configddismantles network services while the client simultaneously tears down its
utun.The two sides appear to acquire the network locks in opposite order.
Workaround
Disconnecting the VPN before closing the lid avoids the issue entirely.
Attachment
Full watchdog stackshot attached.
Error.rtf
@RiRion commented on GitHub (Aug 6, 2026):
I’m experiencing what appears to be the same issue described in both #2897 and #2933.
My MacBook Pro has an Apple M2 Max chip, and the problem occurred on both macOS 26.5 and macOS 26.6 while using AmneziaVPN 5.0.0.5.
The Mac completely freezes and then reboots with a kernel panic: userspace watchdog timeout: no successful checkins from configd. The panic log shows that configd stopped responding for 180 seconds, after which AppleARMWatchdogTimer triggered the panic.
This seems consistent with a deadlock in the macOS networking stack involving AmneziaVPN-service and configd, as described in these two issues. AmneziaVPN was installed and active when the freezes occurred. I can provide the full panic logs if needed.
@antivanmsk commented on GitHub (Aug 8, 2026):
On my iMac (M4) with macOS 26.6, Amnesia version 5.0.0.5 works for a while, but then it freezes and completely locks up — all apps stop working. Only a hard reboot helps, and I have to force-quit each previously open app individually!
@dmshem commented on GitHub (Aug 21, 2026):
Environment
.pkgdistributionProblem
AmneziaVPN occasionally enters a system-level deadlock, usually after the Mac has gone to sleep while VPN is connected.
After waking up:
pfctlitself hangs, for example:This has happened multiple times and is reproducible enough to make the client difficult to use.
Interesting diagnostic information
During the most recent occurrence I inspected the processes before rebooting.
AmneziaVPN-servicewas running as PID 314, withtun2socksas its child:The important part is that
tun2sockswas in uninterruptible wait (U) while usingutun22.samplewas still able to collect a sample fromtun2socks:I then sent SIGKILL to
tun2socks:but the process did not disappear. It changed to an exiting state and remained stuck:
I then sent SIGKILL to
AmneziaVPN-service:After that, both processes remained present in exiting state:
They could not be killed even with SIGKILL.
At this point
pfctlalso hangs and macOS cannot complete a normal reboot.Possible direction
This looks like the problem is below the AmneziaVPN GUI level.
In particular,
tun2socksappears to get stuck in the kernel while tearing down or interacting with theutuninterface. Once this happens, bothtun2socksand its parentAmneziaVPN-servicecannot finish exiting even after SIGKILL.The fact that
pfctlalso blocks and macOS cannot shut down suggests a deadlock or blocked kernel path somewhere aroundutun/ networking teardown rather than simply stale routes or firewall rules.I can reproduce/test this further and provide the
sampleoutput or other diagnostics if you tell me what would be useful to collect before the next forced reboot.@pavelgup-blip commented on GitHub (Sep 9, 2026):
Same deadlock here, on a desktop Mac with no sleep and no lid involved, ending in
the same kernel panic @RiRion described above, twice in three days. What I can add to
the thread is the part that is missing from a panic log: three watchdog stackshots
taken before the panic, one minute apart, with an identical lock graph that names the
threads holding the locks. I also still reproduce this on 5.0.1.5, as does #3130,
so the current release does not fix it.
Environment
RELEASE_ARM64_T8132tun2socksrunningConf.routeMode=2,Conf.sitesSplitTunnelingEnabled=1),115 host
/32routes in the tableamn.*pf anchors,pf.tokenpresent)systemextensionsctl listreports 0 extensions,scutil --nc listis emptyWhat is new relative to this thread
report
Sleep : 0x00000000andWake : 0x00000000, so the machine never sleptduring those boot sessions. VLESS was simply switched on during normal desktop use:
processUptimein the stackshots puts the start oftun2socksat 15:59:36, and thefirst stuck process appears at 16:07:36, about eight minutes into a working tunnel.
configddoesnot help while the lock owners are alive, and the stackshots show it directly: at
16:10:36
configdis pid353, the watchdog crashes it, and the next stackshot at16:11:46 already shows the fresh pid
8921stuck in the very same lock graph. Afterthe third timeout the kernel panics:
userspace watchdog timeout: no successful checkins from configd (2 induced crashes) in 180 seconds. Two panics so far,2026-09-07 01:04:40 and 2026-09-09 16:14:33, both with a hard reboot.
In the 2026-09-07 panic the induced crash did not even take effect: the panic string
reads
configd (1 induced crashes)together withconfigd has not exited since first loaded. That matches @dmshem's finding that the stuck processes surviveSIGKILL.other 5.0.1.5 case, and it is on the same macOS build as mine (26.6.2, 25G83) with
the same
tun2socks/utun22path.tun2socksis a lock owner, not only a victim. In my stackshots a kernelthread is blocked on a mutex owned by a
tun2socksthread.ends of that scale. On 2026-09-07
AmneziaVPN-servicehad 307 threads (74 MB,167k page faults) and
tun2socks17, close to the 259 threads in the original report.On 2026-09-09 the same deadlock formed with 52 threads in the service (33 MB) and
4 in
tun2socks. Same lock cycle either way, so the thread and memory growth is aseparate leak rather than a precondition.
pfctlprocesses are wedged (pids 8897, 8903, 8905), each 1/1 thread inTH_WAIT, TH_UNINT, with identical pids and tids across all three stackshots takena minute apart. By uptime they were started at 16:07:36, 16:08:36 and 16:09:05, so
roughly once a minute, and none of them ever returned. The last one starts about
30 seconds before
configdmisses its first checkin. This matches @dmshem'sobservation that
pfctlhangs, and it puts the pf/KillSwitch path inside the window.IPMonitorQueuein the first stackshot,then
IPConfigurationAgentQueuein the next two.is what #3130 reports too. At 16:07:36 Steam started (
steam_osxplus fiveSteam Helperprocesses, all withprocessUptime180 s in the 16:10:36 stackshot),and the first
pfctlhangs in the same second. #3130 describes the same failure onthe same macOS build and client version, with Docker Desktop opening many outbound
connections through
utun22as the trigger. That is a correlation from one incidenthere, not proof, but "an application opens a lot of sockets through the tunnel" fits
both reports better than sleep or lid close does.
Lock graph, identical in all three stackshots
Taken from
stackshot.processByPid["0"].waitInfoandturnstileInfo, with owner tidsresolved to processes:
0xfffffe000c5d3f500xa98f7ac0af8d30410xfffffe000c606830for writingBoth owner threads are themselves in
TH_WAIT, TH_UNINT, so nothing ever drains. Thesame tids and the same lock addresses appear in all three stackshots, 16:10:36, 16:11:46
and 16:12:46, across a restart of
configdin between.configd's stack points at the stock/System/Library/SystemConfiguration/IPConfiguration.bundle(UUID
7A775BAB-74AD-3FCF-B359-A71072AFD390, verified withdwarfdump), so nothird-party code is loaded inside
configditself. It is a victim, not the cause.Timeline, 2026-09-09
Times before 16:10:36 are reconstructed from
processUptimein the first stackshot.tun2socks(pid 8555) starts, i.e. VLESS is connectedpfctlpid 8897 starts and never returnspfctlpid 8903 starts and never returnspfctlpid 8905 starts and never returnsconfigdmisses its first checkinconfigdpid353,IPMonitorQueueunresponsive, 0 induced crashes, "has not exited since first loaded"configd; stackshot 2 already shows the new pid8921, nowIPConfigurationAgentQueueunresponsive8921still stuck, 1 induced crash, 120 s since last checkin, "60 seconds since last crashed by watchdogd"The 2026-09-07 panic has the same signature with 1 induced crash, after an uptime of
~3.4 days, and
AmneziaVPNhad logged a hang 11 minutes earlier. Its stackshot istruncated ("missing stackshot buffer or size"), so no uptimes can be recovered from it.
Uninterruptible processes at 16:12:46
Everything else on the machine that touches the network is stuck behind the same graph.
AmneziaWG is unaffected
The same machine with the same split-tunneling settings runs AmneziaWG
(
amneziawg-go) for days without a problem.tun2socksis not spawned in that mode.That narrows the fault to the XRay/
tun2sockspath rather than to routing or pf alone.Artifacts
Attaching the three
configdwatchdog stackshots and both panic logs, plus a plaintext summary of the lock graph. No IP addresses, hostnames or site lists are included.
amnezia-panic-artifacts.zip
@HeisLuka commented on GitHub (Sep 9, 2026):
I rechecked this against current
dev, together with the newer reports in this thread and #3130.I think the scope of this issue can now be narrowed more accurately:
lid close / sleep is a trigger, but it is no longer supported as a required root cause.
The common failure domain looks much more like the macOS XRay
tun2socks/utundata path, with a separate Amnezia teardown/liveness problem that makes the resulting failure effectively unrecoverable.1. Sleep is not required anymore
The original report strongly correlated the failure with lid close.
However, the newer report on macOS 26.6.2 / Amnezia 5.0.1.5 reproduces the same class of lock graph on a Mac mini with no lid and no sleep transition.
In that capture:
remain blocked across multiple watchdog stackshots.
Importantly,
tun2socksis present as a lock owner, not only as a process waiting behind another owner.There is also #3130, where another 5.0.1.5 system reaches an explicit lock cycle involving:
immediately after a burst of outbound connections through Amnezia's
utun22.So I would now describe sleep as one way of stressing/reconfiguring the same networking path, rather than the primary explanation.
2. Current Amnezia code has an independently reproducible liveness problem around
pfctlCurrent
MacOSFirewall::execute()runs firewall operations throughQProcessand then calls:without a timeout.
That means essentially every synchronous PF operation can block the caller indefinitely if
pfctlitself becomes stuck in the kernel.This affects operations including:
The newer diagnostic in this issue shows exactly that kind of state: several
pfctlprocesses remain wedged while the networking lock cycle persists.I don't think the source proves that PF creates the original kernel deadlock.
But it does prove that Amnezia currently has no bounded failure boundary once
pfctlenters that state.The invariant should be:
3. XRay teardown order makes recovery worse
Current
XrayProtocol::stop()performs roughly:So if the system is already in the state reported here:
pressing Disconnect does:
and never reaches:
This matches the user-visible failure very closely:
Even if the original kernel lock cycle originates outside Amnezia's Qt control logic, the teardown ordering currently prevents Amnezia from making a best-effort recovery.
I would invert the dependency:
A kill switch remaining active for a short period while the data-plane process is being stopped is also safer than keeping
tun2socksalive because PF cleanup did not return.More generally, one failed cleanup stage should not prevent all subsequent cleanup stages from being attempted.
4. The sleep path is still a useful aggravating factor
Current
MacOSNetworkWatcherreceives:and immediately acknowledges it with
IOAllowPowerChange().It does not first quiesce XRay, stop
tun2socks, or drain theutundata path.On wake it later emits the normal wakeup signal.
That is not sufficient to explain the Mac mini reproduction, so I would not call it the root cause.
But it means an active
tun2socks/utun22session is intentionally allowed to cross the macOS sleep transition.Given the lock graphs reported here, this is worth treating as a separate lifecycle stress case.
For XRay on macOS, a safer lifecycle may be:
rather than leaving the userspace TUN stack live through the transition.
5. I don't think current Amnezia source is enough to identify the first kernel lock owner with certainty
At this point I would distinguish two questions.
The first one is:
The evidence now points strongly toward the external
tun2socks/utunpath under network churn, but I don't think the Amnezia repository alone proves whether the underlying fault is in:The second question is:
That part is directly visible in current source:
So I would treat those as actionable client bugs even before the lower-level kernel trigger is fully identified.
6. Current
devis still pinned to tun2socks 2.6.0The current Conan recipe contains:
Upstream tun2socks 2.7.0 has been available since July.
The 2.6.0 -> 2.7.0 range includes, among other changes:
I am not claiming that 2.7.0 fixes this issue.
But because the evidence now points toward the
tun2socks/utun data path, an A/B reproduction between the exact same Amnezia build using:would be a high-value isolation test.
Suggested containment / diagnostic direction
I would make the following properties explicit:
Regression / stress tests
I would specifically test:
For a reproduced kernel hang, the most useful artifact is probably a stackshot/sysdiagnose showing the lock owners around:
rather than only the GUI log.
So my current classification would be:
confirmed, but broader than the original title.
The likely common fault domain is the macOS XRay
tun2socks/utunpath.The exact first kernel-level cause still needs runtime isolation, but the current Amnezia client has a source-confirmed recovery/liveness bug: firewall teardown is unbounded and is made a prerequisite for stopping
tun2socks, so a networking/PF stall can permanently block Disconnect and prevent best-effort recovery.