Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.2
-
None
-
Gentoo
glibc 2.33
cmake 3.20.2
gcc 11.1.0
-
-
c4b5e84e9e112fab25301f80806e8c66f418594f (qt/qtbase/dev) 2f82546d4bb79cf501cbbad39866d902aa2a337d (qt/qtbase/6.1)
Description
I have configured the Qt build with -cmake-generator "Unix Makefiles". Building with ninja works fine. The issue doesn't happen with Qt 6.0.0.
To reproduce it I start the build with:
cmake --build . --target qtbase
If I cancel it I get:
[ 32%] Running automoc with --collect-json
^C^Cgmake[3]: *** Deleting file 'qtbase/src/concurrent/meta_types/qt6concurrent_release_metatypes.json.gen'
gmake[3]: *** [qtbase/src/concurrent/CMakeFiles/Concurrent.dir/build.make:75: qtbase/src/concurrent/meta_types/qt6concurrent_release_metatypes.json.gen] Interrupt
gmake[2]: *** [CMakeFiles/Makefile2:9741: qtbase/src/concurrent/CMakeFiles/Concurrent.dir/all] Interrupt
gmake[1]: *** [CMakeFiles/Makefile2:7982: qtbase/CMakeFiles/qtbase.dir/rule] Interrupt
gmake: *** [Makefile:179: qtbase] Interrupt
I copied the moc command from the generated makefile, ran it manually and cancelled it to get a backtrace:
#0 0x00007ffff7a9478e in read () from /lib64/libc.so.6 #1 0x00007ffff7a287cc in _IO_file_underflow () from /lib64/libc.so.6 #2 0x00007ffff7a29a22 in _IO_default_uflow () from /lib64/libc.so.6 #3 0x00005555556c5bba in QFSFileEnginePrivate::nativeRead(char*, long long) () #4 0x0000555555659e0f in QFileDevice::readData(char*, long long) () #5 0x0000555555661ee4 in QIODevicePrivate::read(char*, long long, bool) () #6 0x00005555556628c6 in QIODevice::readAll() () #7 0x0000555555604a26 in readFromDevice(QIODevice*, QJsonArray*) () #8 0x0000555555604e51 in collectJson(QList<QString> const&, QString const&) () #9 0x0000555555620ffb in runMoc(int, char**) () #10 0x00007ffff79cf7fd in __libc_start_main () from /lib64/libc.so.6 #11 0x000055555560492a in _start ()
It seems the moc command doesn't pass any input file so
- device size() returns 0 in readFromDevice() in these cases.
- moc is waiting for input on stdin.
I assume the cmake pass input files to moc with ninja build and that's why it is makefile specific but this also seems to be a QIODevice issue because I don't think it should stall if it can't read.