<?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>282846</bug_id>
          
          <creation_ts>2024-11-08 11:21:32 -0800</creation_ts>
          <short_desc>On some cases async/await creates a race where we try to compute translate with null values</short_desc>
          <delta_ts>2024-11-15 12:00:11 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Pedro Varangot">pvarangot</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>koivisto</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2073896</commentid>
    <comment_count>0</comment_count>
    <who name="Pedro Varangot">pvarangot</who>
    <bug_when>2024-11-08 11:21:32 -0800</bug_when>
    <thetext>This test will crash sometimes, around 20% to 50% of the time on main. Removing unused function or asynchronous code doesn&apos;t crash:

&lt;html&gt;
&lt;head&gt;
&lt;style&gt;
* { read-only; translate: 640rlh; };
&lt;/style&gt;
&lt;script&gt;
    nodes = new Map([
        [&apos;n0&apos;, new WeakRef(document.documentElement)]
    ]);

    function getObject(key) {
        entriesForKey = stuff.get(key);
        {
            nextEntry = entriesForKey.shift();
            theObject = nextEntry.deref();
            {
                return theObject;
            }
        }
    }

    node = document.createElementNS(&apos;http://www.w3.org/1999/xhtml&apos;, &apos;img&apos;);
    nodes.get(&apos;n0&apos;).deref().append(node);
 
    (async () =&gt; {
        globalThis.testRunner?.waitUntilDone();
        for (let i = 0; i &lt; 1700; i++) {
            const url = new URL(`https://example.com/?q=${i}`);
        }
        frames.history.back();
        try {
            await (() =&gt; {
                return window.caches.has(&quot;something&quot;);
            })();
        } catch {}
        node.computedStyleMap().getAll(&apos;translate&apos;);
        globalThis.testRunner?.notifyDone();
        globalThis.testRunner?.dumpAsText();
    })();
&lt;/script&gt;
&lt;/head&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2073897</commentid>
    <comment_count>1</comment_count>
    <who name="Pedro Varangot">pvarangot</who>
    <bug_when>2024-11-08 11:22:35 -0800</bug_when>
    <thetext>&lt;rdar://problem/137177447&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2073899</commentid>
    <comment_count>2</comment_count>
    <who name="Pedro Varangot">pvarangot</who>
    <bug_when>2024-11-08 11:26:03 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/36409</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2074131</commentid>
    <comment_count>3</comment_count>
    <who name="Pedro Varangot">pvarangot</who>
    <bug_when>2024-11-10 08:46:03 -0800</bug_when>
    <thetext>Relevant part of the stack trace:

1   WebCore                       	       0x134ff0980 WebCore::CSSPrimitiveValue::create(WebCore::Length const&amp;, WebCore::RenderStyle const&amp;) + 1084 (CSSPrimitiveValue.cpp:576)
2   WebCore                       	       0x135124a20 WebCore::ComputedStyleExtractor::zoomAdjustedPixelValueForLength(WebCore::Length const&amp;, WebCore::RenderStyle const&amp;) + 16 (ComputedStyleExtractor.cpp:437) [inlined]
3   WebCore                       	       0x135124a20 WebCore::computedTranslate(WebCore::RenderObject*, WebCore::RenderStyle const&amp;)::$_0::operator()(WebCore::Length const&amp;) const + 16 (ComputedStyleExtractor.cpp:995) [inlined]
4   WebCore                       	       0x135124a20 WebCore::computedTranslate(WebCore::RenderObject*, WebCore::RenderStyle const&amp;) + 7644 (ComputedStyleExtractor.cpp:1002)
5   WebCore                       	       0x1350d21dc WebCore::ComputedStyleExtractor::valueForPropertyInStyle(WebCore::RenderStyle const&amp;, WebCore::CSSPropertyID, WebCore::RenderElement*, WebCore::ComputedStyleExtractor::PropertyValueType) const + 99240 (ComputedStyleExtractor.cpp:4591)
6   WebCore                       	       0x1350b81a8 WebCore::ComputedStyleExtractor::propertyValue(WebCore::CSSPropertyID, WebCore::ComputedStyleExtractor::UpdateLayout, WebCore::ComputedStyleExtractor::PropertyValueType) const + 1168 (ComputedStyleExtractor.cpp:3445)
7   WebCore                       	       0x13588abec WebCore::ComputedStylePropertyMapReadOnly::propertyValue(WebCore::CSSPropertyID) const + 228 (ComputedStylePropertyMapReadOnly.cpp:53)
8   WebCore                       	       0x1358944a4 WebCore::MainThreadStylePropertyMapReadOnly::getAll(WebCore::ScriptExecutionContext&amp;, WTF::AtomString const&amp;) const + 2484 (MainThreadStylePropertyMapReadOnly.cpp:107)
9   WebCore                       	       0x132be9460 WebCore::jsStylePropertyMapReadOnlyPrototypeFunction_getAllBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSStylePropertyMapReadOnly*) + 920 (JSStylePropertyMapReadOnly.cpp:252)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2075424</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-11-15 12:00:09 -0800</bug_when>
    <thetext>Committed 286647@main (c1664193f635): &lt;https://commits.webkit.org/286647@main&gt;

Reviewed commits have been landed. Closing PR #36409 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>