ultralight-ux / Ultralight

Lightweight, high-performance HTML renderer for game and app developers.
https://ultralig.ht
4.69k stars 197 forks source link

Crash when trying to search in web inspector #459

Open p0358 opened 1 year ago

p0358 commented 1 year ago

Trying to search in inspector, no matter if in the top-right search bar, of when using the search bar that appears when you click Ctrl+F in the Elements view, results in whole app crash. Stacktrace below, although its usefulness is probably limited without PDBs.

WebCore!WebCore::RenderObject::hasNonEmptyVisibleRectRespectingParentFrames+0x8fa1
WebCore!WebCore::PluginDocument::pluginWidget+0x46e7
WebCore!WebCore::HTMLInputElement::setValueAsNumber+0x383
WebCore!WebCore::Event::initEvent+0xb35
WebCore!WebCore::EventHandler::dragSourceEndedAt+0xda8
WebCore!WebCore::Editor::insertEditableImage+0x290c
WebCore!WebCore::Editor::Command::execute+0x20
Ultralight!ultralight::JSContext::operator OpaqueJSContext const * __ptr64+0xfdb
Ultralight!ultralight::JSContext::operator OpaqueJSContext const * __ptr64+0x4c2e
WebCore!WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility+0x382
WebCore!WebCore::Node::dispatchInputEvent+0x7c6
WebCore!WebCore::HTMLInputElement::setValueAsNumber+0x28e
WebCore!WebCore::Event::initEvent+0xb35
WebCore!WebCore::EventHandler::capsLockStateMayHaveChanged+0x77b
WebCore!WebCore::EventHandler::keyEvent+0xc0
Ultralight!ultralight::JSContext::operator OpaqueJSContext const * __ptr64+0x9fb
AppCore!ultralight::Overlay::Create+0xe8d
AppCore!ultralight::Window::Create+0x15c
AppCore!ultralight::Window::Create+0x919
user32!UserCallWinProcCheckWow+0x2f8
user32!DispatchMessageWorker+0x249
AppCore!ultralight::App::Create+0x36d
p0358 commented 1 year ago

I have proper PDBs now, so may as well paste proper stack trace for this issue now:

FILE_IN_CAB:  inspector.exe.51612.dmp

NTGLOBALFLAG:  0

APPLICATION_VERIFIER_FLAGS:  0

CONTEXT:  (.ecxr)
rax=0000046a860b0c60 rbx=0000000000000001 rcx=0000000000000000
rdx=0000046a75e61138 rsi=0000046a860b0c68 rdi=0000046a860b0b40
rip=00007fff515ebf79 rsp=00000050b76feb80 rbp=0000046a75e61138
 r8=0000046a860b0c68  r9=0000046a7401ed00 r10=0000000000000005
r11=0000046a75e61130 r12=0000000000000000 r13=0000046a741e58c8
r14=0000000000000000 r15=0000046a742b1000
iopl=0         nv up ei pl zr na po nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
WebCore!WebCore::RenderSearchField::addSearchResult+0x1e9:
00007fff`515ebf79 488b01          mov     rax,qword ptr [rcx] ds:00000000`00000000=????????????????
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00007fff515ebf79 (WebCore!WebCore::RenderSearchField::addSearchResult+0x00000000000001e9)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000000
   Parameter[1]: 0000000000000000
Attempt to read from address 0000000000000000

PROCESS_NAME:  inspector.exe

READ_ADDRESS:  0000000000000000 

ERROR_CODE: (NTSTATUS) 0xc0000005 - Instrukcja w 0x%p odwo a a si  do pami ci pod adresem 0x%p. Pami   nie mo e by  %s.

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  0000000000000000

EXCEPTION_PARAMETER2:  0000000000000000

