Hello,
In short:
Is there a way from C++ to capture a CEF3 browser's JavaScript callstack?
I see such is provided in ::OnUncaughtException, but I don't see a way to generate such a stack as part of a C++ request.
More details:
I'm attempting to diagnose an issue (or some similar issues) where a web application hosted in a CEF browser appears to become unresponsive. Sometimes it also displaying a white screen when the application becomes unresponsive. During this issue there is a second simultaneous web application hosted in a CEF browser on a different screen on the same machine that remains responsive.
During this unresponsive period CefCallback's Success method is invoked to transmit data to the unresponsive web application, however there is no logging indicating it was received in the web application.
So I've some suspicion that the unresponsive web application's thread is occupied, perhaps by an infinite loop, and so it cannot respond to the user's requests nor the CefCallback Success invocation. I understand that such infinite loops can be diagnosed by having devtools open and selecting to pause the application once the infinite loop occurs. However as this is an infrequent issue, pausing the application with devtools has not been possible, and in general it would be good to have a more robust approach to capture what the web application is doing when it enters an infinite loop.
That said, I'm not entirely convinced the issue is caused by an infinite loop as from the problem's logs I can see that the C++ is able to navigate the browser, at which point it seems to become responsive again. I do not observe this when I forcibly create an infinite loop, instead I see that the request to navigate the browser occurs but the web app never becomes responsive. (I've read this thread viewtopic.php?f=6&t=4120 about recovering from an infinite loop which similarly suggests that an infinite loop would require the render process to be terminated to recover.)
We are also trying to disable hardware acceleration to see if it resolves the issue as I understand there is some correlation between white screens and hardware acceleration.
This problem is being observed with CEF3.3.3396.1779. I've created the infinite loop hang on that same version, but also CEF3.3.3683.1920.
I see the following log lines generated by CEF with CEF logging at ERROR level, but none of this seems to occur around the time of the problem:
- Many log lines like: [0821/111335.604:WARNING:dns_config_service_win.cc(669)] Failed to read DnsConfig.
- Some log lines like: [0821/110345.102:ERROR:network_change_notifier_win.cc(157)] WSALookupServiceBegin failed with: 1722
- Some log lines like: [0821/121343.902:ERROR:browser_gpu_channel_host_factory.cc(119)] Failed to launch GPU process.
- Some log lines like: [0821/152223.885:WARNING:ipc_message_attachment_set.cc(49)] MessageAttachmentSet destroyed with unconsumed attachments: 0/1
- Some log lines like: [0822/143918.739:ERROR:dns_config_service_win.cc(755)] DNS config watch failed.
In summary:
- Can a JavaScript callstack be generated from a C++ call to help diagnose where the JavaScript might be stuck?
- Are there other suggestions on how to diagnose a hung web application?
- Any other ideas on what the cause of the issue might be, if it is indeed not a infinite loop?
Many thanks,
Grant Baltare