google / oss-fuzz

OSS-Fuzz - continuous fuzzing for open source software.
https://google.github.io/oss-fuzz
Apache License 2.0
10.12k stars 2.15k forks source link

kimageformats: Use latest builder #12097

Closed maflcko closed 1 week ago

github-actions[bot] commented 1 week ago

maflcko has previously contributed to projects/kimageformats. The previous PR was #11714

maflcko commented 1 week ago

cc @novomesk @tsdgeos

tsdgeos commented 1 week ago

Why is that extra lib needed?

maflcko commented 1 week ago

The error is:

+ clang++ -O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libc++ -fPIC -DHANDLER=QJpegXLHandler -std=c++17 /src/kimgio_fuzzer.cc /src/kimageformats/src/imageformats/jxl.cpp /src/kimageformats/src/imageformats/scanlineconverter.cpp -o /out/kimgio_jxl_fuzzer -DJXL_STATIC_DEFINE -DJXL_THREADS_STATIC_DEFINE -DJXL_CMS_STATIC_DEFINE -I /src/qtbase/include/QtCore/ -I /src/qtbase/include/ -I /src/qtbase/include//QtGui -I /src/kimageformats/src/imageformats/ -I /src/karchive/src/ -I /src/qtbase/mkspecs/linux-clang-libc++/ -I /src/libavif/include/ -I /src/libjxl/build/lib/include/ -I /src/libjxl/lib/include/ -I /usr/local/include/OpenEXR/ -I /usr/local/include/Imath -I . -L /src/qtbase/lib /src/libavif/build/libavif.a /usr/local/lib/libheif.a /usr/local/lib/libde265.a /src/aom/build.libavif/libaom.a /src/libjxl/build/lib/libjxl_threads.a /src/libjxl/build/lib/libjxl.a /src/libjxl/build/lib/libjxl_cms.a /src/libjxl/build/third_party/highway/libhwy.a /src/libjxl/build/third_party/brotli/libbrotlidec.a /src/libjxl/build/third_party/brotli/libbrotlienc.a /src/libjxl/build/third_party/brotli/libbrotlicommon.a -lQt5Gui -lQt5Core -lqtlibpng -lqtharfbuzz -lm -lqtpcre2 -ldl -lpthread -fsanitize=fuzzer /usr/local/lib/libzip.a /usr/local/lib/libz.a -lKF5Archive /usr/local/lib/libz.a /usr/local/lib/libraw.a /usr/local/lib/libOpenEXR-3_2.a /usr/local/lib/libIex-3_2.a /usr/local/lib/libImath-3_1.a /usr/local/lib/libIlmThread-3_2.a /usr/local/lib/libOpenEXRCore-3_2.a /usr/local/lib/libOpenEXRUtil-3_2.a /usr/local/lib/libopenjp2.a
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
/src/libjxl/build/lib/libjxl.a(dec_external_image.cc.o): in function `jxl::N_SCALAR::FloatToF16(float const*, hwy::float16_t*, unsigned long)':
dec_external_image.cc:(.text._ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm[_ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm]+0x9d): undefined reference to `__truncsfhf2'
/usr/bin/ld: dec_external_image.cc:(.text._ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm[_ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm]+0xe8): undefined reference to `__truncsfhf2'
/usr/bin/ld: dec_external_image.cc:(.text._ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm[_ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm]+0x138): undefined reference to `__truncsfhf2'
/usr/bin/ld: dec_external_image.cc:(.text._ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm[_ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm]+0x188): undefined reference to `__truncsfhf2'
/usr/bin/ld: dec_external_image.cc:(.text._ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm[_ZN3jxl8N_SCALAR10FloatToF16EPKfPN3hwy9float16_tEm]+0x2dd): undefined reference to `__truncsfhf2'
/usr/bin/ld: /src/libjxl/build/lib/libjxl.a(dec_external_image.cc.o):dec_external_image.cc:(.text._ZN3jxl10ThreadPool12RunCallStateIZNS_25ConvertChannelsToExternalEPPKNS_5PlaneIfEEmmb13JxlEndiannessmPS0_PvmRKNS_13PixelCallbackENS_11OrientationEE3$_2ZNS_25ConvertChannelsToExternalES6_mmbS7_mS8_S9_mSC_SD_E3$_3E12CallDataFuncES9_jm[_ZN3jxl10ThreadPool12RunCallStateIZNS_25ConvertChannelsToExternalEPPKNS_5PlaneIfEEmmb13JxlEndiannessmPS0_PvmRKNS_13PixelCallbackENS_11OrientationEE3$_2ZNS_25ConvertChannelsToExternalES6_mmbS7_mS8_S9_mSC_SD_E3$_3E12CallDataFuncES9_jm]+0x6ee): more undefined references to `__truncsfhf2' follow
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR:__main__:Building fuzzers failed.

The symbol is a built-in, so the library needs to be included. See also https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/builtins/truncsfhf2.c

jonathanmetzman commented 1 week ago

@tsdgeos do you approve?

jonathanmetzman commented 1 week ago

@tsdgeos do you approve?

tsdgeos commented 1 week ago

My concern is "how am i supposed to know to do that"?

I´d be happier if it was a $VARIABLE that one is supposed to use for linking and here we aren´t , do you know if it that exists?

If not i guess we can go ahead.

maflcko commented 1 week ago

I´d be happier if it was a $VARIABLE that one is supposed to use for linking and here we aren´t , do you know if it that exists?

My understanding is that this is normally not needed to be specified manually. I do not yet understand why it is needed here, so if you want I can mark it as "temporary linker workaround" for this project specifically, so that someone can look into it in the future?

tsdgeos commented 1 week ago

I´d be happier if it was a $VARIABLE that one is supposed to use for linking and here we aren´t , do you know if it that exists?

My understanding is that this is normally not needed to be specified manually. I do not yet understand why it is needed here, so if you want I can mark it as "temporary linker workaround" for this project specifically, so that someone can look into it in the future?

Yes please, let's do that :)

maflcko commented 1 week ago

Thanks, done. Please approve if it looks ok.

tsdgeos commented 1 week ago

Looks good to me.

Please merge :)