libjxl: 0.11.0: build fails with cmake 3.30.3

Describe the bug Looks like build fails with cmake 3.30.3. Quite possible that it could be cmake issue.

To Reproduce Build with build cmake 3.30.3 installed.

Expected behavior Build should not fail.

Screenshots

[ 58%] Linking CXX executable tests/gain_map_test
cd /home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/x86_64-redhat-linux-gnu/lib && /usr/bin/cmake -E cmake_link_script CMakeFiles/gain_map_test.dir/link.txt --verbose=1
/usr/bin/g++ -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -grecord-gcc-switches -pipe -mtls-dialect=gnu2 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdata-sections -ffunction-sections -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -flto=auto -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -Wall -Werror=format-security -fno-rtti -fno-exceptions -fno-rtti -O2 -g -DNDEBUG -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--gc-sections -Wl,--as-needed -Wl,--build-id=sha1 -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-z,pack-relative-relocs -flto=auto -fuse-linker-plugin -fPIE -pie CMakeFiles/gain_map_test.dir/extras/gain_map_test.cc.o -o tests/gain_map_test  -Wl,-rpath,/home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/x86_64-redhat-linux-gnu/lib libjxl_testlib-internal.a libjxl_extras-internal.a /usr/lib64/libgtest_main.so.1.14.0 /usr/lib64/libgtest.so.1.14.0 libjxl-internal.a /usr/lib64/libhwy.so /usr/lib64/libbrotlidec.so /usr/lib64/libbrotlicommon.so /usr/lib64/libbrotlienc.so libjxl_cms.so.0.11.0 /usr/lib64/libtcmalloc_minimal.so libjxl_threads.so.0.11.0 /usr/lib64/libgif.so /usr/lib64/libjpeg.so /usr/lib64/libpng.so /usr/lib64/libOpenEXR-3_2.so /usr/lib64/libOpenEXRUtil-3_2.so /usr/lib64/libOpenEXRCore-3_2.so /usr/lib64/libIex-3_2.so /usr/lib64/libIlmThread-3_2.so /usr/lib64/libImath-3_1.so
cd /home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/x86_64-redhat-linux-gnu/lib && /usr/bin/cmake -D TEST_TARGET=gain_map_test -D TEST_EXECUTABLE=/home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/x86_64-redhat-linux-gnu/lib/tests/gain_map_test -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/x86_64-redhat-linux-gnu/lib -D TEST_EXTRA_ARGS= -D TEST_PROPERTIES= -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=gain_map_test_TESTS -D CTEST_FILE=/home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/x86_64-redhat-linux-gnu/lib/gain_map_test[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=240 -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
ReadTestData /home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/testdata/external/Compact-ICC-Profiles/profiles/scRGB-v2.icc
CMake Error at /usr/share/cmake/Modules/GoogleTestAddTests.cmake:112 (message):
  Error running test executable.

    Path: '/home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/x86_64-redhat-linux-gnu/lib/tests/gain_map_test'
    Working directory: '/home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/x86_64-redhat-linux-gnu/lib'
    Result: Illegal instruction
    Output:


Call Stack (most recent call first):
  /usr/share/cmake/Modules/GoogleTestAddTests.cmake:226 (gtest_discover_tests_impl)


make[2]: *** [lib/CMakeFiles/gain_map_test.dir/build.make:122: lib/tests/gain_map_test] Error 1
make[2]: *** Deleting file 'lib/tests/gain_map_test'

Environment

  • OS: Linux x86/64
  • Compiler version: gcc 14.2.1
  • CPU type: x86_64

Additional context N/A

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

The crash in the test is reproducable here with both gcc 14.2.0 and clang 19.1.4 – on x86_64, gain_map_test produces a SIGILL, on aarch64, it produces a SIGTRAP instead

As a workaround, are you able to build it with clang instead of gcc?

export CC=clang CXX=clang++
cmake .....

Some other info that might be useful to the developers when they get to look at this:

  • Can you share the command(s) you use for your build? (cmake options, etc.)
  • If you run gain_map_test directly, it should show which test is crashing:
Successful run
$ ./gain_map_test 
Running main() from /usr/src/debug/gtest/googletest-1.15.2/googletest/src/gtest_main.cc
ReadTestData /home/user/build/libjxl/src/libjxl/testdata/external/Compact-ICC-Profiles/profiles/scRGB-v2.icc
Test data external/Compact-ICC-Profiles/profiles/scRGB-v2.icc is 372 bytes long.
ReadTestData /home/user/build/libjxl/src/libjxl/testdata/external/Compact-ICC-Profiles/profiles/scRGB-v2.icc
Test data external/Compact-ICC-Profiles/profiles/scRGB-v2.icc is 372 bytes long.
[==========] Running 4 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 4 tests from GainMapTestCases/GainMapTest
[ RUN      ] GainMapTestCases/GainMapTest.GainMapRoundtrip/HasColorEncoding1ICCSize0
ReadTestData /home/user/build/libjxl/src/libjxl/testdata/external/Compact-ICC-Profiles/profiles/scRGB-v2.icc
Test data external/Compact-ICC-Profiles/profiles/scRGB-v2.icc is 372 bytes long.
[       OK ] GainMapTestCases/GainMapTest.GainMapRoundtrip/HasColorEncoding1ICCSize0 (0 ms)
[ RUN      ] GainMapTestCases/GainMapTest.GainMapRoundtrip/HasColorEncoding1ICCSize136
ReadTestData /home/user/build/libjxl/src/libjxl/testdata/external/Compact-ICC-Profiles/profiles/scRGB-v2.icc
Test data external/Compact-ICC-Profiles/profiles/scRGB-v2.icc is 372 bytes long.
[       OK ] GainMapTestCases/GainMapTest.GainMapRoundtrip/HasColorEncoding1ICCSize136 (0 ms)
[ RUN      ] GainMapTestCases/GainMapTest.GainMapRoundtrip/HasColorEncoding0ICCSize136
ReadTestData /home/user/build/libjxl/src/libjxl/testdata/external/Compact-ICC-Profiles/profiles/scRGB-v2.icc
Test data external/Compact-ICC-Profiles/profiles/scRGB-v2.icc is 372 bytes long.
[       OK ] GainMapTestCases/GainMapTest.GainMapRoundtrip/HasColorEncoding0ICCSize136 (0 ms)
[ RUN      ] GainMapTestCases/GainMapTest.GainMapRoundtrip/HasColorEncoding0ICCSize0
ReadTestData /home/user/build/libjxl/src/libjxl/testdata/external/Compact-ICC-Profiles/profiles/scRGB-v2.icc
Test data external/Compact-ICC-Profiles/profiles/scRGB-v2.icc is 372 bytes long.
[       OK ] GainMapTestCases/GainMapTest.GainMapRoundtrip/HasColorEncoding0ICCSize0 (0 ms)
[----------] 4 tests from GainMapTestCases/GainMapTest (1 ms total)

[----------] Global test environment tear-down
[==========] 4 tests from 1 test suite ran. (1 ms total)
[  PASSED  ] 4 tests.
  • If you run gain_map_test under gdb, it might show exactly where in the code it’s crashing:

e.g.

gdb /home/tkloczko/rpmbuild/BUILD/libjxl-0.11.0/x86_64-redhat-linux-gnu/lib/tests/gain_map_test
...
(gdb) run
...
(gdb) bt