Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.17.0: test suite is failing in encode unit #986

Closed
kloczek opened this issue Oct 15, 2023 · 17 comments
Closed

1.17.0: test suite is failing in encode unit #986

kloczek opened this issue Oct 15, 2023 · 17 comments

Comments

@kloczek
Copy link

kloczek commented Oct 15, 2023

cmake -L

`-- Cache values
BUILD_SHARED_LIBS:BOOL=ON
BUILD_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=/usr
ENABLE_MULTITHREADING_SUPPORT:BOOL=ON
ENABLE_PARALLEL_TILE_DECODING:BOOL=ON
ENABLE_PLUGIN_LOADING:BOOL=ON
FUZZING_COMPILE_OPTIONS:STRING=-fsanitize=fuzzer,address,shift,integer -fno-sanitize-recover=shift,integer
FUZZING_CXX_COMPILER:STRING=clang++
FUZZING_C_COMPILER:STRING=clang
FUZZING_LINKER_OPTIONS:STRING=
PLUGIN_DIRECTORY:STRING=/usr/lib64/libheif
WITH_AOM_DECODER:BOOL=ON
WITH_AOM_DECODER_PLUGIN:BOOL=OFF
WITH_AOM_ENCODER:BOOL=ON
WITH_AOM_ENCODER_PLUGIN:BOOL=OFF
WITH_DAV1D:BOOL=OFF
WITH_DAV1D_PLUGIN:BOOL=ON
WITH_DEFLATE_HEADER_COMPRESSION:BOOL=OFF
WITH_EXAMPLES:BOOL=ON
WITH_FFMPEG_DECODER:BOOL=OFF
WITH_FFMPEG_DECODER_PLUGIN:BOOL=OFF
WITH_FUZZERS:BOOL=OFF
WITH_GDK_PIXBUF:BOOL=ON
WITH_JPEG_DECODER:BOOL=OFF
WITH_JPEG_DECODER_PLUGIN:BOOL=OFF
WITH_JPEG_ENCODER:BOOL=OFF
WITH_JPEG_ENCODER_PLUGIN:BOOL=OFF
WITH_KVAZAAR:BOOL=OFF
WITH_KVAZAAR_PLUGIN:BOOL=OFF
WITH_LIBDE265:BOOL=ON
WITH_LIBDE265_PLUGIN:BOOL=OFF
WITH_LIBSHARPYUV:BOOL=ON
WITH_OpenJPEG_DECODER:BOOL=OFF
WITH_OpenJPEG_DECODER_PLUGIN:BOOL=ON
WITH_OpenJPEG_ENCODER:BOOL=OFF
WITH_OpenJPEG_ENCODER_PLUGIN:BOOL=ON
WITH_RAV1E:BOOL=OFF
WITH_RAV1E_PLUGIN:BOOL=ON
WITH_REDUCED_VISIBILITY:BOOL=ON
WITH_SvtEnc:BOOL=OFF
WITH_SvtEnc_PLUGIN:BOOL=ON
WITH_UNCOMPRESSED_CODEC:BOOL=ON
WITH_X265:BOOL=ON
WITH_X265_PLUGIN:BOOL=OFF

and test suite is failing

+ cd libheif-1.17.0
+ /usr/bin/ctest --test-dir x86_64-redhat-linux-gnu --output-on-failure --force-new-ctest-process -j48
Internal ctest changing into directory: /home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/x86_64-redhat-linux-gnu
Test project /home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/x86_64-redhat-linux-gnu
    Start 1: encode
    Start 2: region
    Start 3: uncompressed_decode
    Start 4: uncompressed_encode
1/4 Test #1: encode ...........................***Failed    0.01 sec

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encode is a Catch v2.13.9 host application.
Run with -? for options

-------------------------------------------------------------------------------
ispe odd size
-------------------------------------------------------------------------------
/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/encode.cc:165
...............................................................................

/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/encode.cc:154: FAILED:
  REQUIRE( ispe_width == expected_ispe_width )
with expansion:
  0 == 122

===============================================================================
test cases: 1 | 1 failed
assertions: 5 | 4 passed | 1 failed


2/4 Test #3: uncompressed_decode ..............   Passed    0.02 sec
3/4 Test #2: region ...........................   Passed    0.32 sec
4/4 Test #4: uncompressed_encode ..............   Passed    0.58 sec

75% tests passed, 1 tests failed out of 4

Total Test time (real) =   0.59 sec

The following tests FAILED:
          1 - encode (Failed)
Errors while running CTest
@kloczek kloczek changed the title 1.17.0: test suite is failing in encode unit 1.17.0: test suite is failing in encode unit Oct 15, 2023
@farindk
Copy link
Contributor

farindk commented Oct 15, 2023

Strange, I cannot reproduce this even when using exactly your cmake config.
Does encoding on the command line work?
heif-enc <any-image.jpg> and heif-enc <any-image.jpg> -A ?

@farindk
Copy link
Contributor

farindk commented Oct 15, 2023

And when you run heif-info -d <outputimage> on the encoded image, search for ispe in the output.
Does it tell a sensible size (not 0) like this:

| | | Box: ispe -----
| | | size: 20   (header size: 12)
| | | image width: 1280
| | | image height: 960

@kloczek
Copy link
Author

kloczek commented Oct 15, 2023

Could you please be a little more precise about what exactly you want me to execute? 🤔

@farindk
Copy link
Contributor

farindk commented Oct 15, 2023

Sorry. So take any arbitrary JPEG image (e.g. input.jpg). Then call these

heif-enc input.jpg out.heic
heif-info -d out.heic | less

In the output, search for ispe and check if the image width/height sizes make sense (like above).

Do the same again, just with -A during encoding:

heif-enc -A input.jpg out.avif
heif-info -d out.avif | less

This does not cover all test cases, but checks if the encoding works at all.

@kloczek
Copy link
Author

kloczek commented Oct 15, 2023

Sorry. So take any arbitrary JPEG image (e.g. input.jpg). Then call these

First I don't see any .jpg file in source ot build tree.

@bradh
Copy link
Contributor

bradh commented Oct 15, 2023

First I don't see any .jpg file in source ot build tree.

Any image on your machine will do.

@farindk It must be working a bit - the uncompressed test is working OK.

@farindk
Copy link
Contributor

farindk commented Oct 15, 2023

@bradh Can you reproduce the failing test?

@kloczek
Copy link
Author

kloczek commented Oct 15, 2023

[tkloczko@pers-jacek examples]$ ./heif-enc heif-enc -A /usr/share/doc/sqlite-devel/images/cpu-usage.jpg out.avif
Not a JPEG file: starts with 0x7f 0x45
[tkloczko@pers-jacek examples]$ file /usr/share/doc/sqlite-devel/images/cpu-usage.jpg
/usr/share/doc/sqlite-devel/images/cpu-usage.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 96x96, segment length 16, comment: "speed-size-graph.ods - LibreOffice Calc", baseline, precision 8, 899x501, components 3

@bradh
Copy link
Contributor

bradh commented Oct 16, 2023

It passes for me.

@kloczek Does it help if you turn on the WITH_JPEG_DECODER and/or WITH_JPEG_ENCODER options?

@kloczek
Copy link
Author

kloczek commented Oct 16, 2023

cmake -L otput:

-- Cache values
BUILD_SHARED_LIBS:BOOL=ON
BUILD_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=/usr
ENABLE_MULTITHREADING_SUPPORT:BOOL=ON
ENABLE_PARALLEL_TILE_DECODING:BOOL=ON
ENABLE_PLUGIN_LOADING:BOOL=ON
FUZZING_COMPILE_OPTIONS:STRING=-fsanitize=fuzzer,address,shift,integer -fno-sanitize-recover=shift,integer
FUZZING_CXX_COMPILER:STRING=clang++
FUZZING_C_COMPILER:STRING=clang
FUZZING_LINKER_OPTIONS:STRING=
PLUGIN_DIRECTORY:STRING=/usr/lib64/libheif
WITH_AOM_DECODER:BOOL=ON
WITH_AOM_DECODER_PLUGIN:BOOL=OFF
WITH_AOM_ENCODER:BOOL=ON
WITH_AOM_ENCODER_PLUGIN:BOOL=OFF
WITH_DAV1D:BOOL=OFF
WITH_DAV1D_PLUGIN:BOOL=ON
WITH_DEFLATE_HEADER_COMPRESSION:BOOL=OFF
WITH_EXAMPLES:BOOL=ON
WITH_FFMPEG_DECODER:BOOL=OFF
WITH_FFMPEG_DECODER_PLUGIN:BOOL=OFF
WITH_FUZZERS:BOOL=OFF
WITH_GDK_PIXBUF:BOOL=ON
WITH_JPEG_DECODER:BOOL=OFF
WITH_JPEG_DECODER_PLUGIN:BOOL=OFF
WITH_JPEG_ENCODER:BOOL=OFF
WITH_JPEG_ENCODER_PLUGIN:BOOL=OFF
WITH_KVAZAAR:BOOL=OFF
WITH_KVAZAAR_PLUGIN:BOOL=OFF
WITH_LIBDE265:BOOL=ON
WITH_LIBDE265_PLUGIN:BOOL=OFF
WITH_LIBSHARPYUV:BOOL=ON
WITH_OpenJPEG_DECODER:BOOL=OFF
WITH_OpenJPEG_DECODER_PLUGIN:BOOL=ON
WITH_OpenJPEG_ENCODER:BOOL=OFF
WITH_OpenJPEG_ENCODER_PLUGIN:BOOL=ON
WITH_RAV1E:BOOL=OFF
WITH_RAV1E_PLUGIN:BOOL=ON
WITH_REDUCED_VISIBILITY:BOOL=ON
WITH_SvtEnc:BOOL=OFF
WITH_SvtEnc_PLUGIN:BOOL=ON
WITH_UNCOMPRESSED_CODEC:BOOL=ON
WITH_X265:BOOL=ON
WITH_X265_PLUGIN:BOOL=OFF

So decoder is enabled as plugin.

@bradh
Copy link
Contributor

bradh commented Oct 16, 2023

The goal was to find out if the plugin system is the problem - possibly in the uninstalled state, possibly globally. I am trying to help, but I can't reproduce the problem locally.

@farindk
Copy link
Contributor

farindk commented Oct 16, 2023

I managed to reproduce it like this:

  • compile v1.15.2 and install in the system
  • compile v1.17.0 and run test without installing
  • the test binaries now use the old v1.15.2 library, leading to this error.

@kloczek I'm quite sure that you also have an old installation on your system that is manipulating the test results.

I think, we can close this.

@kloczek
Copy link
Author

kloczek commented Oct 16, 2023

Prev version 1.16.2 in the same env was OK.
Nevertheless looks like when decoder is enabled as plugin test suite fails with below settings

-- Cache values
BUILD_SHARED_LIBS:BOOL=ON
BUILD_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=/usr
ENABLE_MULTITHREADING_SUPPORT:BOOL=ON
ENABLE_PARALLEL_TILE_DECODING:BOOL=ON
ENABLE_PLUGIN_LOADING:BOOL=ON
FUZZING_COMPILE_OPTIONS:STRING=-fsanitize=fuzzer,address,shift,integer -fno-sanitize-recover=shift,integer
FUZZING_CXX_COMPILER:STRING=clang++
FUZZING_C_COMPILER:STRING=clang
FUZZING_LINKER_OPTIONS:STRING=
PLUGIN_DIRECTORY:STRING=/usr/lib64/libheif
WITH_AOM_DECODER:BOOL=ON
WITH_AOM_DECODER_PLUGIN:BOOL=ON
WITH_AOM_ENCODER:BOOL=ON
WITH_AOM_ENCODER_PLUGIN:BOOL=ON
WITH_DAV1D:BOOL=OFF
WITH_DAV1D_PLUGIN:BOOL=ON
WITH_DEFLATE_HEADER_COMPRESSION:BOOL=OFF
WITH_EXAMPLES:BOOL=ON
WITH_FFMPEG_DECODER:BOOL=OFF
WITH_FFMPEG_DECODER_PLUGIN:BOOL=ON
WITH_FUZZERS:BOOL=OFF
WITH_GDK_PIXBUF:BOOL=ON
WITH_JPEG_DECODER:BOOL=OFF
WITH_JPEG_DECODER_PLUGIN:BOOL=ON
WITH_JPEG_ENCODER:BOOL=OFF
WITH_JPEG_ENCODER_PLUGIN:BOOL=ON
WITH_KVAZAAR:BOOL=OFF
WITH_KVAZAAR_PLUGIN:BOOL=ON
WITH_LIBDE265:BOOL=ON
WITH_LIBDE265_PLUGIN:BOOL=ON
WITH_LIBSHARPYUV:BOOL=ON
WITH_OpenJPEG_DECODER:BOOL=OFF
WITH_OpenJPEG_DECODER_PLUGIN:BOOL=ON
WITH_OpenJPEG_ENCODER:BOOL=OFF
WITH_OpenJPEG_ENCODER_PLUGIN:BOOL=ON
WITH_RAV1E:BOOL=OFF
WITH_RAV1E_PLUGIN:BOOL=ON
WITH_REDUCED_VISIBILITY:BOOL=ON
WITH_SvtEnc:BOOL=OFF
WITH_SvtEnc_PLUGIN:BOOL=ON
WITH_UNCOMPRESSED_CODEC:BOOL=ON
WITH_X265:BOOL=ON
WITH_X265_PLUGIN:BOOL=ON

in TWO units

+ cd libheif-1.17.0
+ /usr/bin/ctest --test-dir x86_64-redhat-linux-gnu --output-on-failure --force-new-ctest-process -j48
Internal ctest changing into directory: /home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/x86_64-redhat-linux-gnu
Test project /home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/x86_64-redhat-linux-gnu
    Start 1: encode
    Start 2: region
    Start 3: uncompressed_decode
    Start 4: uncompressed_encode
1/4 Test #1: encode ...........................***Failed    0.01 sec

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encode is a Catch v2.13.9 host application.
Run with -? for options

-------------------------------------------------------------------------------
ispe odd size
-------------------------------------------------------------------------------
/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/encode.cc:165
...............................................................................

/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/encode.cc:140: FAILED:
  REQUIRE( err.code == heif_error_Ok )
with expansion:
  3 == 0

===============================================================================
test cases: 1 | 1 failed
assertions: 4 | 3 passed | 1 failed


2/4 Test #2: region ...........................***Failed    0.01 sec

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
region is a Catch v2.13.9 host application.
Run with -? for options

-------------------------------------------------------------------------------
create regions
-------------------------------------------------------------------------------
/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/region.cc:46
...............................................................................

/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/region.cc:60: FAILED:
  REQUIRE( err.code == heif_error_Ok )
with expansion:
  3 == 0

-------------------------------------------------------------------------------
create mask region
-------------------------------------------------------------------------------
/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/region.cc:228
...............................................................................

/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/region.cc:245: FAILED:
  REQUIRE( err.code == heif_error_Ok )
with expansion:
  3 == 0

-------------------------------------------------------------------------------
create inline mask region from data
-------------------------------------------------------------------------------
/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/region.cc:353
...............................................................................

/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/region.cc:370: FAILED:
  REQUIRE( err.code == heif_error_Ok )
with expansion:
  3 == 0

-------------------------------------------------------------------------------
create inline mask region from image
-------------------------------------------------------------------------------
/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/region.cc:448
...............................................................................

/home/tkloczko/rpmbuild/BUILD/libheif-1.17.0/tests/region.cc:465: FAILED:
  REQUIRE( err.code == heif_error_Ok )
with expansion:
  3 == 0

===============================================================================
test cases:  5 |  1 passed | 4 failed
assertions: 20 | 16 passed | 4 failed


3/4 Test #3: uncompressed_decode ..............   Passed    0.02 sec
4/4 Test #4: uncompressed_encode ..............   Passed    0.53 sec

50% tests passed, 2 tests failed out of 4

Total Test time (real) =   0.53 sec

The following tests FAILED:
          1 - encode (Failed)
          2 - region (Failed)
Errors while running CTest

@fancycode
Copy link
Member

As I just experienced the same problem while working on Debian packaging: make sure to set LIBHEIF_PLUGIN_PATH to the absolute path containing your just-built plugins before running any tests. Otherwise the tests will search for plugins in the system folder where they most likely don't exist yet.

@kloczek
Copy link
Author

kloczek commented Oct 16, 2023

So looks like issue is around missing setting that env variable ..

@kloczek
Copy link
Author

kloczek commented Dec 8, 2023

Any progress?
If not it would be good to keep this ticket opened.

@rathann
Copy link

rathann commented Nov 15, 2024

FWIW, the tests are passing for me in 1.19.3 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants