Closed kapilkumar6 closed 3 years ago
It's not easy to reproduce and seen this crash stack everytime.
Make sure you have the .pdb
files next to the .dll
files, you need a proper stack trace.
You need
- What version of the product are you using? -71.0.2
This version is very old and unsupported. In future please only open a bug report if you can reproduce the problem with the current supported version (84.4.10 at time of writing).
but disposal happens in the background thread.
This is not supported, you must call Dispose
on the UI Thread
.
- if using the same thread for creation/disposal, Will this solve the problem?
Impossible to say without an example that reproduces your problem. There's not enough information to speculate.
Your issue has been transferred to https://github.com/cefsharp/Questions-and-Support as you are using an old unsupported version and Disposing
on a non UI Thread
is open to race conditions.
Thanks for the quick update, please see my response below:
An actual exception type, is this a null reference? Something else? ->yes, its Null Pointer (Object reference not set to an instance of an object.) I am guessing either BrowserSettings or ManagedCefBrowserAdapter is Null. Maybe because disposal happened before Createrowser could finish? (as currently, it was on different threads)
Line numbers, need to know where the exception is actually happening. ->Unfortunately crash dump is not giving an exact line number, as my application catches all exceptions and later on shows a customize error dialog to the user.
This version is very old and unsupported. In future please only open a bug report if you can reproduce the problem with the current supported version (84.4.10 at time of writing). ->yes, I have upgraded to 84. but before the release, I wanted to check if it's possible to find the exact root cause.
This is not supported, you must call Dispose on the UI Thread. ->yes, i have changed the disposal to UI thread now.
Thanks for the quick inputs though, will keep a close eye on this.
I am guessing either BrowserSettings or ManagedCefBrowserAdapter is Null. Maybe because disposal happened before Createrowser could finish? (as currently, it was on different threads)
In version 84
you will get an ArgumentNullException
if BrowserSettings
is null
.
->Unfortunately crash dump is not giving an exact line number, as my application catches all exceptions and later on shows a customize error dialog to the user.
Log the exception to disk, use a central server to capture crash reports, log the errors to the event log. Do something to capture the full stack trace. Your loosing valuable information.
->yes, I have upgraded to 84. but before the release, I wanted to check if it's possible to find the exact root cause.
Write some unit/integration tests to create/dispose of the browser in a loop, test before and after your changes to confirm the issue is resolved.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I see a random crash in my application based on CEFSharp. It's not easy to reproduce and seen this crash stack everytime. Random Crash in CreateBrowser() at CefSharp.WinForms.ChromiumWebBrowser.CreateBrowser() at CefSharp.WinForms.ChromiumWebBrowser.OnHandleCreated(EventArgs e) at System.Windows.Forms.Control.WmCreate(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Note: In the current version of my application, Creation of ChromiumInstance happens in UI Thread, but disposal happens in the background thread. I am changing the disposal in the UI thread too with a dispatcher with background thread priority.
if using the same thread for creation/disposal, Will this solve the problem?
If the above not solving the problem, How do I check further as the crash stack is inside the CEF layer? Any logs or dumps analysis to figure out the exact root cause? -I am also upgrading to 84 version, will that helps in any manner? Thank you.
What version of the product are you using? -71.0.2
What architecture x86 or x64? x64
On what operating system? <Win7/Win8.1/Win10>
Are you using
WinForms
,WPF
orOffScreen
? WPFWhat steps will reproduce the problem?
What is the expected output? What do you see instead? No Crash.
Please provide any additional information below. at CefSharp.WinForms.ChromiumWebBrowser.CreateBrowser() at CefSharp.WinForms.ChromiumWebBrowser.OnHandleCreated(EventArgs e) at System.Windows.Forms.Control.WmCreate(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I see a similar issue: https://github.com/cefsharp/CefSharp/issues/2979
CEF
Sample Application N/A