STACK_TEXT:  
00000050`b76feb80 00007fff`50de5537     : 0000046a`80886860 0000046a`75e61500 0000046a`80886800 00000050`b76feee0 : WebCore!WebCore::RenderSearchField::addSearchResult+0x1e9
00000050`b76febf0 00007fff`50d3f9b3     : 0000046a`80886860 0000046a`00000000 0000046a`80886878 0000046a`80886860 : WebCore!WebCore::SearchInputType::addSearchResult+0x67
00000050`b76fec20 00007fff`50aed5e7     : 0000046a`80886860 0000046a`80886860 0000046a`75e61500 0000daa8`752e2c70 : WebCore!WebCore::HTMLInputElement::defaultEventHandler+0x1e3
00000050`b76fec50 00007fff`50aee13d     : 0000046a`75e61500 0000046a`80886860 00000050`b76fed80 00007fff`52170699 : WebCore!WebCore::callDefaultEventHandlersInBubblingOrder+0x37
00000050`b76fec80 00007fff`511345a0     : 0000046a`74032300 00000000`00000000 00000000`00000000 0000046a`75e61500 : WebCore!WebCore::EventDispatcher::dispatchEvent+0x20d
00000050`b76fee10 00007fff`50c166df     : 0000046a`74156040 00007fff`50c1501a 0000046a`742f5400 0000046a`808850a0 : WebCore!WebCore::EventHandler::handleTextInputEvent+0xf0
00000050`b76feea0 00007fff`50c150ac     : 0000046a`74156040 00000050`b76fef60 0000046b`4a02a1c0 0000046a`741e58c0 : WebCore!WebCore::executeInsertNewline+0x5f
00000050`b76feee0 00007fff`57c5ae7f     : 0000046a`74156040 0000046b`4a02a1c0 00000000`00000000 0000046a`808850a0 : WebCore!WebCore::Editor::Command::execute+0x1c
00000050`b76fef10 00007fff`57c5eb42     : 00000050`b76ff020 0000046a`74020300 0000046a`808850a0 0000046a`741e58c0 : Ultralight!ultralight::JSContext::operator OpaqueJSContext const * __ptr64+0xfdb
00000050`b76fef80 00007fff`511282e3     : 00000000`00000000 0000046a`74020300 0000046a`742c2110 00007ff8`10cc0ddb : Ultralight!ultralight::JSContext::operator OpaqueJSContext const * __ptr64+0x4c9e
00000050`b76fefb0 00007fff`50b33d9f     : 0000046a`808850a0 0000046a`74020300 0000046a`741e58c8 0000046a`742f5400 : WebCore!WebCore::EventHandler::defaultKeyboardEventHandler+0x1a3
00000050`b76ff030 00007fff`50d3f8cd     : 0000046a`808850a0 0000046a`742b1000 0000046a`741e58c8 00007fff`50aee921 : WebCore!WebCore::Node::defaultEventHandler+0x2df
00000050`b76ff060 00007fff`50aed5e7     : 0000046a`808850a0 0000046a`808850a0 0000046a`75e61500 0000daa8`752e30b0 : WebCore!WebCore::HTMLInputElement::defaultEventHandler+0xfd
00000050`b76ff090 00007fff`50aee13d     : 0000046a`75e61500 0000046a`808850a0 00000050`b76ff1c0 00000050`b76ff199 : WebCore!WebCore::callDefaultEventHandlersInBubblingOrder+0x37
00000050`b76ff0c0 00007fff`50acbc98     : 00000050`b76ff560 0000046a`74032300 0000046a`74589f90 0000046a`74032300 : WebCore!WebCore::EventDispatcher::dispatchEvent+0x20d
00000050`b76ff250 00007fff`51136b85     : 00000000`00000000 0000046a`75e61500 0000046a`75e61500 00000050`b76ff3d0 : WebCore!WebCore::Element::dispatchKeyEvent+0xb8
00000050`b76ff2a0 00007fff`511384ac     : 00000050`b76ff580 00007fff`584f6cb6 00000050`b76ff560 000035a2`00000000 : WebCore!WebCore::EventHandler::internalKeyEvent+0x675
00000050`b76ff440 00007fff`57c5a89f     : 00000000`00000000 00000050`b76ff580 00000050`b76ff6a0 00000000`00000004 : WebCore!WebCore::EventHandler::keyEvent+0x7c
00000050`b76ff480 00007fff`6a148a1d     : 00000000`00000000 000035a2`793638ff 00000050`b76ff6a0 00000000`00000000 : Ultralight!ultralight::JSContext::operator OpaqueJSContext const * __ptr64+0x9fb
00000050`b76ff600 00007fff`6a14d52c     : 00000243`ef1dc1a0 00000000`0000000d 00000000`001c0001 00000243`f9c951f0 : AppCore!ultralight::Overlay::Create+0xe8d
00000050`b76ff630 00007fff`6a14dd39     : 00000243`f9c951f0 00000000`001c0001 00000000`0a5b284a 00000243`0000000d : AppCore!ultralight::Window::Create+0x15c
00000050`b76ff660 00007ff8`1295e858     : 00000000`00000000 00000000`00000001 00000000`00000001 00000000`00000000 : AppCore!ultralight::Window::Create+0x969
00000050`b76ff7b0 00007ff8`1295e299     : 00000000`00003dff 00007fff`6a14db00 00000000`0a5b284a 00000243`00000102 : user32!UserCallWinProcCheckWow+0x2f8
00000050`b76ff940 00007fff`6a14a81d     : 00007fff`6a14db00 0001e5ba`64ef84bc 00000243`f77f3c80 00000000`00000000 : user32!DispatchMessageWorker+0x249
00000050`b76ff9c0 00007ff7`8aef18b9     : 00000000`00000000 00000000`00000001 00000000`00000000 00000000`00000000 : AppCore!ultralight::App::Create+0x36d
00000050`b76ffa40 00007ff7`8aef1b7e     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : inspector+0x18b9
00000050`b76ffad0 00007ff8`12547614     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : inspector+0x1b7e
00000050`b76ffb10 00007ff8`134c26f1     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x14
00000050`b76ffb40 00000000`00000000     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21

STACK_COMMAND:  ~0s; .ecxr ; kb

FAULTING_SOURCE_LINE:  Source\WebCore\rendering\RenderSearchField.cpp

FAULTING_SOURCE_FILE:  Source\WebCore\rendering\RenderSearchField.cpp

FAULTING_SOURCE_LINE_NUMBER:  112

FAULTING_SOURCE_CODE:  
   108:     const AtomString& name = autosaveName();
   109:     if (!m_searchPopup)
   110:         m_searchPopup = page().chrome().createSearchPopupMenu(*this);
   111: 
>  112:     m_searchPopup->saveRecentSearches(name, m_recentSearches);
   113: }
   114: 
   115: void RenderSearchField::showPopup()
   116: {
   117:     if (m_searchPopupIsVisible)

SYMBOL_NAME:  WebCore!WebCore::RenderSearchField::addSearchResult+1e9

MODULE_NAME: WebCore

IMAGE_NAME:  WebCore.dll

FAILURE_BUCKET_ID:  NULL_POINTER_READ_c0000005_WebCore.dll!WebCore::RenderSearchField::addSearchResult

I therefore hereby repeat my plea to always publish PDBs :)

I imagine you can just comment out saveRecentSearches() call, whatever reason might it be failing for... (it might be actually cause I use JS-based popup menus (from my other PR that's yet to be merged!!!!!!), so they don't have this method then probably?)

JohnKlenk commented 3 weeks ago

Still happens in the latest 1.4.