Details
-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
5.15.2
-
None
-
Debian testing, linux 5.10.12-1, X11, running at AMD Ryzen 1700 cpu
Description
Function detectProcessorFeatures calls checkRdrndWorks which executes a few rdrand instructions and just later the environment QT_NO_CPU_FEATURE=rdrnd gets examined and the feature disabled.
Background was recording a Qt application with rr-debugger at a debian testing, running at AMD Ryzen 1700 cpu. That cpu lacks the facility "CPUID faulting", therefore rr-debugger uses that environment to disable rdrand instructions. There was a misuse of rdrand / rdrnd which got fixed in rr-debugger now making it unlikely for rr to fail because of these few instructions. rr-bug
But if Qt developers want to have no rdrand instructions at all executed with this environment variable set, this might be achieved by moving the call to checkRdrndWorks after the environment variable check like in attached (and just little tested) patch against debians Qt 5.15.2.
I have not tested, but Qt6 sources seem to show the same situation, the files got just moved from src/corelib/tools/qsimd.cpp to src/corelib/global/qsimd.cpp.