Bug 296895

Summary: AX: fix broken and expensive ASSERTS in accessibility code
Product: WebKit Reporter: Dominic Mazzoni <dm_mazzoni>
Component: AccessibilityAssignee: Dominic Mazzoni <dm_mazzoni>
Status: RESOLVED FIXED    
Severity: Normal CC: andresg_22, philn, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   

Dominic Mazzoni
Reported 2025-08-04 13:45:52 PDT
We have ~100 ASSERTS in WebCore/accessibility, and of those I found 6 that are broken - they're asserting on live pages - and about 10 that are called way too often, hundreds of thousands of times per minute. If we sequester those - the broken ones and the ones called way too often - we'll be able to run release builds with assertions enabled all of the time.
Attachments
Radar WebKit Bug Importer
Comment 1 2025-08-04 13:45:59 PDT
Dominic Mazzoni
Comment 2 2025-08-04 13:56:51 PDT
EWS
Comment 3 2025-08-05 13:04:55 PDT
Committed 298252@main (ab66a869bd96): <https://commits.webkit.org/298252@main> Reviewed commits have been landed. Closing PR #48918 and removing active labels.
Philippe Normand
Comment 4 2025-08-06 07:12:25 PDT
This introduced new clang linux warnings: In file included from /var/home/phil/WebKit/local-build-gtk/WebKitBuild/GTK/Release/WebCore/DerivedSources/unified-sources/UnifiedSource-aba958d6-3.cpp:7: /var/home/phil/WebKit/Source/WebCore/accessibility/AccessibilityObject.cpp:730:18: warning: address of function 'isAccessibilityLogChannelEnabled' will always evaluate to 'true' [-Wpointer-bool-conversion] 730 | do { if (isAccessibilityLogChannelEnabled) { do { if (__builtin_expect(!!(!(isTableComponent(child) || isTableComponent(*this) || child.parentObject() == this)), 0)) do { if (LogAccessibility.state != WTFLogChannelState::Off) sd_journal_send_with_location("CODE_FILE=" "/var/home/phil/WebKit/Source/WebCore/accessibility/AccessibilityObject.cpp", "CODE_LINE=" "730", __func__, "WEBKIT_SUBSYSTEM=" "WebKitGTK", "WEBKIT_CHANNEL=%s", LogAccessibility.name, "PRIORITY=%i", 3, "MESSAGE=" "BROKEN ASSERTION FAILED in %s(%d) : %s\n", "/var/home/phil/WebKit/Source/WebCore/accessibility/AccessibilityObject.cpp", 730, __PRETTY_FUNCTION__, nullptr); } while (0); } while (0); } } while (0); | ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/home/phil/WebKit/Source/WebCore/accessibility/AccessibilityObject.cpp:730:18: note: prefix with the address-of operator to silence this warning 730 | do { if (isAccessibilityLogChannelEnabled) { do { if (__builtin_expect(!!(!(isTableComponent(child) || isTableComponent(*this) || child.parentObject() == this)), 0)) do { if (LogAccessibility.state != WTFLogChannelState::Off) sd_journal_send_with_location("CODE_FILE=" "/var/home/phil/WebKit/Source/WebCore/accessibility/AccessibilityObject.cpp", "CODE_LINE=" "730", __func__, "WEBKIT_SUBSYSTEM=" "WebKitGTK", "WEBKIT_CHANNEL=%s", LogAccessibility.name, "PRIORITY=%i", 3, "MESSAGE=" "BROKEN ASSERTION FAILED in %s(%d) : %s\n", "/var/home/phil/WebKit/Source/WebCore/accessibility/AccessibilityObject.cpp", 730, __PRETTY_FUNCTION__, nullptr); } while (0); } while (0); } } while (0); | ^ | & /var/home/phil/WebKit/Source/WebCore/accessibility/AccessibilityObject.cpp:730:18: note: suffix with parentheses to turn this into a function call 730 | do { if (isAccessibilityLogChannelEnabled) { do { if (__builtin_expect(!!(!(isTableComponent(child) || isTableComponent(*this) || child.parentObject() == this)), 0)) do { if (LogAccessibility.state != WTFLogChannelState::Off) sd_journal_send_with_location("CODE_FILE=" "/var/home/phil/WebKit/Source/WebCore/accessibility/AccessibilityObject.cpp", "CODE_LINE=" "730", __func__, "WEBKIT_SUBSYSTEM=" "WebKitGTK", "WEBKIT_CHANNEL=%s", LogAccessibility.name, "PRIORITY=%i", 3, "MESSAGE=" "BROKEN ASSERTION FAILED in %s(%d) : %s\n", "/var/home/phil/WebKit/Source/WebCore/accessibility/AccessibilityObject.cpp", 730, __PRETTY_FUNCTION__, nullptr); } while (0); } while (0); } } while (0); | ^ | () 1 warning generated. In file included from /var/home/phil/WebKit/local-build-gtk/WebKitBuild/GTK/Release/WebCore/DerivedSources/unified-sources/UnifiedSource-aba958d6-1.cpp:5: /var/home/phil/WebKit/Source/WebCore/accessibility/AXObjectCache.cpp:1045:14: warning: address of function 'isAccessibilityLogChannelEnabled' will always evaluate to 'true' [-Wpointer-bool-conversion] 1045 | do { if (isAccessibilityLogChannelEnabled) { do { if (__builtin_expect(!!(!(!get(renderer))), 0)) do { if (LogAccessibility.state != WTFLogChannelState::Off) sd_journal_send_with_location("CODE_FILE=" "/var/home/phil/WebKit/Source/WebCore/accessibility/AXObjectCache.cpp", "CODE_LINE=" "1045", __func__, "WEBKIT_SUBSYSTEM=" "WebKitGTK", "WEBKIT_CHANNEL=%s", LogAccessibility.name, "PRIORITY=%i", 3, "MESSAGE=" "BROKEN ASSERTION FAILED in %s(%d) : %s\n", "/var/home/phil/WebKit/Source/WebCore/accessibility/AXObjectCache.cpp", 1045, __PRETTY_FUNCTION__, nullptr); } while (0); } while (0); } } while (0); | ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/home/phil/WebKit/Source/WebCore/accessibility/AXObjectCache.cpp:1045:14: note: prefix with the address-of operator to silence this warning 1045 | do { if (isAccessibilityLogChannelEnabled) { do { if (__builtin_expect(!!(!(!get(renderer))), 0)) do { if (LogAccessibility.state != WTFLogChannelState::Off) sd_journal_send_with_location("CODE_FILE=" "/var/home/phil/WebKit/Source/WebCore/accessibility/AXObjectCache.cpp", "CODE_LINE=" "1045", __func__, "WEBKIT_SUBSYSTEM=" "WebKitGTK", "WEBKIT_CHANNEL=%s", LogAccessibility.name, "PRIORITY=%i", 3, "MESSAGE=" "BROKEN ASSERTION FAILED in %s(%d) : %s\n", "/var/home/phil/WebKit/Source/WebCore/accessibility/AXObjectCache.cpp", 1045, __PRETTY_FUNCTION__, nullptr); } while (0); } while (0); } } while (0); | ^ | & /var/home/phil/WebKit/Source/WebCore/accessibility/AXObjectCache.cpp:1045:14: note: suffix with parentheses to turn this into a function call 1045 | do { if (isAccessibilityLogChannelEnabled) { do { if (__builtin_expect(!!(!(!get(renderer))), 0)) do { if (LogAccessibility.state != WTFLogChannelState::Off) sd_journal_send_with_location("CODE_FILE=" "/var/home/phil/WebKit/Source/WebCore/accessibility/AXObjectCache.cpp", "CODE_LINE=" "1045", __func__, "WEBKIT_SUBSYSTEM=" "WebKitGTK", "WEBKIT_CHANNEL=%s", LogAccessibility.name, "PRIORITY=%i", 3, "MESSAGE=" "BROKEN ASSERTION FAILED in %s(%d) : %s\n", "/var/home/phil/WebKit/Source/WebCore/accessibility/AXObjectCache.cpp", 1045, __PRETTY_FUNCTION__, nullptr); } while (0); } while (0); } } while (0); | ^ | () In file included from /var/home/phil/WebKit/local-build-gtk/WebKitBuild/GTK/Release/WebCore/DerivedSources/unified-sources/UnifiedSource-aba958d6-1.cpp:7: /var/home/phil/WebKit/Source/WebCore/accessibility/AXSearchManager.cpp:246:18: warning: address of function 'isAccessibilityLogChannelEnabled' will always evaluate to 'true' [-Wpointer-bool-conversion] 246 | do { if (isAccessibilityLogChannelEnabled) { do { if (__builtin_expect(!!(!(is<AccessibilityObject>(startObject))), 0)) do { if (LogAccessibility.state != WTFLogChannelState::Off) sd_journal_send_with_location("CODE_FILE=" "/var/home/phil/WebKit/Source/WebCore/accessibility/AXSearchManager.cpp", "CODE_LINE=" "246", __func__, "WEBKIT_SUBSYSTEM=" "WebKitGTK", "WEBKIT_CHANNEL=%s", LogAccessibility.name, "PRIORITY=%i", 3, "MESSAGE=" "BROKEN ASSERTION FAILED in %s(%d) : %s\n", "/var/home/phil/WebKit/Source/WebCore/accessibility/AXSearchManager.cpp", 246, __PRETTY_FUNCTION__, nullptr); } while (0); } while (0); } } while (0); | ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /var/home/phil/WebKit/Source/WebCore/accessibility/AXSearchManager.cpp:246:18: note: prefix with the address-of operator to silence this warning 246 | do { if (isAccessibilityLogChannelEnabled) { do { if (__builtin_expect(!!(!(is<AccessibilityObject>(startObject))), 0)) do { if (LogAccessibility.state != WTFLogChannelState::Off) sd_journal_send_with_location("CODE_FILE=" "/var/home/phil/WebKit/Source/WebCore/accessibility/AXSearchManager.cpp", "CODE_LINE=" "246", __func__, "WEBKIT_SUBSYSTEM=" "WebKitGTK", "WEBKIT_CHANNEL=%s", LogAccessibility.name, "PRIORITY=%i", 3, "MESSAGE=" "BROKEN ASSERTION FAILED in %s(%d) : %s\n", "/var/home/phil/WebKit/Source/WebCore/accessibility/AXSearchManager.cpp", 246, __PRETTY_FUNCTION__, nullptr); } while (0); } while (0); } } while (0); | ^ | & /var/home/phil/WebKit/Source/WebCore/accessibility/AXSearchManager.cpp:246:18: note: suffix with parentheses to turn this into a function call 246 | do { if (isAccessibilityLogChannelEnabled) { do { if (__builtin_expect(!!(!(is<AccessibilityObject>(startObject))), 0)) do { if (LogAccessibility.state != WTFLogChannelState::Off) sd_journal_send_with_location("CODE_FILE=" "/var/home/phil/WebKit/Source/WebCore/accessibility/AXSearchManager.cpp", "CODE_LINE=" "246", __func__, "WEBKIT_SUBSYSTEM=" "WebKitGTK", "WEBKIT_CHANNEL=%s", LogAccessibility.name, "PRIORITY=%i", 3, "MESSAGE=" "BROKEN ASSERTION FAILED in %s(%d) : %s\n", "/var/home/phil/WebKit/Source/WebCore/accessibility/AXSearchManager.cpp", 246, __PRETTY_FUNCTION__, nullptr); } while (0); } while (0); } } while (0); | ^ | () 2 warnings generated.
Philippe Normand
Comment 5 2025-08-06 07:18:07 PDT
Note You need to log in before you can comment on or make changes to this bug.