<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>282380</bug_id>
          
          <creation_ts>2024-10-31 03:03:48 -0700</creation_ts>
          <short_desc>[GTK][WPE][Skia] WebKitTestRunner asserts when generating pixel test dumps in SKIA_DEBUG enabled builds</short_desc>
          <delta_ts>2026-03-30 13:28:53 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WPE WebKit</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>283351</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolas Zimmermann">zimmermann</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aperez</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>cgarcia</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2071825</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-10-31 03:03:48 -0700</bug_when>
    <thetext>WebKitTestRunner asserts when generating pixel test dumps in SKIA_DEBUG enabled builds:

Running e.g. run-test-runner --wpe --release --no-timeout --pixel-tests -- $PWD/LayoutTests/css3/filters/animation-from-initial-values-with-color-matrix.html:
Content-Type: text/plain
layer at (0,0) size 800x600
  RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
  RenderBlock {HTML} at (0,0) size 800x600
    RenderBody {BODY} at (8,8) size 784x584
...
/host/home/nzimmermann/Software/GitRepositories/WebKit/Source/ThirdParty/skia/include/core/SkPixmap.h:327: fatal error: &quot;check(1 == fInfo.bytesPerPixel())&quot;

Backtrace:
* thread #1, name = &apos;WebKitTestRunne&apos;, stop reason = signal SIGILL: illegal operand
  * frame #0: 0x00006339ad5ae550 WebKitTestRunner`sk_abort_no_print() at SkMemory_malloc.cpp:60:5
    frame #1: 0x00006339ad3be4c7 WebKitTestRunner`SkPixmap::addr8(this=0x00007fffdde430c0) const::&apos;lambda&apos;()::operator()() const at SkPixmap.h:327:329
    frame #2: 0x00006339ad3be457 WebKitTestRunner`WTR::TestInvocation::dumpPixelsAndCompareWithExpected(WTR::TestInvocation::SnapshotResultType, OpaqueWKArray const*, OpaqueWKImage const*) [inlined] SkPixmap::addr8(this=0x00007fffdde430f0) const at SkPixmap.h:327:120
    frame #3: 0x00006339ad3be452 WebKitTestRunner`WTR::TestInvocation::dumpPixelsAndCompareWithExpected(WTR::TestInvocation::SnapshotResultType, OpaqueWKArray const*, OpaqueWKImage const*) [inlined] WTR::computeSHA1HashStringForPixmap[abi:cxx11](pixmap=0x00007fffdde430f0) at TestInvocationSkia.cpp:51:37
    frame #4: 0x00006339ad3be452 WebKitTestRunner`WTR::TestInvocation::dumpPixelsAndCompareWithExpected(this=0x00007f87d403c7c0, snapshotType=&lt;unavailable&gt;, repaintRects=&lt;unavailable&gt;, webImage=&lt;unavailable&gt;) at TestInvocationSkia.cpp:104:25
    frame #5: 0x00006339ad3a077b WebKitTestRunner`WTR::TestInvocation::dumpResults(this=0x00007f87d403c7c0) at TestInvocation.cpp:0
    frame #6: 0x00006339ad3a03dd WebKitTestRunner`WTR::TestInvocation::invoke(this=0x00007f87d403c7c0) at TestInvocation.cpp:212:5
    frame #7: 0x00006339ad38631d WebKitTestRunner`WTR::TestController::runTest(this=0x00007fffdde43590, inputLine=&lt;unavailable&gt;) at TestController.cpp:1718:26
    frame #8: 0x00006339ad37ea3c WebKitTestRunner`WTR::TestController::TestController(int, char const**) [inlined] WTR::TestController::run(this=0x00007fffdde43590) at TestController.cpp:1776:18```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071827</commentid>
    <comment_count>1</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-10-31 03:06:32 -0700</bug_when>
    <thetext>`SkPixmap::addr8()` can only be used on pixmaps that use 1 byte for the color -- we use 4 bytes (RGBA).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071829</commentid>
    <comment_count>2</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-10-31 03:20:57 -0700</bug_when>
    <thetext>Easiest way to fix:

```
diff --git a/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp b/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
index b6d7e81cf7a7..39ec9b69f03c 100644
--- a/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
+++ b/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
@@ -44,12 +44,12 @@ namespace WTR {
 static std::string computeSHA1HashStringForPixmap(const SkPixmap&amp; pixmap)
 {
     size_t pixelsWidth = pixmap.width();
-    size_t pixelsHight = pixmap.height();
+    size_t pixelsHeight = pixmap.height();
     size_t bytesPerRow = pixmap.info().minRowBytes();
 
     SHA1 sha1;
-    const auto* bitmapData = pixmap.addr8();
-    for (size_t row = 0; row &lt; pixelsHight; ++row) {
+    const auto* bitmapData = reinterpret_cast&lt;const uint8_t*&gt;(pixmap.addr32());
+    for (size_t row = 0; row &lt; pixelsHeight; ++row) {
         sha1.addBytes(std::span { bitmapData, 4 * pixelsWidth });
         bitmapData += bytesPerRow;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2071830</commentid>
    <comment_count>3</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2024-10-31 03:21:04 -0700</bug_when>
    <thetext>Easiest way to fix:

```
diff --git a/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp b/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
index b6d7e81cf7a7..39ec9b69f03c 100644
--- a/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
+++ b/Tools/WebKitTestRunner/skia/TestInvocationSkia.cpp
@@ -44,12 +44,12 @@ namespace WTR {
 static std::string computeSHA1HashStringForPixmap(const SkPixmap&amp; pixmap)
 {
     size_t pixelsWidth = pixmap.width();
-    size_t pixelsHight = pixmap.height();
+    size_t pixelsHeight = pixmap.height();
     size_t bytesPerRow = pixmap.info().minRowBytes();
 
     SHA1 sha1;
-    const auto* bitmapData = pixmap.addr8();
-    for (size_t row = 0; row &lt; pixelsHight; ++row) {
+    const auto* bitmapData = reinterpret_cast&lt;const uint8_t*&gt;(pixmap.addr32());
+    for (size_t row = 0; row &lt; pixelsHeight; ++row) {
         sha1.addBytes(std::span { bitmapData, 4 * pixelsWidth });
         bitmapData += bytesPerRow;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2195262</commentid>
    <comment_count>4</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2026-03-30 13:28:53 -0700</bug_when>
    <thetext>This is basically the same as bug #283351, for which I have just submitted a patch.

*** This bug has been marked as a duplicate of bug 283351 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>