Bug 240707

Summary: REGRESSION(250571@main)[Win] "Exception thrown: read access violation. " in WTF::Thread::ThreadHolder::~ThreadHolder()
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: Web Template FrameworkAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: pvollan, webkit-bug-importer
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Fujii Hironori 2022-05-20 00:35:02 PDT
REGRESSION(250571@main)[WinCairo] "Exception thrown: read access violation. " in WTF::Thread::ThreadHolder::~ThreadHolder()

If I run WinCairo WK1 and WK2 with debugger attached, the following exception is thrown by browsing some sites.

Exception thrown: read access violation.
**_Val** was 0x188.

Callstack

WTF.dll!std::exchange<WTF::Thread::ClientData *,std::nullptr_t &>(WTF::Thread::ClientData * & _Val, void * & _New_val) Line 616	C++
WTF.dll!WTF::RawPtrTraits<WTF::Thread::ClientData>::exchange<std::nullptr_t>(WTF::Thread::ClientData * & ptr, void * && newValue) Line 41	C++
WTF.dll!WTF::RefPtr<WTF::Thread::ClientData,WTF::RawPtrTraits<WTF::Thread::ClientData>,WTF::DefaultRefDerefTraits<WTF::Thread::ClientData>>::operator=(void * __formal) Line 163	C++
WTF.dll!WTF::Thread::ThreadHolder::~ThreadHolder() Line 273	C++
WTF.dll!WTF::`dynamic atexit destructor for 's_threadHolder''()	C++
WTF.dll!__dyn_tls_dtor(void * __formal, const unsigned long dwReason, void * __formal) Line 119	C++
ntdll.dll!LdrpCallInitRoutine()	Unknown
ntdll.dll!LdrpCallTlsInitializers()	Unknown
ntdll.dll!LdrShutdownThread()	Unknown
ntdll.dll!RtlExitUserThread()	Unknown
KernelBase.dll!FreeLibraryAndExitThread()	Unknown
ucrtbase.dll!common_end_thread()	Unknown
ucrtbase.dll!thread_start<unsigned int (__cdecl*)(void *),1>()	Unknown
kernel32.dll!BaseThreadInitThunk()	Unknown
ntdll.dll!RtlUserThreadStart()	Unknown
Comment 1 Fujii Hironori 2022-05-20 00:37:18 PDT
Since 250571@main (Bug 240116).
Comment 2 Fujii Hironori 2022-05-20 00:54:12 PDT
I tested with AppleWin Release 250571@main, and confirmed it also has this bug.
https://build.webkit.org/#/builders/67/builds/11801
https://s3-us-west-2.amazonaws.com/archives.webkit.org/win-x86_64-release/250571@main.zip

I need to run MiniBrowser.exe with debugger atttached

> devenv -debugexe MiniBrowser.exe

If I run MiniBrowser.exe without debugger, it runs almost no problem.
The mouse cursor was indicating busy. Task Manager is showing Windows Problem Reporting process is spawn.
Comment 3 Yusuke Suzuki 2022-05-20 01:56:27 PDT
Pull request: https://github.com/WebKit/WebKit/pull/823
Comment 4 EWS 2022-05-20 02:17:40 PDT
Committed r294539 (250794@main): <https://commits.webkit.org/250794@main>

Reviewed commits have been landed. Closing PR #823 and removing active labels.