Closed reynoldslabware closed 1 year ago
I've confirmed that my call to set up the environment is on the UI by using the API BOOL IsGUIThread( [in] BOOL bConvert ); Any thoughts on what's going on? Working in 6 minute intervals is really painful ;-)
This problem still exists in the 116 and the just released 117 runtimes!
Could you please collect and share traces when issue occurs - https://github.com/MicrosoftEdge/WebView2Feedback/blob/main/diagnostics/etw.md But use profile https://github.com/MicrosoftEdge/WebView2Feedback/blob/main/diagnostics/WebView2.wprp not the CPU one.
When the hang happens, if you attach debugger to the process, you should be able to see the stack of threads and find out clues of why it hangs. For the mysterious file access entry in procmon log, what is the stack that doing the QueryDirectory?
Thank you for the suggestions. I downloaded the WebView2.wprp and placed it in my applicatiion folder. I opened a command console as administrator. I ran C:\webView2> wpr -start WebView2.wprp -filemode
I opened my win32 application. At startup it calls webview2 setup. I waiting for just over 6 minutes. My application was non responsive. In the command console I ran C:\webView2> wpr -stop trace.etl "trace" Cannot change thread mode after it is set. Profile Id: RunningProfile Error code: 0x80010106
Please advise.
sounds like you need a newer version of the wpr tools.
I downloaded adksetup.exe and installed the windows performance and analyzer tools The result is the same.
FYI to cross reference wpr version. Directory of C:\Windows\System32 12/07/2019 05:08 AM 724 wpr.config.xml 03/30/2022 03:31 PM 321,024 wpr.exe
Running wpr directly matches up (in case some odd PATH issue was invovled).
C:\Windows\System32>wpr Microsoft Windows Performance Recorder Version 10.0.19041 (CoreSystem) Copyright (c) 2019 Microsoft Corporation. All rights reserved.
In Windows Explorer the wpr.exe properties show File version 10.0.19041.746
@reynoldslabware 6 min of recording is probably too big - could you start wpr
like 30 sec before the issue reproes if it is exactly 6 min after start?
The ADK installer dialog shows Windows Assessment and deployment Kit - Windows 10
Once installed I opened a console as administrator (the title bar has Administrator cmd.exe). There is no change in the wpr version output above. Microsoft Windows Performance Recorder Version 10.0.19041 (CoreSystem)
Retesting wise, waiting until prior to the 6 minute mark to start and then stop wpr has the same result as before.
Cannot change thread mode after it is set. Profile Id: RunningProfile Error code: 0x80010106
https://devblogs.microsoft.com/performance-diagnostics/wpr-start-and-stop-commands/ says that you need build 19650 or later
Thanks for the pointer. I downloaded the ISO and installed it. I also eventually found where it installed the code. Microsoft Windows Performance Recorder Version 10.0.25951 (CoreSystem) Copyright (c) 2023 Microsoft Corporation. All rights reserved.
I adjusted my path path="C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit";%PATH%
The trace saved properly now. It is 100MB. Suggestions on next step?
Deleted message
have looked into traces - have not found the root cause - see only that wv2 creation starts but never finishes. Could you do dumps as Liang suggested - app process and msedgewebview2.exe the one with --embedded-browser-webview=1
Many thanks for the review. My colleague and I reviewed the process and thread information and added a bunch of traces to our DLL. We finally have things cooperating now. Among the contributing factors seem to be: 1) the use of COM objects within extern "C" DLL entry points. Per ChatGPT4 suggestion, our entry point is extern "C" and then we call the real function that can include magical COM object interactions. 2) our misunderstanding that the DLL detach message can occur across threads and not just when our main application which loaded the DLL closes. We were trying to be good citizens doing some cleanup which likely also messed up the webview2 world.
The observed behavior of the 6 minute mark is still quite odd, but ahead forward we go. Thank you for looking into things from the web view2 perspective. WebView2 takes care of a lot of the non-trivial inter-process plumbing that I had to write when using CEF3.
Description Win32 app using WebView2 will hang at the 6 minute mark.
Version SDK: 1.0.2065-prerelease Runtime: 116.0.1938.69 Framework: Win32 OS: Win10
Regression No
Repro Steps We have a Windows 32 bit application. I wrote a small x86 Win32 DLL in order to integrate a WebView2 widget. It uses the latest runtime 116.0.1938.69. The 115 one showed the same behavior. The DLL sets up the web view2 environment and does no other web view2 interactions. I then step away from the keyboard for 6 minutes. This timeframe is pretty consistent. At this point trying to open a window our application goes into la, la land. I used procmon to see what was happening. In the log I see WebView2 runtime does some directory and many registry checks.
Oddly toward the bottom there is a queryDirectory with a file name that is missing the leading character.
The creation of the thread at the very end is odd as well.
What is web view2 doing and why???
Thank you
"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"6:45:09.9502462 PM","anotherApp.exe","26116","CreateFile","C:\myApplication\anotherApp.exe.WebView2","SUCCESS", "Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened"
"6:45:09.9503125 PM","anotherApp.exe","26116","QueryBasicInformationFile","C:\myApplication\anotherApp.exe.WebView2","SUCCESS", "CreationTime: 8/31/2023 6:38:54 PM, LastAccessTime: 8/31/2023 6:38:54 PM, LastWriteTime: 8/31/2023 6:38:54 PM, ChangeTime: 8/31/2023 6:38:54 PM, FileAttributes: D"
"6:45:09.9503426 PM","anotherApp.exe","26116","CloseFile","C:\myApplication\anotherApp.exe.WebView2","SUCCESS",""
"6:45:09.9505875 PM","anotherApp.exe","26116","RegQueryKey","HKLM","SUCCESS","Query: HandleTags, HandleTags: 0x0"
"6:45:09.9506151 PM","anotherApp.exe","26116","RegQueryKey","HKLM","SUCCESS","Query: Name"
"6:45:09.9506643 PM","anotherApp.exe","26116","RegOpenKey","HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\FileOperationAdviseSinks","SUCCESS", "Desired Access: Read"
"6:45:09.9507444 PM","anotherApp.exe","26116","RegSetInfoKey","HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\FileOperationAdviseSinks","SUCCESS", "KeySetInformationClass: KeySetHandleTagsInformation, Length: 0"
"6:45:09.9507674 PM","anotherApp.exe","26116","RegEnumValue","HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\FileOperationAdviseSinks","SUCCESS", "Index: 0, Name: {D105A4D4-344C-48EB-9866-EE378D90658B}, Type: REG_SZ, Length: 2, Data: "
"6:45:09.9509306 PM","anotherApp.exe","26116","RegQueryKey","HKCU\Software\Classes","SUCCESS","Query: Name"
"6:45:09.9509584 PM","anotherApp.exe","26116","RegQueryKey","HKCU\Software\Classes","SUCCESS","Query: HandleTags, HandleTags: 0x1"
. . . lots of interactions
"6:45:09.9749090 PM","anotherApp.exe","26116","QueryDirectory", "C:\myApplication\notherApp.exe.WebView2","NO SUCH FILE","Filter: notherApp.exe.WebView2" ^^^ NOTE- MISSING FIRST CHARACTER of the application name prefix.
"6:45:09.9771035 PM","anotherApp.exe","26116","RegOpenKey","HKCR\WOW6432Node\CLSID{f0ae1542-f497-484b-a175-a20db09144ba}\InprocHandler", "NAME NOT FOUND","Desired Access: Query Value"
"6:45:09.9771450 PM","anotherApp.exe","26116","RegCloseKey","HKCR\WOW6432Node\CLSID{f0ae1542-f497-484b-a175-a20db09144ba}","SUCCESS",""
"6:45:09.9772717 PM","anotherApp.exe","26116","Thread Create","","SUCCESS","Thread ID: 19268"
No more entries.
Spinning cursor
AB#47099421