github / github/codeql

codeql stuck for 30+ minutes during FindHDF5.cmake execution

Abierto
#16,051 3 comentarios 0 reacciones 0 asignados Ver en GitHub
C++ question
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

On a Ubuntu 20.04 host with the following CMakeLists.txt:
```
cmake_minimum_required(VERSION 3.16)
project(gdal LANGUAGES C CXX)
find_package(HDF5 COMPONENTS C CXX)
```
and package libhdf5-dev installed

running "cmake .." takes more than half an hour

Verbose output:
```
$ cmake .. --debug-output
Running with debug output on.
-- The C compiler identification is GNU 9.4.0
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerId.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- The CXX compiler identification is GNU 9.4.0
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerId.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Check for working C compiler: /usr/bin/cc
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeTestCompilerCommon.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Check for working C compiler: /usr/bin/cc -- works
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeTestCompilerCommon.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Detecting C compiler ABI info
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerABI.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Detecting C compiler ABI info - done
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerABI.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Detecting C compile features
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompileFeatures.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Detecting C compile features - done
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompileFeatures.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Check for working CXX compiler: /usr/bin/c++
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeTestCompilerCommon.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Check for working CXX compiler: /usr/bin/c++ -- works
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeTestCompilerCommon.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Detecting CXX compiler ABI info
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerABI.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Detecting CXX compiler ABI info - done
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompilerABI.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Detecting CXX compile features
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompileFeatures.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- Detecting CXX compile features - done
Called from: [3] /usr/share/cmake-3.16/Modules/CMakeDetermineCompileFeatures.cmake
[2] /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
Called from: [2] /usr/share/cmake-3.16/Modules/FindHDF5.cmake
[1] /home/even/gdal/gdal/build_cmake/tmptmphdf5/CMakeLists.txt
```

Relevant processes that take ages to complete:
```
even 3102981 3694545 1 02:30 pts/8 00:00:00 cmake .. --debug-output
even 3103156 3102981 0 02:30 pts/8 00:00:00 /bin/sh /usr/bin/h5c++ -show -shlib /home/even/gdal/gdal/build_cmake/tmptmphdf5/build/CMakeFiles/hdf5/cmake_hdf5_test.cxx
even 3103177 3103156 11 02:30 pts/8 00:00:01 /home/even/gdal/gdal/build_cmake/codeql/cpp/tools/linux64/extractor --mimic /usr/bin/h5c++ -show -shlib /home/even/gdal/gdal/build_cmake/tmptmphdf5/bui
even 3103178 3103177 0 02:30 pts/8 00:00:00 /bin/sh /usr/bin/h5c++ -x c++ -v -fsyntax-only /home/even/gdal/gdal/build_cmake/codeql_databases/cpp/working/tmp//semmle_1_3103177_195397
even 3103179 3103178 0 02:30 pts/8 00:00:00 /bin/sh /usr/bin/h5c++ -x c++ -v -fsyntax-only /home/even/gdal/gdal/build_cmake/codeql_databases/cpp/working/tmp//semmle_1_3103177_195397
even 3103198 3103179 0 02:30 pts/8 00:00:00 g++ -I/usr/include/hdf5/serial -x c++ -v -fsyntax-only /home/even/gdal/gdal/build_cmake/codeql_databases/cpp/working/tmp//semmle_1_3103177_195397 -L/us
even 3103199 3103198 0 02:30 pts/8 00:00:00 g++ -I/usr/include/hdf5/serial -x c++ -v -fsyntax-only /home/even/gdal/gdal/build_cmake/codeql_databases/cpp/working/tmp//semmle_1_3103177_195397 -L/us
even 3103224 3103199 0 02:30 pts/8 00:00:00 /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -I /usr/include/hdf5/serial -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/lib/x86_64-linux-gnu/hdf5
even 3103225 3103224 0 02:30 pts/8 00:00:00 /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus -quiet -v -I /usr/include/hdf5/serial -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/lib/x86_64-linux-gnu/hdf5
```

(originally diagnosed in https://github.com/OSGeo/gdal/issues/9549)

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start with the FindHDF5.cmake invocation that runs the h5c++ compiler wrapper, using the supplied CMakeLists.txt on Ubuntu 20.04 as the reproduction. Inspect the CodeQL C++ extractor process and its compiler-wrapper command shown in the report. Done means cmake completes the HDF5 detection without remaining stuck for more than 30 minutes.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cmake, cpp
Área
build-system, devtools
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.