-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WcfEnabledSubProcess::OnBrowserDestroyed crashes render process when channelFactory null #2839
Comments
What is the
Throwing a
Blocking until there is something in the queue to process is how the class is designed. |
Thanks! I do now see the crash. Any thoughts on how to run that down, since this site has worked on Chrome basically since it was released? Or is that another project to check in with?
I'm referring to whatever behavior is there when it's
Exactly that, since we're grasping at straws to find the source of this one last problem. |
I started looking at Crashpad, but working from the minimal example the CEF project provided produced these log entries:
And obviously don't get any evidence of the crash. And here's the crash_reporter.cfg, in case I'm doing something stupidly obvious...
The content comes from an example from the CEF example, plus the |
See https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf.Example/crash_reporter.cfg it should dump directly to disk. |
No luck, unfortunately. Updating the CEF version installed by Nuget (and ignoring the commented lines), I have:
But still get pretty much the same log:
And nothing that resembles a dump or crash report after the crash, even though I see the reporting enabled for the renderer. The newest files in the binary folder are the configuration file, the log, and the executable. "The system cannot find the file specified" lines seem suspicious; it's not a permission problem (a quick test running Visual Studio as administrator), so do I maybe need to create a folder in advance to receive the report? I don't see anything about that in the documentation, but that sounds like the sort of issue I used to create in C/C++ file I/O... |
You can try attaching the debugger to the render process, use Make sure you have native code debugging enabled and you've got the |
Progress! Of a sort, at least. It took a while to get the hang of the settings object, but I now see a null reference exception ("Object reference not set to an instance of an object") in Here's the call stack:
I don't think I'm doing anything special with respect to closing the popups. I've removed the popup-lifespan handler to confirm it's nothing in that experimental code. |
ChannelFactory should never be null, you can step through OnBrowserCreated to see what's happening. We can add some null checking to avoid the problem, without an example that reproduces the issue there's nothing much else I can do.
As per https://github.com/cefsharp/CefSharp/wiki/General-Usage#sync-javascript-binding-jsb I need to make it clearer that using the sync JavaScript Binding in new development should be avoided, it remains as a legacy for those upgrading. |
I wasn't actually able to get the synchronous binding to work at all, for some reason, so moved to the asynchronous binding early on. For what it's worth, documentation-wise, the only point of confusion I had was that the JavaScript would need to asynchronously bind the object and asynchronously make the calls into C# code. I'm definitely aware of how frustrating this has to be on your side, too, and very much appreciate your time on this. I wasted a few days (before opening this issue) trying to remove things from our application and add them to a clean example to find the problem, but nothing flipped the equation. And, unfortunately, this application is too central to the business and too big to recommend rewriting it, after only barely selling them on replacing IE to sidestep its ongoing decay. I don't think it's relevant, but (on the way to looking at
But I haven't figured out which specific commit I should be using (currently using feb1bce from May 3rd, which seems like it should at least be close), so Visual Studio is acting a little bit fussy. It definitely seems to be tripping up in that last
You probably already see this from context, but process ID #17760 is the application itself. Now, it's been a good fifteen years since I've worked with named pipes and never on Windows, but would there happen to be a configuration option to set the pipe's location so it can be inspected, maybe? Or is that just a red herring because you're using something higher-level to coordinate? It definitely sounds like the problem is back in the main process failing to "listen," at least, and that might help explain why nobody else is having this problem. |
I forgot to include the stack trace for the communication error, though I assume there aren't many paths there:
And the top-level exception (with a
With
...being the inner exception, of course. |
If you are not using sync JavaScript Binding then you don't need WCF, it's disabled by default so somewhere you are enabling it. Set it back to disabled and this all goes away. http://cefsharp.github.io/api/73.1.x/html/P_CefSharp_CefSharpSettings_WcfEnabled.htm I'll go through your lengthy response later when I have more time. |
I appreciate that you've put in effort to track this down. Not particularly frustrating for me, people put in much less effort and provide fewer details than you have 👍 There's only so much I can do without an example that reproduces the problem.
Releases are tagged, you can get the exact commit that corresponds to a release from https://github.com/cefsharp/CefSharp/tags
The Adding some additional null checking and hopefully some logging (have to make sure that we log when there's an actual error, not just the browser being disposed of soon after it's created). |
Anyone with a |
Ah, I've been using GitHub for years, but only as a dump-site for code and haven't looked at editing things. Once I have things settled, I'll make some time to go through the wiki. We're going through a release (unrelated to this issue), so if I zone out for a few days, that's why... Meantime, for whatever reason (old code from trying to get the synchronous JavaScript to work? Doesn't seem like something I'd play with), it looks like this was all down to the |
Reopening as we'll add an additional set of null checks at a minimum. |
… if WCF was null It's likely the WCF host didn't start and some break points should be added in ManagedCefBrowserAdapter::InitializeBrowserProcessServiceHost to catch the actual exception. We're not logging as it causes too many false positives as it's expected there will be errors when browser is created then rapidly Disposed. Resolves #2839
What version of the product are you using?
What architecture x86 or x64?
On what operating system?
Are you using
WinForms
,WPF
orOffScreen
?What steps will reproduce the problem?
WebBrowser
control with CefSharp, however...window.open()
to create a pop-up window.What is the expected output? What do you see instead?
Please provide any additional information below.
CefSharp/CefSharp/Internals/MethodRunnerQueue.cs
Line 73 in 2a8d8ec
Take()
method will only ever return on success, it's possible that it might be more useful to callTryTake()
, here, whether or not that solves our problem.Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory)
Any other background information that's relevant? Are you doing something out of the ordinary? 3rd party controls?
...at this point in the call stack:
The exception occurs at least twice, seemingly identically. Note the
ConsumeTasks()
call in the trace.- Impressively, this is the only piece of the application that we weren't able to get to work.
CEF
Sample Application from http://opensource.spotify.com/cefbuilds/index.html?The text was updated successfully, but these errors were encountered: