Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ordering regression for VK_INSTANCE_LAYERS #1170

Conversation

charles-lunarg
Copy link
Collaborator

@charles-lunarg charles-lunarg commented Apr 5, 2023

The commit to add VK_LOADER_LAYERS_ENABLE/DISABLE inadvertently broke the ordering guarantees of VK_INSTANCE_LAYERS. This commit restores that order. If both VK_INSTANCE_LAYERS and VK_LOADER_LAYERS_ENABLE add layers, the order will be VK_INSTANCE_LAYERS enabled layers, in the order specified by the env-var, followed by any layers enabled by VK_LOADER_LAYERS_ENABLED enabled in the order they are found on the system.

In addition to this, the test framework receieved two changes:

  • Make env-var folders report their contents in a deterministic order (aka the order the items were added to the framework). This mirrors existing behavior for redirected folders.
  • Make platform shim resilient to shutdown ordering issues. Namely, set a flag during shutdown so that any interception functions go straight to the real version of the functoin. This works around an issue during the destruction of the FolderManagers for the environment variables, where the readdir shim function was trying to use the FolderManager's data but Address Sanitizer declared that such a use was 'heap use after free'.

Fixes #1168

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 50980.

1 similar comment
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 50980.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 1886 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 1886 failed.

The commit to add VK_LOADER_LAYERS_ENABLE/DISABLE inadvertently broke the
ordering guarantees of VK_INSTANCE_LAYERS. This commit restores that order.
If both VK_INSTANCE_LAYERS and VK_LOADER_LAYERS_ENABLE add layers, the order
will be VK_INSTANCE_LAYERS enabled layers, in the order specified by the
env-var, followed by any layers enabled by VK_LOADER_LAYERS_ENABLED enabled in
the order they are found on the system.

In addition to this, the test framework receieved two changes:
* Make env-var folders report their contents in a deterministic order (aka the
order the items were added to the framework). This mirrors existing behavior
for redirected folders.
* Make platform shim resilient to shutdown ordering issues. Namely, set a flag
during shutdown so that any interception functions go straight to the real
version of the functoin. This works around an issue during the destruction of
the FolderManagers for the environment variables, where the readdir shim
function was trying to use the FolderManager's data but Address Sanitizer
declared that such a use was 'heap use after free'.
* Rename set_path to set_fake_path to better indicate its purpose
@charles-lunarg charles-lunarg force-pushed the fix_env_var_ordering_regression branch from 1fdd8c6 to 5617210 Compare April 5, 2023 20:33
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 51571.

1 similar comment
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 51571.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 1887 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 1887 passed.

@charles-lunarg
Copy link
Collaborator Author

Fixed the compilation issue on Windows, would appreciate a review since this is holding up VVL due to lack of order of VK_INSTANCE_LAYERS.

@charles-lunarg
Copy link
Collaborator Author

So the CI runs that failed are the now removed Ubuntu 18 runners...
That means the jobs that did run succeeded, meaning I can merge this and work on fixing the CI script in a future PR.

@charles-lunarg charles-lunarg merged commit 50df6bc into KhronosGroup:main Apr 6, 2023
@charles-lunarg charles-lunarg deleted the fix_env_var_ordering_regression branch April 6, 2023 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: VK_INSTANCE_LAYERS is not respecting the layer order
3 participants