-
Notifications
You must be signed in to change notification settings - Fork 291
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
libMali: vkSurfaceKHR SIGSEGV invalid access to (nil) #1637
Comments
Vulkan loader versions since 1.3.296 has introduced a change that is crashing libMali. Revert the change introduced in vulkan loader The issue is tracked here KhronosGroup/Vulkan-Loader#1637
The way the Vulkan-Loader wraps VkSurfaceKHR handles means that when a surface is created by the driver, the loader must always unwrap it before calling down into the driver, because otherwise the handle being passed in is the loaders handle, not the drivers. I'm curious how commit 55bd9d6 was able to break libmali, because it merely removed struct members that were defined by a Vulkan-Loader internal header file wsi.h. Is libMali.so or libVkLayer_window_system_integration.so expecting the Vulkan-Loader VkSurfaceKHR handle, and manually dereferencing it? |
Ah, I think the confusion comes from here. The Vulkan-Loader had its own definition of the VkSurfaceKHR struct contents, which is VERY misleading. If the definition is actually coming from vk_icd.h, then that is what the loader should be using. |
Yeah, it seems I ignored the vk_icd.h because nothing in the Vulkan-Loader codebase used the VkIcdSurface parameters and therefor concluded that they were unused. From the lack of issues being created, libMali may be the only driver still using the older (ICD interface version 2 and below) method for handling surfaces, which explains why it took a while to surface. Apologies for the inconvenience and breakages. |
Describe the bug
Seg Fault at terminator_GetPhysicalDeviceSurfaceFormatsKHR() when using libMali with applications.
Environment (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
VK_LOADER_DEBUG output
DEBUG | DRIVER: Copying old device 0 into new device 0
INFO: terminator_CreateDisplayPlaneSurfaceKHR
INFO | LAYER: Inserted device layer "VK_LAYER_window_system_integration" (/etc/vulkan/implicit_layer.d/./libVkLayer_window_system_integration.so)
DRIVER | LAYER: vkCreateDevice layer callstack setup to:
DRIVER | LAYER:
DRIVER | LAYER: ||
DRIVER | LAYER:
DRIVER | LAYER: ||
LAYER: VK_LAYER_window_system_integration
LAYER: Type: Implicit
LAYER: Disable Env Var: DISABLE_WSI_LAYER
LAYER: Manifest: /etc/vulkan/implicit_layer.d/VkLayer_window_system_integration.json
LAYER: Library: /etc/vulkan/implicit_layer.d/./libVkLayer_window_system_integration.so
LAYER: ||
DRIVER | LAYER:
DRIVER | LAYER: Using "Mali-G52" with driver: "/usr/lib/libMali.so"
INFO: terminator_GetPhysicalDeviceSurfaceFormatsKHR:
00:00:083 linux/common.cpp:70 E[COMMON]: SIGSEGV @ 0x7faaff54e4 invalid access to (nil)
Additional context
This is caused due to commit 55bd9d6 . After reverting the commit 55bd9d6 the crash doesn't occur.
This maybe be because the mali driver is still expecting vkSurfaceKHR format prior to the commit. The commit is passing invalid vkSurfaceKHR format to the driver.
The text was updated successfully, but these errors were encountered: