gil: Image checksum tests failing for variant=release and x64 arch

Adding b2 variant=release build jobs to AppVeyor in #46 which revealed that test/image.cpp is failing on optimised x64 only builds:

Checksum error in bgr121_basic_red_x (crc=2009802095 != 2137924839)

Here is the build https://ci.appveyor.com/project/stefanseefeld/gil/build/1.0.182-develop

This issue does not occur on Travis using GCC 5.4.1 and clang 4.2.1. I also was not able to reproduce it locally, on Ubuntu with GCC 5.4.0.

Failing checksum test cases

Modifying test/image.cpp to skip cases with missing CRC-s:

 // Create a checksum for the given view and compare it with the reference checksum. Throw exception if different
 void checksum_image_test::check_view_impl(const rgb8c_view_t& img_view, const string& name) {
+    if (_crc_map[name] == 0)
+    {
+        cerr << "no checksum, skipping " << name << endl;
+        return;
+    }
+
     boost::crc_32_type checksum_acumulator;
     checksum_acumulator.process_bytes(img_view.row_begin(0),img_view.size()*3);

allowed to iterate over the test cases in test/gil_reference_checksums.txt (remove failing entry, run the test, repeat until all remaining cases pass) and identify the failing ones:

bgr121_basic_red_x 7f6e24e7
bgr121_basic_white_x e4aaa1d3
bgr121_views_90cw 8565efd8
bgr121_views_flipped_ud 8f7f7d00

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 19 (19 by maintainers)

Commits related to this issue

Most upvoted comments

MWE v2 for Test 2 (minimal_chhenning.cpp)

#define _CRT_SECURE_NO_WARNINGS 1
#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io/bmp.hpp>
using namespace boost::gil;

int main()
{
    using ref_t = const bit_aligned_pixel_reference<boost::uint8_t, boost::mpl::vector3_c<int, 1, 2, 1>, bgr_layout_t, true>;
    using ptr_t = bit_aligned_pixel_iterator<ref_t>;
    using pixel_t = std::iterator_traits<ptr_t>::value_type;
    using bgr121_image_t = image<ref_t, false>;

    // works
    {
        bgr121_image_t a(10, 10);
        fill_pixels(view(a), pixel_t(0, 0, 1));

        auto loc = view(a).xy_at(0, 0);
        for (int y = 0; y < view(a).height(); ++y)
        {
            *loc = pixel_t(1, 0, 0);
            ++loc.x();
            ++loc.y();
        }

        auto v = color_converted_view<rgb8_pixel_t>(view(a));
        write_view("a.bmp", v, bmp_tag());
    }
    // doesn't work
    {
        bgr121_image_t b(10, 10);
        fill_pixels(view(b), pixel_t(0, 0, 1));

        auto loc = view(b).xy_at(0, view(b).height() - 1);
        for (int y = 0; y < view(b).height(); ++y)
        {
            *loc = pixel_t(1, 0, 0);
            ++loc.x();
            --loc.y();
        }

        auto v = color_converted_view<rgb8_pixel_t>(view(b));
        write_view("b.bmp", v, bmp_tag());
    }
}