Welcome Guest Search | Active Topics | Sign In | Register

WebView crashes when trying to load EO.WebBrowser.Request Options
anninkov
Posted: Monday, December 11, 2017 4:39:23 AM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hello, support!

We have created WPF application. It contains browser element:
=================================
<UserControl x:Class="Com.Altuera.Yota.EOK.EOKView"
x:Name="EOKControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:Com.Altuera.Yota.EOK"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:eo="http://schemas.essentialobjects.com/wpf/">
....
<Grid Height="{Binding ElementName=EOKControl, Path=ActualHeight}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
....
<eo:WebControl Grid.Row="1" x:Name="webControl"/>
....
</Grid>
</UserControl>
=================================

In addition, in Create() method of our main View we have the next code (trying to load particular request in WebView with PreloadTask):
=================================
PreloadTask preloadTask = WebView.Preload(600, 800, "about:blank", (newWebView, arg) =>
{
if (newWebView == null)
{
return null;
}

newWebView.LoadFailed += webView_LoadFailed;
newWebView.ConsoleMessage += webView_ConsoleMessage;
newWebView.NeedClientCertificate += webView_NeedClientCertificate;
newWebView.CertificateError += webView_CertificateError;
newWebView.NeedCredentials += webView_NeedCredentials;
newWebView.NewWindow += webView_NewWindow;
newWebView.LoadCompleted += webView_LoadCompleted;
newWebView.BeforeRequestLoad += webView_BeforeRequestLoad;
newWebView.BeforeNavigate += webView_BeforeNavigate;
newWebView.AfterReceiveHeaders += webView_AfterReceiveHeaders;
newWebView.RenderUnresponsive += webView_RenderUnresponsive;

EO.WebBrowser.Request request = new EO.WebBrowser.Request(url);
request.Method = "POST";

NavigationTask navigationTask = newWebView.LoadRequest(request);

BackgroundWorker internalWorker = new BackgroundWorker();
internalWorker.DoWork += new DoWorkEventHandler((object o, DoWorkEventArgs args) =>
{
if (!navigationTask.WaitOne(this.eokLoadTimeout))
{
args.Result = bool.FalseString;
}
else
{
args.Result = bool.TrueString;
}
});
internalWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler((object o, RunWorkerCompletedEventArgs args) =>
{
if (args.Error != null)
{
Dispatcher.BeginInvoke((System.Action)(() =>
{
this.webControl.WebView.StopLoad();
}));
return;
}

if (args.Cancelled)
{
return;
}

if (args.Result != null)
{
string result = (string)args.Result;
if (result != null)
{
if (result.Equals(bool.FalseString))
{
Dispatcher.BeginInvoke((System.Action)(() =>
{
this.webControl.WebView.StopLoad();
}));
}
}
}
});
internalWorker.RunWorkerAsync();

Dispatcher.BeginInvoke((System.Action)(() =>
{
this.webControl.WebView = newWebView;
}));
return null;
}, null);

BackgroundWorker worker = new BackgroundWorker();
worker.DoWork += new DoWorkEventHandler((object o, DoWorkEventArgs args) =>
{
preloadTask.WaitOne();
});
worker.RunWorkerAsync();
=================================

This code works well, but sometimes we have EO.Base.Runtime exception:
17-12-07 14:04:31.177 [ 1]

Can you help us with this problem? Maybe it is something wrong in our logic?

EO libs version: 16.2.93.0

Please advice.

Sincerely,
Dmitry Anninkov.
eo_support
Posted: Monday, December 11, 2017 10:30:53 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

Your code looks OK to us. The issue you run into maybe the same as this one:

https://www.essentialobjects.com/forum/postst10548_WebBrowser-blank-Screen-with-Error-This-WebView-either-has-already-been-destroyed-or-is-being-destr.aspx

This issue should have been resolved in the current version (2018). So please download it from our download page and see if it works for you. If it still does not work for you, please try to isolate the problem into a test project and send the test project to us. See here for more details:

https://www.essentialobjects.com/forum/test_project.aspx

Once we have that we will be happy to investigate further.

Thanks!
Panda
Posted: Sunday, March 18, 2018 8:28:46 PM
Rank: Advanced Member
Groups: Member

Joined: 10/7/2015
Posts: 35
May I request someone reduce or delete the stack trace in this question as it turns search results into hell.
anninkov
Posted: Tuesday, May 15, 2018 8:24:28 AM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hello, support!

After updating EO libs to the current version (EO.Total 18.1.56) we still have EO.Base.Runtime.Exception sometimes:

18-05-14 18:47:36.964 [ 1] DEBUG Logger.EOKViewLogger - [EOK] EO.WebBrowser.Preload: dispatcher invoked, set newWebView to webControl
18-05-14 18:47:37.018 [ 50] ERROR .EOK.EOKModuleLogger - EO.Base.Runtime.CrashDataAvailable: .............. 18.1.56.0
18-05-14 18:47:37.079 [ 19] INFO .EOK.EOKModuleLogger - EO.WebEngine.Engine.Default.Stopped
18-05-14 18:47:37.079 [ 19] DEBUG Logger.EOKViewLogger - [EOK] EngineDefault_Stopped handler was invoked. Interaction id is 0006SaDEWAVXWP3E
18-05-14 18:47:37.079 [ 19] DEBUG Logger.EOKViewLogger - [EOK] Start the timer. Interaction id is 0006SaDEWAVXWP3E
18-05-14 18:47:37.121 [ 1] ERROR .EOK.EOKModuleLogger - EO.Base.Runtime.Exception:
System.Exception: Channel disconnected
18-05-14 18:47:37.122 [ 1] ERROR .EOK.EOKModuleLogger - EO.Base.Runtime.GetLogs: ...

Can you help us with this problem?

Please advice.

Sincerely,
Dmitry.
eo_support
Posted: Tuesday, May 15, 2018 3:45:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

It appears that you are already handling CrashDataAvailable and collecting crash logs. Can you send the crash log to us so that we can take a look? See here for our email address:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!
anninkov
Posted: Wednesday, May 16, 2018 4:56:47 AM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hi,

I have sent you the desired crash logs. Thanks a lot!
eo_support
Posted: Wednesday, May 16, 2018 10:01:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

The file you sent to us does not appear to be our log data. See here for what we need:

https://www.essentialobjects.com/doc/common/crash_report.aspx

The data you sent to us must be exactly from e.Data. You can't add anything else to it.

Thanks!
anninkov
Posted: Thursday, May 17, 2018 6:52:53 AM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hi,

I have sent you the logs in the correct format. Thanks!
Code:
____________________________________________________________
EO.Base.Runtime.EnableCrashReport = false;

EO.Base.Runtime.CrashDataAvailable += (object sender, EO.Base.CrashDataEventArgs e) =>
{
// Save the crash data into a file
System.IO.File.WriteAllBytes(@"C:\Test\CrashDataAvailable.txt", e.Data);
};
____________________________________________________________
eo_support
Posted: Thursday, May 17, 2018 4:23:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

The crash log indicates that this occurs while initializing GPU. Does this problem occurs always and only occur on specific systems?

Thanks!
anninkov
Posted: Thursday, May 17, 2018 4:34:44 PM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hello,

But this problem occurs quite often and on different OS (Win10 and Win7 at least).

Thanks!
eo_support
Posted: Friday, May 18, 2018 8:22:48 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

There are numerous different scenarios that can cause Chromium browser engine to crash and most of them originates from the browser engine. For those crashes it is not possible for us to address them due to the size of the Chromium project. For such cases, we usually wait for the Chromium team to fix them first. However due to our crash log ability, sometimes we can see where it crashed and maybe able to suggest ways to avoid/workaround it, that would be our main focus for these type of crashes.

Another type of crashes originates from our code, for those crashes we can usually trace to the bottom of it and fix it.

In your case, the problem you observed can actually be multiple problems and they all resulted in a crash in the browser engine. The one crash log you sent to us indicate a problem with initializing GPU. You can try to collect multiple logs and send them to us so that we can see if they are all the same problem or they are all different kind of problem, or actually the same problem shows up in all different kind of places.

Thanks!
anninkov
Posted: Friday, May 18, 2018 10:11:44 AM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hi,

Thank you very much for such a detailed response!

In the near future I will try to collect more logs.

Thanks!
anninkov
Posted: Tuesday, May 22, 2018 5:16:17 AM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hello, support!

At your request I send you the crash data that was able to collect.

Thanks a lot!
eo_support
Posted: Tuesday, May 22, 2018 1:20:39 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

We have looked into the crash log data you sent to us and almost all of them occurs while initializing GPU. So the issue appears to have to do with your GPU driver. As a test, you can try to disable GPU and see if it works for you. You can set this property to true to disable GPU:

https://www.essentialobjects.com/doc/eo.webbrowser.runtime.disablegpu.aspx

It is also possible that the problem is related to how you call our library. As a test, you can try to run our TabbedBrowser sample application and see if you can reproduce the problem with that. If the problem can not be reproduced with TabbedBrowser, then the issue may have to do with your application. In that case please try to isolate the problem into a test project and send the test project to us. Once we have that, we will try to run it here and see if we can reproduce the problem here.

Thanks!
anninkov
Posted: Thursday, May 31, 2018 7:51:02 AM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hi,

According to your recommendations we set DisableGPU property to true to disable GPU:
EO.WebBrowser.Runtime.DisableGPU = true;

We have collected new crash files and have sent it to your email. Do you observe the mentioned problem with GPU?

Thanks!
anninkov
Posted: Wednesday, June 27, 2018 10:55:57 AM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hello, support!

According to your recommendations we have updated EO libraries to 18.1.91 build.

After libs updating we still have EO.Base.Runtime.Exception sometimes:

18-06-26 23:25:22.627 [ 11] ERROR .EOK.EOKModuleLogger - EO.Base.Runtime.Exception:
System.Exception: This WebView either has already been destroyed or is being destroyed.
18-06-26 23:25:22.628 [ 11] ERROR .EOK.EOKModuleLogger - EO.Base.Runtime.GetLogs: Begin_Block_1
gAAAACW5uoZ+KxJ3zNIgFeR4SKtmes6aqFz/xXL7d32fgwbnCMJ+kOyoFR2LikjvNoIhdlccvZCC
oXfz40oR7A0I7Vjppjln0eYwh0qFFtcVbDvfSuWuxSCpJkCzO7k0OdwI46s31rAFEdyzT1p7Spr6
.............................................................

But we are no longer observing crash data (during EO.Base.Runtime.CrashDataAvailable event handling) in our logs.
In addition, sometimes we observe fatal exception:

18-06-22 23:14:17.321 [ 2] FATAL IWNsezfYBPn7k1kUdkCN -

!!!!!!!!!!!!!!!!!!!!!!!!! Fatal Exception Begin !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

System.Exception: Destroy must be called from the same thread the WebView is created.
в EO.WebBrowser.WebView.g(Boolean A_0)
в EO.WebBrowser.WebView.Destroy()
в EO.Wpf.WebViewHost.a.a(Boolean A_0)
в System.Windows.Interop.HwndHost.Finalize()
r
!!!!!!!!!!!!!!!!!!!!!!!!! Fatal Exception End !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Can you help us with this problem?

Please advise.

Sincerely,
Dmitry.
eo_support
Posted: Wednesday, June 27, 2018 2:48:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,070
Hi,

You will receive this error when the WebControl has not been destroyed properly. Try to call this method explicitly in the same thread:

https://www.essentialobjects.com/doc/eo.wpf.webviewhost.dispose.aspx

That should prevent this error.

Thanks!
anninkov
Posted: Tuesday, June 22, 2021 4:56:04 AM
Rank: Member
Groups: Member

Joined: 7/7/2017
Posts: 13
Hello, support!

We are forced to continue the dialogue on this issue, as the browser continues to crash in our WPF application.

We use the current version of EO.WebBrowser in our application — EO.Total 21.1.43.

According to your previous recommendations, we have also disabled GPU (we have set DisableGPU property to true):
EO.WebBrowser.Runtime.DefaultEngineOptions.DisableGPU = true;

Unfortunately, we were unable to identify specific steps to reproduce the problem. The browser may crash unexpectedly even when all resources are already loaded. At the same time, in the logs of our application, we can see the following:

21-06-20 18:52:58.701 [ 34] ERROR stomLogger.EOKModule - [EOKExtension] [Thread #34: ] EO.Base.CrashDataEventArgs.Message:
21-06-20 18:52:58.701 [ 34] ERROR stomLogger.EOKModule - [EOKExtension] [Thread #34: ] EO.Base.CrashDataEventArgs.Data saving into a file...
21-06-20 18:52:58.714 [ 1] ERROR stomLogger.EOKModule - [EOKExtension] [Thread #1: ] EO.Base.Runtime.Exception:
System.Exception: Channel disconnected
в EO.Internal.vptw`3.pixz()
21-06-20 18:52:58.843 [ 159] WARN stomLogger.EOKModule - [EOKExtension] [Thread #159: ] EO.WebEngine.Engine.Default Stopped
21-06-20 18:52:58.843 [ 159] DEBUG StateMonitoringTimer - [EOKExtension] Start the timer for EO.WebEngine.Engine.Default state monitoring
21-06-20 18:52:58.847 [ 1] ERROR stomLogger.EOKModule - [EOKExtension] [Thread #1: ] EO.Base.Runtime.GetLogs:
Begin_Block_1
gAAAAMZd9eA6j8tjqrKMVp88IINPHF6ip3UfkPNZoBmZ8iaA92EGaj6nCetKCgqPGN6+yKnnf/ov
zK+nMTz...


We are already handling EO.Base.Runtime.CrashDataAvailable event and collecting crash logs. We have sent you the crash data in the correct format.

Could you help us with this problem?

Please advise.

Sincerely,
Dmitry.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.