Skip to content

Test suite fails 16 tests on hppa #3927

Description

@DerDakon

What did you do?

Built and run Pillow master (290cd17) on Gentoo/HPPA (big endian!) and ran the test suite:

What actually happened?

Tests/test_file_gif.py::TestFileGif::test_extents FAILED
Tests/test_file_ico.py::TestFileIco::test_unexpected_size FAILED
Tests/test_file_jpeg.py::TestFileJpeg::test_photoshop FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_16bit_RGB_tiff FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_old_style_jpeg FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_strip_cmyk_16l_jpeg FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_strip_ycbcr_jpeg_1x1_sampling FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_strip_ycbcr_jpeg_2x2_sampling FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_tiled_ycbcr_jpeg_1x1_sampling FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_tiled_ycbcr_jpeg_2x2_sampling FAILED
Tests/test_file_png.py::TestFilePng::test_sanity FAILED
Tests/test_image_getextrema.py::TestImageGetExtrema::test_extrema FAILED
Tests/test_image_getextrema.py::TestImageGetExtrema::test_true_16 FAILED
Tests/test_imagedraw.py::TestImageDraw::test_arc_width_pieslice_large FAILED
Tests/test_imagedraw.py::TestImageDraw::test_ellipse_width_large FAILED
Tests/test_imagedraw.py::TestImageDraw::test_rectangle_I16 FAILED

Not all of those are regressions, here is the fail list for 6.0.0:

Tests/test_file_libtiff.py::TestFileLibTiff::test_old_style_jpeg FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_strip_ycbcr_jpeg_1x1_sampling FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_strip_ycbcr_jpeg_2x2_sampling FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_tiled_ycbcr_jpeg_1x1_sampling FAILED
Tests/test_file_libtiff.py::TestFileLibTiff::test_tiled_ycbcr_jpeg_2x2_sampling FAILED
Tests/test_file_png.py::TestFilePng::test_sanity FAILED
Tests/test_image_getextrema.py::TestImageGetExtrema::test_extrema FAILED
Tests/test_image_getextrema.py::TestImageGetExtrema::test_true_16 FAILED

What are your OS, Python and Pillow versions?

  • OS: Gentoo HPPA
  • Python: 2.7.15
  • Pillow: current master

pillow-6.1.0.log

Activity

  1. DerDakon commented on Jun 30, 2019

    @DerDakon
    ContributorAuthor

    When activating truetype I get 3 additional failures:

    Tests/test_imagefont.py::TestImageFont::test_variation_get FAILED
    Tests/test_imagefont.py::TestImageFont::test_variation_set_by_axes FAILED
    Tests/test_imagefont.py::TestImageFont::test_variation_set_by_name FAILED

    build.log

  2. DerDakon commented on Jul 2, 2019

    @DerDakon
    ContributorAuthor

    As mentioned in the comments to #3225: this also happens on sparc (also big endian).

  3. ernsteiswuerfel commented on Aug 17, 2019

    @ernsteiswuerfel

    A subset of these tests fail also on ppc32 (Big Endian):
    Tests/test_file_libtiff.py::TestFileLibTiff::test_old_style_jpeg FAILED
    Tests/test_file_libtiff.py::TestFileLibTiff::test_strip_ycbcr_jpeg_1x1_sampling FAILED
    Tests/test_file_libtiff.py::TestFileLibTiff::test_strip_ycbcr_jpeg_2x2_sampling FAILED
    Tests/test_file_libtiff.py::TestFileLibTiff::test_tiled_ycbcr_jpeg_1x1_sampling FAILED
    Tests/test_file_libtiff.py::TestFileLibTiff::test_tiled_ycbcr_jpeg_2x2_sampling FAILED
    Tests/test_file_png.py::TestFilePng::test_sanity FAILED
    Tests/test_image_getextrema.py::TestImageGetExtrema::test_extrema FAILED
    Tests/test_image_getextrema.py::TestImageGetExtrema::test_true_16 FAILED

    In addition to that the following tests fail on ppc32 (Big Endian):
    Tests/test_file_jpeg2k.py::TestFileJpeg2k::test_16bit_monochrome_j2k_like_tiff FAILED
    Tests/test_file_jpeg2k.py::TestFileJpeg2k::test_16bit_monochrome_jp2_like_tiff FAILED
    Tests/test_file_webp_animated.py::TestFileWebpAnimation::test_write_animation_L FAILED
    Tests/test_file_webp_animated.py::TestFileWebpAnimation::test_write_animation_RGB FAILED

    Two of them already filed in bug #3290 and in bug #3291.
    pillow-6.1.0:20190816-234305.log

  4. radarhere commented on Jan 16, 2022

    @radarhere
    Member

    For the comment from @ernsteiswuerfel

    @DerDakon does #3243 (comment) also mean that your problems here are fixed, including the test_imagefont.py tests?

    Edit: Looking for a cause, I suspect it was #4696 that changed the test_imagefont results.

  5. ernsteiswuerfel commented on Jan 16, 2022

    @ernsteiswuerfel

    Just ran the testsuite for 9.9.0 on ppc32 which now says:

    [...]
    XFAIL Tests/test_decompression_bomb.py::TestDecompressionBomb::test_exception_ico
      different exception
    XFAIL Tests/test_file_webp_animated.py::test_write_animation_L
      Fails on big-endian
    XFAIL Tests/test_file_webp_animated.py::test_write_animation_RGB
      Fails on big-endian
    XFAIL Tests/test_image_resample.py::TestCoreResampleAlphaCorrect::test_levels_rgba
      Current implementation isn't precise enough
    XFAIL Tests/test_image_resample.py::TestCoreResampleAlphaCorrect::test_levels_la
      Current implementation isn't precise enough
    XPASS Tests/test_file_palm.py::test_p_mode Palm P image is wrong
    FAILED Tests/test_image.py::TestImage::test_zero_tobytes[size0] - SystemError: tile cannot extend out...
    FAILED Tests/test_image.py::TestImage::test_zero_tobytes[size1] - SystemError: tile cannot extend out...
    FAILED Tests/test_image.py::TestImage::test_zero_tobytes[size2] - SystemError: tile cannot extend out...
    FAILED Tests/test_imagepath.py::test_invalid_coords - SystemError: new style getargs format but argum...
    ====== 4 failed, 2653 passed, 223 skipped, 5 xfailed, 1 xpassed, 5 warnings in 172.01s (0:02:52) =======
    

    So my originally reported failures for ppc32 are fixed or the tests get skipped where appropriate.

    Current failures are:

    __________________________________ TestImage.test_zero_tobytes[size0] __________________________________
    
    self = <Tests.test_image.TestImage object at 0xf0d37730>, size = (1, 0)
    
        @pytest.mark.parametrize("size", ((1, 0), (0, 1), (0, 0)))
        def test_zero_tobytes(self, size):
            im = Image.new("RGB", size)
    >       assert im.tobytes() == b""
    
    Tests/test_image.py:792: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <PIL.Image.Image image mode=RGB size=1x0 at 0xF0D37C40>, encoder_name = 'raw', args = 'RGB'
    e = <ImagingEncoder object at 0xf043ba40>
    
        def tobytes(self, encoder_name="raw", *args):
            """
            Return image as a bytes object.
        
            .. warning::
        
                This method returns the raw image data from the internal
                storage.  For compressed image data (e.g. PNG, JPEG) use
                :meth:`~.save`, with a BytesIO parameter for in-memory
                data.
        
            :param encoder_name: What encoder to use.  The default is to
                                 use the standard "raw" encoder.
            :param args: Extra arguments to the encoder.
            :returns: A :py:class:`bytes` object.
            """
        
            # may pass tuple instead of argument list
            if len(args) == 1 and isinstance(args[0], tuple):
                args = args[0]
        
            if encoder_name == "raw" and args == ():
                args = self.mode
        
            self.load()
        
            # unpack data
            e = _getencoder(self.mode, encoder_name, args)
    >       e.setimage(self.im)
    E       SystemError: tile cannot extend outside image
    
    ../.local/lib/python3.10/site-packages/PIL/Image.py:722: SystemError
    __________________________________ TestImage.test_zero_tobytes[size1] __________________________________
    
    self = <Tests.test_image.TestImage object at 0xf107fd90>, size = (0, 1)
    
        @pytest.mark.parametrize("size", ((1, 0), (0, 1), (0, 0)))
        def test_zero_tobytes(self, size):
            im = Image.new("RGB", size)
    >       assert im.tobytes() == b""
    
    Tests/test_image.py:792: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <PIL.Image.Image image mode=RGB size=0x1 at 0xF107F520>, encoder_name = 'raw', args = 'RGB'
    e = <ImagingEncoder object at 0xf043b7a0>
    
        def tobytes(self, encoder_name="raw", *args):
            """
            Return image as a bytes object.
        
            .. warning::
        
                This method returns the raw image data from the internal
                storage.  For compressed image data (e.g. PNG, JPEG) use
                :meth:`~.save`, with a BytesIO parameter for in-memory
                data.
        
            :param encoder_name: What encoder to use.  The default is to
                                 use the standard "raw" encoder.
            :param args: Extra arguments to the encoder.
            :returns: A :py:class:`bytes` object.
            """
        
            # may pass tuple instead of argument list
            if len(args) == 1 and isinstance(args[0], tuple):
                args = args[0]
        
            if encoder_name == "raw" and args == ():
                args = self.mode
        
            self.load()
        
            # unpack data
            e = _getencoder(self.mode, encoder_name, args)
    >       e.setimage(self.im)
    E       SystemError: tile cannot extend outside image
    
    ../.local/lib/python3.10/site-packages/PIL/Image.py:722: SystemError
    __________________________________ TestImage.test_zero_tobytes[size2] __________________________________
    
    self = <Tests.test_image.TestImage object at 0xf107f310>, size = (0, 0)
    
        @pytest.mark.parametrize("size", ((1, 0), (0, 1), (0, 0)))
        def test_zero_tobytes(self, size):
            im = Image.new("RGB", size)
    >       assert im.tobytes() == b""
    
    Tests/test_image.py:792: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <PIL.Image.Image image mode=RGB size=0x0 at 0xF107F940>, encoder_name = 'raw', args = 'RGB'
    e = <ImagingEncoder object at 0xf043bb00>
    
        def tobytes(self, encoder_name="raw", *args):
            """
            Return image as a bytes object.
        
            .. warning::
        
                This method returns the raw image data from the internal
                storage.  For compressed image data (e.g. PNG, JPEG) use
                :meth:`~.save`, with a BytesIO parameter for in-memory
                data.
        
            :param encoder_name: What encoder to use.  The default is to
                                 use the standard "raw" encoder.
            :param args: Extra arguments to the encoder.
            :returns: A :py:class:`bytes` object.
            """
        
            # may pass tuple instead of argument list
            if len(args) == 1 and isinstance(args[0], tuple):
                args = args[0]
        
            if encoder_name == "raw" and args == ():
                args = self.mode
        
            self.load()
        
            # unpack data
            e = _getencoder(self.mode, encoder_name, args)
    >       e.setimage(self.im)
    E       SystemError: tile cannot extend outside image
    
    ../.local/lib/python3.10/site-packages/PIL/Image.py:722: SystemError
    _________________________________________ test_invalid_coords __________________________________________
    
        def test_invalid_coords():
            # Arrange
            coords = ["a", "b"]
        
            # Act / Assert
            with pytest.raises(ValueError) as e:
    >           ImagePath.Path(coords)
    E           SystemError: new style getargs format but argument is not a tuple
    
    Tests/test_imagepath.py:74: SystemError
    
  6. radarhere commented on Jan 16, 2022

    @radarhere
    Member

    Those errors don't look like endian problems to me. They're tests from #5938 and #5942, so I think you're testing Pillow 9.0 against the latest tests in the main branch. If you checkout the 9.0.x branch and test again, I think they should pass.

  7. ernsteiswuerfel commented on Jan 17, 2022

    @ernsteiswuerfel

    Erm yes... you are correct! My fault. With 9.0.0 branch I get 2654 passed, 222 skipped, 5 xfailed, 1 xpassed, 5 warnings

    Thanks for fixing these 'alternative arch' bugs!

  8. radarhere commented on Jan 26, 2022

    @radarhere
    Member

    The webp test failures were actually due to problems in libwebp itself, not Pillow. libwebp 1.2.2 has resolved these, and #5984 will remove the xfail conditions on those two tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions