-
Notifications
You must be signed in to change notification settings - Fork 401
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
possible Android memory corruption in validation or SPIRV used by validation #8439
Comments
For reference, original chat is: https://chat.google.com/room/AAAAOXVAYGg/FL0Vh98x-gM/FL0Vh98x-gM?cls=10 |
This is 99% because |
I was working on a minimal repro case and got it down to this, note that I'm not even creating a Vulkan instance:
Weird thing is that if I add the same test to the SPIRV-Tools unit tests, it works fine! Same SPIRV-Tools commit, same CMake flags, same NDK. |
Do the SPIRV-Tools unit tests also run on Android? |
By default, SPIRV-Tools tests do not run on Android. I was able to run them by commenting out these lines: https://github.com/KhronosGroup/SPIRV-Tools/blob/main/CMakeLists.txt#L315-L317 and then manually pushing and running the test executable using the adb shell. |
Weird...
I presume the crash occurs in Since it works in SPIRV-Tools unit tests, do you have an hypothesis as to why it fails deterministically in VVL? I've got nothing... |
Yes and yes. And just like your initial writup, this only affects the Debug build. Release builds make it past the the
No real hypothesis yet. The fact that the test code works in one build (SPIRV-Tools) and not the other (VVL) makes me suspect something about how we build/package libSPIRV-Tools |
Similar issue: KhronosGroup/glslang#3534 That reporter traced it back to a specific constructor for std::vector and patched around it by constructing the vector using a different method |
Environment:
Describe the Issue
When building and testing a
Debug
build using Android NDK 26.3, tests crash on all devices in the same place inVkArmBestPracticesLayerTest.ComputeShaderBadSpatialLocalityTest
, inside an allocator within SPIRV-Tools:The full
ndk-stack
output is available:008-ndk-stack-info.txt
The crash appears when using a
Debug
build with Android NDK 26.3. It does not appear when using aRelease
build with NDK 26.3, nor (using either aRelease
or aDebug
build) with either NDK 25.2 or NDK 27.0.Given that the code appears to run correctly in a
Release
build, that the crash is device-independent, and that the crash occurs during memory allocation, it's fairly likely that the compiler isn't the issue, and that that something in validation or SPIRV is causing memory corruption that happens to cause a validation crash when memory is laid out "just right". If Address Sanitizer is supported on Android, it might be helpful in uncovering such a corruption.It's possible, though IMHO unlikely, that this is an unknown compiler bug that appeared in NDK 26 and disappeared in NDK 27, as symptoms like this are not listed as known issues: https://github.com/android/ndk/releases
To reproduce the problem, run a manual-Vulkan-ValidationLayers build with: http://tcubuser.lunarg.localdomain:8080/view/Manual/job/manual-Vulkan-ValidationLayers/build
BUILD_MODE
:Debug
ANDROID_ARGS
:--android-ndk 26.3
NODE
:tcubuand1
The text was updated successfully, but these errors were encountered: