Details
-
Bug
-
Resolution: Duplicate
-
P1: Critical
-
None
-
5.15.11
-
None
Description
AVX2-specific code in 'qtbase/src/gui/painting/qdrawhelper.cpp' (and possibly elsewhere) relies on additional CPU feature support checks using calls to qCpuHasFeature(ArchHaswell).
When running under VirtualBox, this function returns false. This is likely expected and correct behaviour, since VirtualBox doesn't fully support all AVX2-expected features to the guest: specifically FMA3 and F16C instructions.
However, as a result certain codepaths are skipped completely. Amongst undoubtedly causing a number of other issues, this results in no value being set for the qt_memfill32() function pointer. On first use of this function, which is previously set to nullptr, it naturally SIGSEGVs. This probably has other impacts on downstream code, but most notably, crashes KDE Plasmashell on startup.
To fix this, QtBase must do the following;
- Improve the logic in certain functions which call qCpuHasFeature(ArchHaswell) to be made more robust to respond to the chance that this test may fail, indicating an incomplete support for AVX2 features.
- Use finer-grained tested for AVX2 features as required in the code.. i.e. check where and whether dependencies on FMA3 and F16C instructions are really needed.
This only affects QtBase if built with CPU specific optimisations (i.e. with --march=native in CFLAGS/CXXFLAGS on CPUs that support AVX2), when running under VirtualBox, so it's not surprising this bug was not discovered until now.
Attachments
Issue Links
- duplicates
-
QTBUG-113315 Segmentation fault in a VirtualBox Linux guest with -march=native
- Closed