Logo
My Account |  Site Map | Contact Us  
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: Newbie
Groups: Member

Joined: 7/7/2017
Posts: 8
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: 20,365
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: Newbie
Groups: Member

Joined: 7/7/2017
Posts: 8
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: 20,365
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: Newbie
Groups: Member

Joined: 7/7/2017
Posts: 8
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: 20,365
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: Newbie
Groups: Member

Joined: 7/7/2017
Posts: 8
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: 20,365
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: Newbie
Groups: Member

Joined: 7/7/2017
Posts: 8
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: 20,365
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: Newbie
Groups: Member

Joined: 7/7/2017
Posts: 8
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: Newbie
Groups: Member

Joined: 7/7/2017
Posts: 8
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: 20,365
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!


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.