Bug 226118 - ASSERTION FAILED: Component at index 1 is 1.000000 and is greater than the allowed maximum 1.000000
Summary: ASSERTION FAILED: Component at index 1 is 1.000000 and is greater than the al...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-21 16:07 PDT by Robert Jenner
Modified: 2021-05-22 07:16 PDT (History)
5 users (show)

See Also:


Attachments
Full Crashlog for API (155.67 KB, text/plain)
2021-05-21 16:12 PDT, Robert Jenner
no flags Details
Patch (1.64 KB, patch)
2021-05-21 19:13 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Jenner 2021-05-21 16:07:40 PDT
TestWebKitAPI.SampledPageTopColor.MainDocumentChange

is having an Assertion Failure/ crash on Debug for Catalina and up, as well as iOS14-Simulator Debug.

HISTORY:
https://results.webkit.org/?suite=api-tests&test=TestWebKitAPI.SampledPageTopColor.MainDocumentChange

It appears that it was recently introduced at r277523, and has crashed on Debug ever since:
https://trac.webkit.org/changeset/277523/webkit

TestWebKitAPI.SampledPageTopColor.MainDocumentChange
        ASSERTION FAILED: Component at index 1 is 1.000000 and is greater than the allowed maximum 1.000000
        components[i] <= T::Model::componentInfo[i].max
        /Volumes/Data/worker/catalina-debug/build/Source/WebCore/platform/graphics/ColorTypes.h(133) : void WebCore::assertInRange(T) [T = WebCore::RGBAType<float, WebCore::SRGBADescriptor<float>, WebCore::BoundedGammaEncoded<float, WebCore::SRGBADescriptor<float> >, WebCore::RGBModel<float>, WebCore::SRGBTransferFunction<float, WebCore::TransferFunctionMode::Clamped> >]
        1   0x10d7102f9 WTFCrash
        2   0x12a8366dd void WebCore::assertInRange<WebCore::RGBAType<float, WebCore::SRGBADescriptor<float>, WebCore::BoundedGammaEncoded<float, WebCore::SRGBADescriptor<float> >, WebCore::RGBModel<float>, WebCore::SRGBTransferFunction<float, (WebCore::TransferFunctionMode)0> > >(WebCore::RGBAType<float, WebCore::SRGBADescriptor<float>, WebCore::BoundedGammaEncoded<float, WebCore::SRGBADescriptor<float> >, WebCore::RGBModel<float>, WebCore::SRGBTransferFunction<float, (WebCore::TransferFunctionMode)0> >)
        3   0x12a836549 WebCore::RGBAType<float, WebCore::SRGBADescriptor<float>, WebCore::BoundedGammaEncoded<float, WebCore::SRGBADescriptor<float> >, WebCore::RGBModel<float>, WebCore::SRGBTransferFunction<float, (WebCore::TransferFunctionMode)0> >::RGBAType(float, float, float, float)
        4   0x12a8364d0 WebCore::BoundedGammaEncoded<float, WebCore::SRGBADescriptor<float> >::BoundedGammaEncoded(float, float, float, float)
        5   0x12a8363bd WebCore::BoundedGammaEncoded<float, WebCore::SRGBADescriptor<float> >::BoundedGammaEncoded(float, float, float, float)
        6   0x12ec485e6 WebCore::roundAndClampToSRGBALossy(CGColor*)
        7   0x12ec4863b WebCore::Color::Color(CGColor*, WTF::OptionSet<WebCore::Color::Flags>)
        8   0x10a8121ba SampledPageTopColor_MainDocumentChange_Test::TestBody()
        9   0x10ad00024 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*)
        10  0x10acc23eb void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*)
        11  0x10acc2323 testing::Test::Run()
        12  0x10acc34f4 testing::TestInfo::Run()
        13  0x10acc46d5 testing::TestSuite::Run()
        14  0x10acd388d testing::internal::UnitTestImpl::RunAllTests()
        15  0x10ad05204 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)
        16  0x10acd322b bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*)
        17  0x10acd30fd testing::UnitTest::Run()
        18  0x10aa08a11 RUN_ALL_TESTS()
        19  0x10aa089a2 TestWebKitAPI::TestsController::run(int, char**)
        20  0x10ac8981f main
        21  0x7fff6afeacc9 start
        22  0x2
Comment 1 Robert Jenner 2021-05-21 16:11:52 PDT
Was able to reproduce the Assertion/crash on BigSur Debug ToT with the following test:

run-api-tests TestWebKitAPI.SampledPageTopColor.MainDocumentChange

Full crashlog from my results is attached below.
Comment 2 Robert Jenner 2021-05-21 16:12:36 PDT
Created attachment 429358 [details]
Full Crashlog for API

Attaching full crashing for API.
Comment 3 Radar WebKit Bug Importer 2021-05-21 16:13:14 PDT
<rdar://problem/78333590>
Comment 4 Devin Rousso 2021-05-21 19:13:28 PDT
Created attachment 429387 [details]
Patch
Comment 5 Darin Adler 2021-05-21 22:43:25 PDT
Comment on attachment 429387 [details]
Patch

Sam should review this.
Comment 6 Sam Weinig 2021-05-22 06:52:25 PDT
Comment on attachment 429387 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=429387&action=review

> Source/WebCore/platform/graphics/cg/ColorCG.cpp:86
> -    return convertColor<SRGBA<uint8_t>>(SRGBA<float> { r, g, b, a });
> +    return convertColor<SRGBA<uint8_t>>(makeFromComponentsClamping<SRGBA<float>>(r, g, b, a ));

This is a good short term fix for the tests, but I need to fix this function to do something actually reasonable here. I'll tackle that in https://bugs.webkit.org/show_bug.cgi?id=226141.
Comment 7 EWS 2021-05-22 07:16:38 PDT
Committed r277919 (238052@main): <https://commits.webkit.org/238052@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 429387 [details].