Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix macOS FUSE-T process leak preventing volume unmount and USB ejection
Summary
When dismounting a VeraCrypt volume on macOS using a FUSE-T build, the background user-space NFS daemon (
go-nfsv4) often fails to exit its event loop (fuse_main()). As a result, active file descriptors remain open on the underlying block device, causinghdiutil detachand subsequent disk ejection (diskutil eject) to fail with "resource busy" or unmount dissent errors.Error Log / Reproduction
Attempting to eject the underlying drive in the terminal after unmounting via the VeraCrypt GUI results in:
Proposed Changes
PID Tracking (src/Core/Unix/FuseService.cpp): Write the FUSE service process ID to /tmp/veracrypt_fuset_slot_.pid immediately before entering fuse_main().
Forced Teardown
(src/Core/Unix/CoreMacOs.cpp): In CoreMacOSX::DismountVolume, check for the saved PID file and terminate the lingering go-nfsv4 / FUSE-T daemon before issuing hdiutil detach. This guarantees file handles are released prior to device detachment.
Testing & Verification Request
Note: These changes were authored and cross-referenced from a Windows environment. Opening as a Draft PR to request code review and runtime testing from maintainers or macOS users with FUSE-T setups.