[Development] INTEGRITY help needed: IPC & QT_CONFIG weirdness

Thiago Macieira thiago.macieira at intel.com
Sat Nov 5 19:35:15 CET 2022

TL;DR: Please propose a patch by end of week to fix the INTEGRITY error from 

I have a 34-patch series refactoring a lot of the IPC mechanisms in Qt, in 
particular QSharedMemory and QSystemSemaphore. It starts here:


and I'm not even done creating content. The big advantage of this patch set is 
to enable BOTH SystemV and POSIX at the same time on Unix systems, which is 
impotant for macOS so the same build of Qt can be used for regular 
applications and those distributed via the App Store.

My issue is that INTEGRITY isn't cooperating. I've already fixed a number of 
WASM problems by running the CI, but now I'm stumped. I need someone to figure 
out what went wrong.

I've been using https://codereview.qt-project.org/c/qt/qtbase/+/437953 as a 
squashed commit of all the content so I can push it through the CI and get 
results. In the last run

the build log said:
 -- Performing Test HAVE_sysv_shm
 -- Performing Test HAVE_sysv_shm - Failed
 -- Performing Test HAVE_sysv_sem
 -- Performing Test HAVE_sysv_sem - Failed
 -- Performing Test HAVE_posix_shm
 -- Performing Test HAVE_posix_shm - Failed
 -- Performing Test HAVE_posix_sem
 -- Performing Test HAVE_posix_sem - Success

So this means it enabled one of the backends for QSystemSemaphore, like WASM. 
Now, I have no clue whether the APIs *work* at runtime, but that's not 
important. The code can deal with that -- I developed it because posix_sem is 
also Success with MinGW, but the APIs always fail at runtime.

But unlike WASM and MinGW, the build fails:

 "/home/qt/work/qt/qtbase/src/corelib/ipc/qsystemsemaphore_posix.cpp", line 
14: warning #193-D: zero used for undefined preprocessing identifier ""
   #if QT_CONFIG(posix_sem)
 "/home/qt/work/qt/qtbase/src/corelib/ipc/qsystemsemaphore_posix.cpp", line 
14: error #39: division by zero
   #if QT_CONFIG(posix_sem)

QT_CONFIG is defined in such a way that if you used a configure name that isn't 
known, you get a division by zero:

#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)

This tells us we QT_FEATURE_posix_sem isn't defined. Why?
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering

More information about the Development mailing list