Repository navigation
Fix constant Safari crashes due to browser's CSS selector parsing bug - #7252
Conversation
fregante
commented
Feb 8, 2024
- Thankfully fixes Safari: Refined GitHub v24.2.2 causes constant crashing #7251
| } | ||
| .rgh-pr-cell > [class*='Box'] { | ||
| /* Drop forced height on pre-existing cell */ | ||
| height: auto; |
There was a problem hiding this comment.
@xeenon are you aware of any bugs around nested selector parsing? Perhaps related to Web Extensions?
I just re-tested this on Safari Version 17.5 (19618.2.12.11.6) and I'm still consistently getting tab crashes:
It's a bit hard to recreate the bug outside Refined GitHub, I'm not able to do it even if I get GitHub's whole HTML and load the whole stylesheet in a CodePen. It might be related to extensions.
Here's the built extension at this point in time (February 7th, 2024): Refined GitHub.zip
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000020
Exception Codes: 0x0000000000000001, 0x0000000000000020
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [89568]
VM Region Info: 0x20 is not in any region. Bytes before following region: 4368121824
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 1045c4000-1045c8000 [ 16K] r-x/r-x SM=COW /System/Volumes/Preboot/Cryptexes/Incoming/OS/System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 WebCore 0x1a516aba8 WebCore::SelectorChecker::attributeSelectorMatches(WebCore::Element const&, WebCore::QualifiedName const&, WTF::AtomString const&, WebCore::CSSSelector const&) + 352
1 WebCore 0x1a6137c18 WebCore::Style::AttributeChangeInvalidation::invalidateStyle(WebCore::QualifiedName const&, WTF::AtomString const&, WTF::AtomString const&) + 3388
2 WebCore 0x1a5322a8c WebCore::Element::setAttributeInternal(unsigned int, WebCore::QualifiedName const&, WTF::AtomString const&, WebCore::Element::InSynchronizationOfLazyAttribute) + 584
3 WebCore 0x1a55528c0 WebCore::DOMTokenList::updateAssociatedAttributeFromTokens() + 392
4 WebCore 0x1a55520ac WebCore::DOMTokenList::addInternal(WTF::AtomString const*, unsigned long) + 360
5 WebCore 0x1a41456b4 WebCore::jsDOMTokenListPrototypeFunction_add(JSC::JSGlobalObject*, JSC::CallFrame*) + 356
6 ??? 0x1142643e4 ???
7 ??? 0x114264414 ???
8 ??? 0x114008428 ???
9 JavaScriptCore 0x1a0a3c384 JSC::Interpreter::executeCall(JSC::JSObject*, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 612
10 JavaScriptCore 0x1a0be5064 JSC::profiledCall(JSC::JSGlobalObject*, JSC::ProfilingReason, JSC::JSValue, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) + 120
11 WebCore 0x1a4f86714 WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext&, WebCore::Event&) + 1100
12 WebCore 0x1a5352e34 WebCore::EventTarget::innerInvokeEventListeners(WebCore::Event&, WTF::Vector<WTF::RefPtr<WebCore::RegisteredEventListener, WTF::RawPtrTraits<WebCore::RegisteredEventListener>, WTF::DefaultRefDerefTraits<WebCore::RegisteredEventListener>>, 1ul, WTF::CrashOnOverflow, 2ul, WTF::FastMalloc>, WebCore::EventTarget::EventInvokePhase) + 528
13 WebCore 0x1a5352a6c WebCore::EventTarget::fireEventListeners(WebCore::Event&, WebCore::EventTarget::EventInvokePhase) + 408
14 WebCore 0x1a5347824 WebCore::dispatchEventInDOM(WebCore::Event&, WebCore::EventPath const&) + 2488
15 WebCore 0x1a5345a0c WebCore::EventDispatcher::dispatchEvent(WebCore::Node&, WebCore::Event&) + 1140
16 WebCore 0x1a4f167e0 WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents(WTF::Seconds) + 4256
17 WebCore 0x1a5a8f638 WTF::Detail::CallableWrapper<WebCore::Page::updateRendering()::$_31, void, WebCore::Document&>::call(WebCore::Document&) + 80
18 WebCore 0x1a5a7bfb4 WebCore::Page::updateRendering()::$_24::operator()(WebCore::RenderingUpdateStep, WTF::Function<void (WebCore::Document&)> const&) const + 344
19 WebCore 0x1a5a7aedc WebCore::Page::updateRendering() + 1032
20 WebKit 0x1a714d580 WebKit::RemoteLayerTreeDrawingArea::updateRendering() + 144
21 WebCore 0x1a5b7b7f0 WTF::Detail::CallableWrapper<WebCore::ThreadTimers::setSharedTimer(WebCore::SharedTimer*)::$_0, void>::call() + 196
22 WebCore 0x1a3ac19a8 WebCore::timerFired(__CFRunLoopTimer*, void*) + 68
23 CoreFoundation 0x183a4e5b8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
24 CoreFoundation 0x183a4e25c __CFRunLoopDoTimer + 972
25 CoreFoundation 0x183a4dd94 __CFRunLoopDoTimers + 356
26 CoreFoundation 0x183a311cc __CFRunLoopRun + 1856
27 CoreFoundation 0x183a30434 CFRunLoopRunSpecific + 608
28 Foundation 0x184b64a88 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
29 Foundation 0x184bde6c4 -[NSRunLoop(NSRunLoop) run] + 64
30 libxpc.dylib 0x18366b468 _xpc_objc_main + 684
31 libxpc.dylib 0x18367ae58 _xpc_main + 324
32 libxpc.dylib 0x18366b014 xpc_main + 64
33 WebKit
0x1a722b858 WebKit::XPCServiceMain(int, char const**) + 68
34 dyld 0x1835ca0e0 start + 2360
There was a problem hiding this comment.
Done, thank you! https://bugs.webkit.org/show_bug.cgi?id=276942
I was about to open a bug there but the website mentioned "WebKit is not Safari!" on the homepage, so I wasn't sure where to report it.