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

Add VUID 01778 #2089

Merged
merged 2 commits into from
Aug 5, 2020
Merged

Conversation

evgenKh
Copy link
Contributor

@evgenKh evgenKh commented Aug 4, 2020

Implemented validation VUID-VkSwapchainCreateInfoKHR-imageFormat-01778.
The implied image creation parameters of the swapchain must be supported as reported by vkGetPhysicalDeviceImageFormatProperties

Also added test for this VUID. Test is running vkCreateSwapchainKHR with imageUsage and imageFormat params, that meet GetPhysicalDeviceSurfaceCapabilitiesKHR capabilities, but confirmed to fail vkGetPhysicalDeviceImageFormatProperties function. Not trying to make it fail with imageArrayLayers or imageExtent params, since I wasn't able to get right values for that in my setup.

Partially used code from #496 pull request that was adding same VUID, but hasn't been merged ever since, and outdated a bit.

In Mesa we already had several issues created which should have been avoided if this validation was present, i.e. https://gitlab.freedesktop.org/mesa/mesa/-/issues/3201 and https://gitlab.freedesktop.org/mesa/mesa/-/issues/178

Validade implied image creation parameters of VkSwapchainCreateInfoKHR:
The implied image creation parameters of the swapchain must be
supported as reported by vkGetPhysicalDeviceImageFormatProperties
Check validation of implied image creation parameters of
VkSwapchainCreateInfoKHR, by providing parameters that are confirmed
to fail vkGetPhysicalDeviceImageFormatProperties function
@CLAassistant
Copy link

CLAassistant commented Aug 4, 2020

CLA assistant check
All committers have signed the CLA.

@mark-lunarg mark-lunarg self-assigned this Aug 5, 2020
@mark-lunarg
Copy link
Contributor

Running through CI.

@mark-lunarg
Copy link
Contributor

Looks great, thanks!

@mark-lunarg mark-lunarg merged commit 7e4e8a7 into KhronosGroup:master Aug 5, 2020
@mark-lunarg
Copy link
Contributor

These two commits caused crashes on some android devices. This was missed due to a CI glitch, and these two commits have been temporarily reverted until we can get this sorted out. Sorry for the churn.

@evgenKh
Copy link
Contributor Author

evgenKh commented Aug 6, 2020

Oh thanks for the info. Could you please share details of crash, when you'll have them?

@mark-lunarg
Copy link
Contributor

@evgenKh, determined that it is the test commit that causes the crashes, but not in your test. The test framework for Android is a bit unique as it doesn't do a complete teardown between tests. So even though this test passes nicely, some side-effect it has causes the VkBestPracticesLayerTest.TripleBufferingTest to crash on the GalaxyS10 and NexusPlayer platforms. Skipping your test avoids the crashes.

Here's the Galaxy logcat info, which looks pretty much the same as the NexusPlayer stack:

08-05 16:17:54.432 13444 13476 I VulkanLayerValidationTests: [ RUN ] VkBestPracticesLayerTest.TripleBufferingTest
08-05 16:17:54.454 13444 13476 I vulkan : Loaded layer VK_LAYER_KHRONOS_validation
08-05 16:17:54.492 5397 8238 E BufferQueueProducer: [com.example.VulkanLayerValidationTests/android.app.NativeActivity$_13444#0] connect: already connected (cur=1 req=1)
08-05 16:17:54.492 13444 13476 E vulkan : native_window_api_connect() failed: Invalid argument (-22)
08-05 16:17:54.492 13444 13476 W ValidationTest: 0xebadde09 skipped times: 0
--------- beginning of crash
08-05 16:17:54.493 13444 13476 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 13476 (Thread-6), pid 13444 (ValidationTests)
08-05 16:17:54.544 20316 20316 E crash_dump64: unknown process state: t
08-05 16:17:54.578 20316 20316 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
08-05 16:17:54.579 5588 5588 I /system/bin/tombstoned: received crash request for pid 13476
08-05 16:17:54.580 20316 20316 I crash_dump64: performing dump of process 13444 (target tid = 13476)
08-05 16:17:54.589 20316 20316 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-05 16:17:54.589 20316 20316 F DEBUG : Build fingerprint: 'samsung/beyond1ltexx/beyond1:10/QP1A.190711.020/G973FXXU3BSKO:user/release-keys'
08-05 16:17:54.589 20316 20316 F DEBUG : Revision: '26'
08-05 16:17:54.589 20316 20316 F DEBUG : ABI: 'arm64'
08-05 16:17:54.590 20316 20316 F DEBUG : Timestamp: 2020-08-05 16:17:54-0600
08-05 16:17:54.590 20316 20316 F DEBUG : pid: 13444, tid: 13476, name: Thread-6 >>> com.example.VulkanLayerValidationTests <<<
08-05 16:17:54.590 20316 20316 F DEBUG : uid: 12128
08-05 16:17:54.590 20316 20316 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
08-05 16:17:54.590 20316 20316 F DEBUG : Cause: null pointer dereference
08-05 16:17:54.590 20316 20316 F DEBUG : x0 0000007031a3e668 x1 0000000000000000 x2 000000702b1e0890 x3 000000702b1e0890
08-05 16:17:54.590 20316 20316 F DEBUG : x4 0000000000000000 x5 0000006fb46b1686 x6 0000006fd06af800 x7 0000007031bda010
08-05 16:17:54.590 20316 20316 F DEBUG : x8 0000000000000001 x9 0000000000000002 x10 0000000000000001 x11 0000000000000000
08-05 16:17:54.590 20316 20316 F DEBUG : x12 0000000000000000 x13 0000000000000000 x14 0000006fcf77ad80 x15 0000000000000001
08-05 16:17:54.590 20316 20316 F DEBUG : x16 0000006fb4b671f0 x17 00000070c2e2cae0 x18 00000000fc8ffb7d x19 0000000000000000
08-05 16:17:54.590 20316 20316 F DEBUG : x20 000000702b1e0890 x21 0000000000000000 x22 000000702b1e1020 x23 00000070c16a4098
08-05 16:17:54.590 20316 20316 F DEBUG : x24 00000070c16a1028 x25 000000702b1e1020 x26 0000006fce516d88 x27 0000000000000000
08-05 16:17:54.590 20316 20316 F DEBUG : x28 0000007031a011c8 x29 000000702b1e0730
08-05 16:17:54.590 20316 20316 F DEBUG : sp 000000702b1e06e0 lr 0000006fb4204ecc pc 00000070c1432304
08-05 16:17:54.594 20316 20316 F DEBUG :
08-05 16:17:54.594 20316 20316 F DEBUG : backtrace:
08-05 16:17:54.594 20316 20316 F DEBUG : #00 pc 000000000002d304 /system/lib64/libvulkan.so (vulkan::driver::GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice_T*, VkSurfaceKHR_T*, VkSurfaceCapabilitiesKHR*)+76) (BuildId: d569637329ba16330d390540dee0e601)
08-05 16:17:54.594 20316 20316 F DEBUG : #1 pc 00000000009c4ec8 /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVkLayer_khronos_validation.so (BuildId: a500f0fc765a4d02e9916d5e176c010affed5775)
08-05 16:17:54.594 20316 20316 F DEBUG : #2 pc 0000000000a0e7b8 /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVkLayer_khronos_validation.so (BuildId: a500f0fc765a4d02e9916d5e176c010affed5775)
08-05 16:17:54.594 20316 20316 F DEBUG : #3 pc 000000000032802c /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVulkanLayerValidationTests.so (BuildId: ea4381f514727d97cb76f3b33868c85b630534fc)
08-05 16:17:54.594 20316 20316 F DEBUG : #4 pc 00000000003dc514 /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVulkanLayerValidationTests.so (testing::Test::Run()+384) (BuildId: ea4381f514727d97cb76f3b33868c85b630534fc)
08-05 16:17:54.594 20316 20316 F DEBUG : #5 pc 00000000003dd7cc /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVulkanLayerValidationTests.so (testing::TestInfo::Run()+396) (BuildId: ea4381f514727d97cb76f3b33868c85b630534fc)
08-05 16:17:54.594 20316 20316 F DEBUG : #6 pc 00000000003ddd6c /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVulkanLayerValidationTests.so (testing::TestCase::Run()+248) (BuildId: ea4381f514727d97cb76f3b33868c85b630534fc)
08-05 16:17:54.594 20316 20316 F DEBUG : #7 pc 00000000003e6ac4 /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVulkanLayerValidationTests.so (testing::internal::UnitTestImpl::RunAllTests()+1080) (BuildId: ea4381f514727d97cb76f3b33868c85b630534fc)
08-05 16:17:54.594 20316 20316 F DEBUG : #8 pc 00000000003e6658 /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVulkanLayerValidationTests.so (testing::UnitTest::Run()+164) (BuildId: ea4381f514727d97cb76f3b33868c85b630534fc)
08-05 16:17:54.594 20316 20316 F DEBUG : #9 pc 00000000001eaa2c /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVulkanLayerValidationTests.so (BuildId: ea4381f514727d97cb76f3b33868c85b630534fc)
08-05 16:17:54.594 20316 20316 F DEBUG : #10 pc 00000000003ca5c8 /data/app/com.example.VulkanLayerValidationTests-ZaW09wSDIPzTh6dPyCGzOw==/lib/arm64/libVulkanLayerValidationTests.so (BuildId: ea4381f514727d97cb76f3b33868c85b630534fc)
08-05 16:17:54.594 20316 20316 F DEBUG : #11 pc 00000000000e3b14 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 220051b49364b1c2da3adf10c30832cc)
08-05 16:17:54.594 20316 20316 F DEBUG : #12 pc 0000000000085330 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 220051b49364b1c2da3adf10c30832cc)

@mark-lunarg
Copy link
Contributor

Found and fixed two errors: Validation was checking if (!image_properties_result) { which is false for SUCCESS. This caused false positives. In the test, the early out returns were not destroying the swapchain/surface, which corrupted the global test state. Running fixes through CI.

@mark-lunarg
Copy link
Contributor

Passed, pushed again to Master.

@evgenKh
Copy link
Contributor Author

evgenKh commented Aug 7, 2020

Big thanks for your help, @mark-lunarg !

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.

3 participants