Skip to content

[Bug] Windows Reparse Point (Junction/Symlink) causes ZIP extraction failure & fatal EXCEPTION_UNCAUGHT_CXX_EXCEPTION (Regression since 0.1.4) #237

@AzusaKe

Description

@AzusaKe

Describe the bug

When launching the game with Radiance on Windows, the Vulkan renderer crashes completely if the game directory involves a Windows Reparse Point (specifically a Directory Junction /J or Symbolic Link /D).

After rigorous cross-platform and environment testing, I have identified that the crash consists of two parts: a primary I/O failure and a secondary unsafe shutdown sequence.

The Crash Sequence & Root Cause:

  1. The I/O Failure: The C++ core.dll fails to handle Windows Reparse Points during path traversal or directory creation. When it attempts to extract vanilla-pt.zip / advanced.zip (or internal.zip in 0.1.4) into a path containing a Symlink/Junction, it throws an extraction error (e.g., -107 or Failed to load shared shader pack).
  2. The Unsafe atexit() Cleanup: Because the extraction fails, the C++ code executes an unsafe exit/abort. The Vulkan layer static memory is destroyed, but the code then attempts to destroy the VkDevice during the atexit() phase, triggering the fatal EXCEPTION_UNCAUGHT_CXX_EXCEPTION (0xe06d7363) in RendererProxy.present().

Vulkan Validation Layer Proof:

VALIDATION ERROR - The VkDevice dispatch handle was not found and Validation will crash. If you are using exit() you need to make sure to not call any Vulkan calls in your atexit() function as the layer static memory will be destroyed prior to atexit()

Workaround / Verification:
If I move the .minecraft folder to a direct physical path (e.g., E:\.minecraft) without using mklink, the ZIP files extract successfully and the game runs perfectly.

How to Fix (Suggestions)

  1. Path Handling: Ensure the C++ I/O library correctly resolves Windows Reparse Points (e.g., checking for FILE_ATTRIBUTE_REPARSE_POINT properly or using std::filesystem::canonical safely on Windows).
  2. Lifecycle Management: Catch the extraction error gracefully instead of exiting abruptly, or ensure VkDevice is validated before being destroyed in the atexit() hook.

Version Tracking (Regression)

  • 0.1.0 ~ 0.1.3: Works perfectly, even with Symlinks/Junctions.
  • 0.1.4 alpha: The game silently crashes/hangs during initialization (the Symlink I/O bug was introduced here).
  • 0.1.5 alpha: The crash is no longer silent and throws the explicit hs_err_pid native error due to the atexit() device cleanup sequence.

To Reproduce

  1. Use Windows cmd to create a Directory Junction for your game directory (e.g., mklink /J C:\Users\User\AppData\Roaming\.minecraft E:\.minecraft).
  2. Install Radiance 0.1.5 alpha.
  3. Launch the game. It will fail to extract the ZIP and instantly crash the JVM.

Environment

  • OS: Windows 11 (Build 26100)
  • CPU/GPU: Intel Core i9-14900HX / NVIDIA RTX 4060 Laptop GPU
  • Java: Zulu OpenJDK 21.0.11
  • Minecraft: 1.21.4 (Fabric 0.19.2)
  • Mod Version: 0.1.4 alpha & 0.1.5 alpha

Crash Report / Logs

hs_err_pid.log
output_with_validation_layers.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions