Menu

[Bug] VeraCrypt 1.26.29: "Drive letter not available" loop and crash on USB removal for Favorite Volumes

5 days ago
2 days ago
  • Marcos Morar

    Marcos Morar - 5 days ago

    I am experiencing a critical issue with VeraCrypt version 1.26.29 on Windows when attempting to mount Favorite Volumes.

    1. Error Loop: When a Favorite Volume is configured to use a specific drive letter that is already taken by another device (e.g., a remounted USB drive), VeraCrypt displays the error "Drive letter not available". Clicking "OK" does not dismiss the dialog; instead, it immediately re-appears, creating an infinite loop that prevents any further interaction with the application until it is force-closed.

    2. Application Crash: If I physically remove the USB drive that is registered as a Favorite Volume while VeraCrypt is in this error state (or attempting to mount it), the application throws a critical exception. Clicking "OK" on the exception dialog causes VeraCrypt to terminate immediately.

    Steps to Reproduce:

    1. Install VeraCrypt 1.26.29.
    2. Add a USB encrypted volume to "Favorite Volumes" with a specific assigned drive letter (e.g., E:).
    3. Ensure the USB drive is not connected, or ensure another device is occupying drive letter E:.
    4. Launch VeraCrypt and attempt to mount the Favorite Volume.
    5. Observe the "Drive letter not available" error loop.
    6. While the error loop is active, physically disconnect the USB drive.
    7. Observe the application crash/exception and subsequent termination.

    Expected Behavior:

    • If a drive letter is unavailable, VeraCrypt should display the error once and allow the user to dismiss it or choose a different action without entering an infinite loop.
    • Removing a USB drive should not cause the application to crash or terminate unexpectedly.

    System Information:

    • VeraCrypt Version: 1.26.29
    • OS: Windows 11 25H2
     
  • Mounir IDRASSI

    Mounir IDRASSI - 4 days ago

    Thank you for the detailed report, Marcos.

    I analyzed the Windows favorite volume mount-on-arrival path and I can confirm there are bugs here. When a favorite has a fixed drive letter that is already occupied by a normal Windows device, VeraCrypt can currently report “Drive letter not available” as a generic mount failure. The arrival scan then retries the same favorite, which explains the repeated dialog.

    The crash on USB removal is also plausible from the code path: while the modal error dialog is pen, Windows device change notifications can reload the favorite volume list while the arrival scan is still iterating it. I also found a separate typo in the device removal handler that can corrupt a pointer in some removal scenarios. These will be fixed.

    For now, the safest workarounds are to assign this favorite a drive letter that Windows will not reuse for another device, or disable "Mount selected volume when its host device gets connected" and mount it manually. If the error dialog appears, avoid unplugging the USB while the dialog is still open.

    Could you also confirm whether "Mount selected volume when its host device gets connected" is enabled for this favorite? If possible, please share a sanitized copy of your Favorite Volumes XML and the Windows Event Viewer "Application Error" entry for VeraCrypt.exe, especially the faulting module and offset. That will help confirm the exact crash location.

     
  • Marcos Morar

    Marcos Morar - 3 days ago

    Yes, I am using "Mount selected volume when its host device gets connected." I have been using this feature for ages, and it has only caused problems in the current version. The Favorite Volumes XML file is attached, but the crash did not generate any Application Error entry for VeraCrypt in the Windows Event Viewer.

     
  • Mounir IDRASSI

    Mounir IDRASSI - 2 days ago

    Thank you for the confirmation and for the XML file. It confirms the issue is in the mount-on-arrival path: the favorite is pinned to E:\ and stored as a Windows Volume GUID path with mountOnArrival enabled.

    This matches the bug I found. If Windows assigns E: to another device first, VeraCrypt 1.26.29 can report the unavailable drive letter as a generic mount failure, so the arrival scan retries and the dialog loops. The crash on USB removal is also consistent with the same path, because device-change notifications can reload the favorites list while the scan is still active.

    I have committed a fix for this: https://sourceforge.net/p/veracrypt/code/ci/c98f07b40c9415cd32c4516d29e47bd3a5e269e6/. It detects the occupied drive letter before attempting the mount, avoids the modal error dialog in the arrival scan, parks the favorite instead of retrying it, and hardens the scan against favorites-list reloads during device changes. I also fixed a separate pointer typo in the device-removal handler.

    The absence of an Event Viewer Application Error entry is not blocking; the XML was enough to confirm the relevant code path. Thanks again for the detailed report.

     
    ❤️
    1
    👍
    1

Log in to post a comment.

Auth0 Logo