Bug 229580

Summary: [ Catalina EWS ] webgl/2.0.0/* tests are flaky crashing ASSERTION FAILED: !needsLayout()
Product: WebKit Reporter: ayumi_kojima
Component: WebGLAssignee: Robert Jenner <jenner>
Status: NEW ---    
Severity: Normal CC: aakash_jain, dino, ehutchison, kbr, kkinnunen, rackler, simon.fraser, webkit-bot-watchers-bugzilla, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 239640    
Attachments:
Description Flags
Crash log none

Description ayumi_kojima 2021-08-26 11:33:51 PDT
webgl/2.0.0/conformance/textures/misc/texture-upload-size.html
webgl/2.0.0/conformance2/textures/misc/tex-srgb-mipmap.html

Are a flaky crash on macOS-Catalina-Debug-WK1-Tests-EWS.

webgl/2.0.0/conformance2/textures/misc/tex-srgb-mipmap.html is flaky crashing on Catalina wk1 Debug and Big Sur wk1 Debug in the open source directory: https://results.webkit.org/?suite=layout-tests&suite=layout-tests&test=webgl%2F2.0.0%2Fconformance%2Ftextures%2Fmisc%2Ftexture-upload-size.html&test=webgl%2F2.0.0%2Fconformance2%2Ftextures%2Fmisc%2Ftex-srgb-mipmap.html

The flaky crash seems to have started on EWS at:

webgl/2.0.0/conformance/textures/misc/texture-upload-size.html: https://ews-build.webkit.org/#/builders/56/builds/11131
webgl/2.0.0/conformance2/textures/misc/tex-srgb-mipmap.html: https://ews-build.webkit.org/#/builders/56/builds/12448

Crash log:

ASSERTION FAILED: !needsLayout()
./page/FrameView.cpp(4310) : virtual void WebCore::FrameView::paintContents(WebCore::GraphicsContext &, const WebCore::IntRect &, WebCore::Widget::SecurityOriginPaintPolicy, WebCore::EventRegionContext *)
1   0x1123186d9 WTFCrash
2   0x132b87aeb WTFCrashWithInfo(int, char const*, char const*, int)
3   0x136b1cb9b WebCore::FrameView::paintContents(WebCore::GraphicsContext&, WebCore::IntRect const&, WebCore::Widget::SecurityOriginPaintPolicy, WebCore::EventRegionContext*)
4   0x14df52277 -[WebFrame(WebInternal) _drawRect:contentsOnly:]
5   0x14df78216 -[WebHTMLView drawSingleRect:]
6   0x14df78931 -[WebHTMLView drawRect:]
7   0x7fff2f98559f _NSViewDrawRect
8   0x7fff2f9848ae -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:]
9   0x14df6b648 -[WebHTMLView(WebPrivate) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:]
10  0x7fff2f984c3f -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:]
11  0x7fff2f984c3f -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:]
12  0x7fff2f984c3f -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:]
13  0x7fff2fb19c58 -[NSView displayRectIgnoringOpacity:inContext:]
14  0x134e101ba WebCore::Widget::paint(WebCore::GraphicsContext&, WebCore::IntRect const&, WebCore::Widget::SecurityOriginPaintPolicy, WebCore::EventRegionContext*)
15  0x136d9cd2a WebCore::ScrollView::paint(WebCore::GraphicsContext&, WebCore::IntRect const&, WebCore::Widget::SecurityOriginPaintPolicy, WebCore::EventRegionContext*)
16  0x137814b3b WebCore::RenderWidget::paintContents(WebCore::PaintInfo&, WebCore::LayoutPoint const&)
17  0x137815467 WebCore::RenderWidget::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&)
18  0x13767e7ac WebCore::RenderLayer::paintForegroundForFragmentsWithPhase(WebCore::PaintPhase, WTF::Vector<WebCore::LayerFragment, 1ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&, WebCore::GraphicsContext&, WebCore::RenderLayer::LayerPaintingInfo const&, WTF::OptionSet<WebCore::PaintBehavior>, WebCore::RenderObject*)
19  0x13767c248 WebCore::RenderLayer::paintForegroundForFragments(WTF::Vector<WebCore::LayerFragment, 1ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc> const&, WebCore::GraphicsContext&, WebCore::GraphicsContext&, WebCore::LayoutRect const&, bool, WebCore::RenderLayer::LayerPaintingInfo const&, WTF::OptionSet<WebCore::PaintBehavior>, WebCore::RenderObject*)
20  0x137677cb7 WebCore::RenderLayer::paintLayerContents(WebCore::GraphicsContext&, WebCore::RenderLayer::LayerPaintingInfo const&, WTF::OptionSet<WebCore::RenderLayer::PaintLayerFlag>)
21  0x13769cc1d WebCore::RenderLayerBacking::paintIntoLayer(WebCore::GraphicsLayer const*, WebCore::GraphicsContext&, WebCore::IntRect const&, WTF::OptionSet<WebCore::PaintBehavior>, WebCore::EventRegionContext*)::$_24::operator()(WebCore::RenderLayer&, WTF::OptionSet<WebCore::RenderLayer::PaintLayerFlag>) const
22  0x13769c535 WebCore::RenderLayerBacking::paintIntoLayer(WebCore::GraphicsLayer const*, WebCore::GraphicsContext&, WebCore::IntRect const&, WTF::OptionSet<WebCore::PaintBehavior>, WebCore::EventRegionContext*)
23  0x13769da8c WebCore::RenderLayerBacking::paintContents(WebCore::GraphicsLayer const*, WebCore::GraphicsContext&, WebCore::FloatRect const&, unsigned int)
24  0x136f5f3ca WebCore::GraphicsLayer::paintGraphicsLayerContents(WebCore::GraphicsContext&, WebCore::FloatRect const&, unsigned int)
25  0x13701ca4f WebCore::GraphicsLayerCA::platformCALayerPaintContents(WebCore::PlatformCALayer*, WebCore::GraphicsContext&, WebCore::FloatRect const&, unsigned int)
26  0x1349b1500 WebCore::PlatformCALayer::drawLayerContents(WebCore::GraphicsContext&, WebCore::PlatformCALayer*, WTF::Vector<WebCore::FloatRect, 5ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&, unsigned int)
27  0x134b2521c -[WebLayer drawInContext:]
28  0x7fff3e07c86d CABackingStoreUpdate_
29  0x7fff3e0dc4ad invocation function for block in CA::Layer::display_()
30  0x7fff3e07bd86 -[CALayer _display]
31  0x134b2599b -[WebSimpleLayer display]
Comment 1 Radar WebKit Bug Importer 2021-08-26 11:34:18 PDT
<rdar://problem/82399990>
Comment 2 ayumi_kojima 2021-08-26 11:34:54 PDT
Created attachment 436538 [details]
Crash log
Comment 3 ayumi_kojima 2021-08-26 11:40:48 PDT
Updated test expectations https://trac.webkit.org/changeset/281637/webkit
Comment 4 ayumi_kojima 2021-08-31 13:57:52 PDT
I was able to reproduce the crash on BigSur arm64 using: run-webkit-tests --iterations 50 --exit-after-n-crashes-or-timeouts 1 webgl/2.0.0/conformance/textures/misc/texture-upload-size.html -1 --debug
Comment 5 ayumi_kojima 2021-09-10 17:30:40 PDT
I was able to reproduce the crash on Catalina. The crash seems to have started somewhere between r242257 and r242309 (No revisions to test in-between).

With r242256 and older revisions, the test crashed but with a different stderr:
 
ERROR: invalid option: JSC_useSharedArrayBuffer=1
ERROR: invalid option: JSC_useKernTCSM=false
2021-09-10 16:56:36.239 DumpRenderTree[18484:908573] NetworkStorageDB:_openDBReadConnections: failed to open read connection to DB @ (null)/Cache.db.  Error=14. Cause=unable to open database file
2021-09-10 16:56:36.239 DumpRenderTree[18484:908573] CacheRead: unable to open cache files in (null)
2021-09-10 16:56:36.743 DumpRenderTree[18484:908573] *** WARNING: Method convertPointToBase: in class NSView is deprecated on 10.7 and later. It should not be used in new applications. 
ASSERTION FAILED: !needsLayout()
./page/FrameView.cpp(4199) : virtual void WebCore::FrameView::paintContents(WebCore::GraphicsContext &, const WebCore::IntRect &, WebCore::Widget::SecurityOriginPaintPolicy)
1   0x110207589 WTFCrash
2   0x11ce555fb WTFCrashWithInfo(int, char const*, char const*, int)
3   0x11fc844fd WebCore::FrameView::paintContents(WebCore::GraphicsContext&, WebCore::IntRect const&, WebCore::Widget::SecurityOriginPaintPolicy)
4   0x10ed6f400 -[WebFrame(WebInternal) _drawRect:contentsOnly:]
5   0x10edc8041 -[WebHTMLView drawSingleRect:]
6   0x10edc8778 -[WebHTMLView drawRect:]
7   0x7fff32b8259f _NSViewDrawRect
8   0x7fff32b818ae -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:]
9   0x7fff32b81c3f -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:]
10  0x7fff32b81c3f -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:]
11  0x7fff32b81c3f -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:]
12  0x7fff32d16c58 -[NSView displayRectIgnoringOpacity:inContext:]
13  0x11d8f5d2c WebCore::Widget::paint(WebCore::GraphicsContext&, WebCore::IntRect const&, WebCore::Widget::SecurityOriginPaintPolicy)
14  0x11fe679a3 WebCore::ScrollView::paint(WebCore::GraphicsContext&, WebCore::IntRect const&, WebCore::Widget::SecurityOriginPaintPolicy)
15  0x1205946cc WebCore::RenderWidget::paintContents(WebCore::PaintInfo&, WebCore::LayoutPoint const&)
16  0x120594f61 WebCore::RenderWidget::paint(WebCore::PaintInfo&, WebCore::LayoutPoint const&)
17  0x12045df23 WebCore::RenderLayer::paintForegroundForFragmentsWithPhase(WebCore::PaintPhase, WTF::Vector<WebCore::LayerFragment, 1ul, WTF::CrashOnOverflow, 16ul> const&, WebCore::GraphicsContext&, WebCore::RenderLayer::LayerPaintingInfo const&, WTF::OptionSet<WebCore::PaintBehavior>, WebCore::RenderObject*)
18  0x12045bcf6 WebCore::RenderLayer::paintForegroundForFragments(WTF::Vector<WebCore::LayerFragment, 1ul, WTF::CrashOnOverflow, 16ul> const&, WebCore::GraphicsContext&, WebCore::GraphicsContext&, WebCore::LayoutRect const&, bool, WebCore::RenderLayer::LayerPaintingInfo const&, WTF::OptionSet<WebCore::PaintBehavior>, WebCore::RenderObject*)
19  0x120457986 WebCore::RenderLayer::paintLayerContents(WebCore::GraphicsContext&, WebCore::RenderLayer::LayerPaintingInfo const&, WTF::OptionSet<WebCore::RenderLayer::PaintLayerFlag>)
20  0x120475f79 WebCore::RenderLayerBacking::paintIntoLayer(WebCore::GraphicsLayer const*, WebCore::GraphicsContext&, WebCore::IntRect const&, WTF::OptionSet<WebCore::PaintBehavior>, unsigned char)
21  0x120476511 WebCore::RenderLayerBacking::paintContents(WebCore::GraphicsLayer const*, WebCore::GraphicsContext&, unsigned char, WebCore::FloatRect const&, unsigned int)
22  0x11ff8ae17 WebCore::GraphicsLayer::paintGraphicsLayerContents(WebCore::GraphicsContext&, WebCore::FloatRect const&, unsigned int)
23  0x11fff338d WebCore::GraphicsLayerCA::platformCALayerPaintContents(WebCore::PlatformCALayer*, WebCore::GraphicsContext&, WebCore::FloatRect const&, unsigned int)
24  0x11d4fd2d4 WebCore::PlatformCALayer::drawLayerContents(CGContext*, WebCore::PlatformCALayer*, WTF::Vector<WebCore::FloatRect, 5ul, WTF::CrashOnOverflow, 16ul>&, unsigned int)
25  0x11d788e93 -[WebLayer drawInContext:]
26  0x7fff4127b86d CABackingStoreUpdate_
27  0x7fff412db4ad invocation function for block in CA::Layer::display_()
28  0x7fff4127ad86 -[CALayer _display]
29  0x11d78946b -[WebSimpleLayer display]
30  0x7fff41279e09 CA::Layer::display_if_needed(CA::Transaction*)
31  0x7fff41258106 CA::Context::commit_transaction(CA::Transaction*, double)
Comment 6 Kimmo Kinnunen 2021-09-13 01:15:45 PDT
So this appears to be an assertion due to WebGL test suite using iframes.
Since there are thousands of WebGL tests, the iframe related assertion is more likely to come during WebGL.

In the environment, iframes on WK1 runner (at least) seem to fail to layout.

It's unclear if this is related to WebGL, most likely not.

It's unclear if this is related to Catalina, or is this happening on Catalina only because the bots might be slower.

I'd propose to move this to CSS and Zalan to fix this in case he thinks this is a priority :)
Comment 7 Kimmo Kinnunen 2021-09-27 11:44:20 PDT
*** Bug 230835 has been marked as a duplicate of this bug. ***
Comment 8 Robert Jenner 2022-05-05 10:24:38 PDT
Pull request: https://github.com/WebKit/WebKit/pull/527
Comment 9 EWS 2022-05-05 10:28:01 PDT
Test gardening commit r293845 (250316@main): <https://commits.webkit.org/250316@main>

Reviewed commits have been landed. Closing PR #527 and removing active labels.
Comment 10 Brent Fulgham 2022-06-23 13:37:48 PDT
*** Bug 204029 has been marked as a duplicate of this bug. ***
Comment 11 Brent Fulgham 2022-06-23 13:49:24 PDT
*** Bug 217761 has been marked as a duplicate of this bug. ***