Bug 218671

Summary: [Debug] imported/w3c/web-platform-tests/html/canvas/element/path-objects/2d.path.ellipse.basics.html is asserting
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: CanvasAssignee: Nikos Mouchtaris <nmouchtaris>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, dino, esprehn+autocc, ews-watchlist, gyuyoung.kim, nmouchtaris, sabouhallawa, simon.fraser, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=218670
Attachments:
Description Flags
crash log
none
Patch
simon.fraser: review+
Fix for test asserting none

Description Chris Dumez 2020-11-06 13:46:07 PST
imported/w3c/web-platform-tests/html/canvas/element/path-objects/2d.path.ellipse.basics.html has been crashing in debug since its import:
ASSERTION FAILED: newStartAngle >= 0 && newStartAngle < 2 * piFloat
./html/canvas/CanvasPath.cpp(148) : void WebCore::normalizeAngles(float &, float &, bool)
1   0x109724fe9 WTFCrash
2   0x121d7ec9b WTFCrashWithInfo(int, char const*, char const*, int)
3   0x12510dcdc WebCore::normalizeAngles(float&, float&, bool)
4   0x12510df6b WebCore::CanvasPath::ellipse(float, float, float, float, float, float, float, bool)
5   0x122457623 WebCore::jsCanvasRenderingContext2DPrototypeFunction_ellipseBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSCanvasRenderingContext2D*)
6   0x122456b8c long long WebCore::IDLOperation<WebCore::JSCanvasRenderingContext2D>::call<&(WebCore::jsCanvasRenderingContext2DPrototypeFunction_ellipseBody(JSC::JSGlobalObject*, JSC::CallFrame*, WebCore::JSCanvasRenderingContext2D*)), (WebCore::CastedThisErrorBehavior)0>(JSC::JSGlobalObject&, JSC::CallFrame&, char const*)
7   0x1223ec674 WebCore::jsCanvasRenderingContext2DPrototypeFunction_ellipse(JSC::JSGlobalObject*, JSC::CallFrame*)
8   0x5204d3201178
9   0x109cdcd0b llint_entry
10  0x109cde079 llint_entry
11  0x109cdcd0b llint_entry
12  0x109cde079 llint_entry
13  0x109cdcd0b llint_entry
14  0x109cbb5a0 vmEntryToJavaScript
15  0x10ab0338b JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
16  0x10ab03b47 JSC::Interpreter::executeCall(JSC::JSGlobalObject*, JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
17  0x10ae50abd JSC::call(JSC::JSGlobalObject*, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
18  0x10ae50b9f JSC::call(JSC::JSGlobalObject*, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&)
19  0x10ae50e82 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&)
20  0x1244d3a7e WebCore::JSExecState::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&)
21  0x1244f18eb WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext&, WebCore::Event&)
22  0x124bb3e57 WebCore::EventTarget::innerInvokeEventListeners(WebCore::Event&, WTF::Vector<WTF::RefPtr<WebCore::RegisteredEventListener, WTF::RawPtrTraits<WebCore::RegisteredEventListener>, WTF::DefaultRefDerefTraits<WebCore::RegisteredEventListener> >, 1ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::EventTarget::EventInvokePhase)
23  0x124bb0164 WebCore::EventTarget::fireEventListeners(WebCore::Event&, WebCore::EventTarget::EventInvokePhase)
24  0x12580195e WebCore::DOMWindow::dispatchEvent(WebCore::Event&, WebCore::EventTarget*)
25  0x12580b9cf WebCore::DOMWindow::dispatchLoadEvent()
26  0x124a9ca38 WebCore::Document::dispatchWindowLoadEvent()
27  0x124a9c5a7 WebCore::Document::implicitClose()
28  0x12567375b WebCore::FrameLoader::checkCallImplicitClose()
29  0x12567318a WebCore::FrameLoader::checkCompleted()
30  0x125673216 WebCore::FrameLoader::loadDone(WebCore::LoadCompletionType)
31  0x125789a2c WebCore::CachedResourceLoader::loadDone(WebCore::LoadCompletionType, bool)
Comment 1 Ryan Haddad 2020-11-10 09:25:46 PST
Created attachment 413706 [details]
crash log
Comment 3 Radar WebKit Bug Importer 2020-11-13 13:47:15 PST
<rdar://problem/71384311>
Comment 4 Nikos Mouchtaris 2021-10-28 10:49:07 PDT
Created attachment 442719 [details]
Patch
Comment 5 Simon Fraser (smfr) 2021-10-28 11:20:12 PDT
Comment on attachment 442719 [details]
Patch

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

> Source/WebCore/html/canvas/CanvasPath.cpp:148
> +    ASSERT(newStartAngle >= 0 && (newStartAngle < 2 * piFloat || WTF::areEssentiallyEqual<float>(newStartAngle, 2 * piFloat)));

Maybe we need an "approximately less than" helper?
Comment 6 Nikos Mouchtaris 2021-10-28 12:08:50 PDT
Created attachment 442727 [details]
Fix for test asserting
Comment 7 EWS 2021-10-28 13:22:31 PDT
Committed r284996 (243642@main): <https://commits.webkit.org/243642@main>

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