Skip to content

codeql stuck for 30+ minutes during FindHDF5.cmake execution #16051

@rouault

Description

@rouault

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 OSGeo/gdal#9549)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions