Welcome Guest Search | Active Topics | Sign In | Register

Application crashing on some systems on Application exit after inserting EO.Webbrowser. Options
ITS Immobilien Treuhand Software GmbH
Posted: Tuesday, April 28, 2020 4:14:04 AM
Rank: Member
Groups: Member

Joined: 10/30/2019
Posts: 10
Hi,
We currently use the Version 20.0.81.0.
We switched the Internal Winforms .Net Webbrowser Control to a EO.Webbrowser in our Application, and it worked fine for most of our clinets.
But on some machines our process crashes on application exit, first with the Exception Code 0xc0020001, and than with the Exception Code c000041d.
This only happens if we the EO.Webbrowser Controls, and Displayed a Page with them.
According to a Websearch this exception happens when callbacks get executed, after CLR began the shudown.

After we added this Code do the Dispose of our Mainform, it happened less, but still happens:
Quote:

EO.Base.Runtime.Shutdown()
While Not EO.Base.Runtime.HasShutdown
Threading.Thread.Sleep(100)
End While

Not sure if there is anything else we can/should try.
eo_support
Posted: Tuesday, April 28, 2020 12:41:10 PM
Rank: Administration
Groups: Administration

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

This usually occurs when you have orphan WebViews that you have not explicitly disposed. Please check your code to make sure you have properly disposed every one. The easiest way to dispose the WebView is to destroy the hosting window. For example, if you have a WebControl inside a Form, then closing the Form would be sufficient to destroy the WebView. However since WebView is not multi-thread safe, you must destroy the WebView in the same thread in which it was created.

Thanks!
ITS Immobilien Treuhand Software GmbH
Posted: Monday, May 4, 2020 7:42:08 AM
Rank: Member
Groups: Member

Joined: 10/30/2019
Posts: 10
eo_support wrote:
Hi,

This usually occurs when you have orphan WebViews that you have not explicitly disposed.
Please check your code to make sure you have properly disposed every one.
The easiest way to dispose the WebView is to destroy the hosting window.
For example, if you have a WebControl inside a Form, then closing the Form would be sufficient to destroy the WebView.
However since WebView is not multi-thread safe, you must destroy the WebView in the same thread in which it was created.

Thanks!


I checked the source of our app with the version with witch I had this Crash the last time, but all WebViews are Disposed.
We currently use the WebView only in 2 Locations, and the Dispose Code we currently this:
Code: Visual Basic.NET
If disposing AndAlso Me.WebControl1 IsNot Nothing Then
	Me.WebControl1.Parent = Nothing
	If Not Runtime.HasShutdown Then
		Me.WebView1.Destroy()
		Me.WebView1.Dispose()
	End If
	Me.WebControl1.Dispose()
End If

and This:
Code: Visual Basic.NET
If Me.webViewMail IsNot Nothing Then
	Me.webViewMail.Dispose()
	Me.webViewMail = Nothing
End If
If Me.webControlMail IsNot Nothing Then
	Me.webControlMail.WebView = Nothing
	Me.webControlMail.Dispose()
	Me.webControlMail = Nothing
End If


Quote:

However since WebView is not multi-thread safe, you must destroy the WebView in the same thread in which it was created.

Is there any way to check from the WebView Control if we are in the Correct Thread? (like Control.InvokeRequired with WinForm Controls)
Or any way to switch to the correct thread? (like Control.Invoke with WinForm Controls)

Remark:
We ensure that for all our Forms/Controls are Disposed.
eo_support
Posted: Monday, May 4, 2020 12:19:31 PM
Rank: Administration
Groups: Administration

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

No. The WebView does not have anything similar to Control.InvokeRequired.

We have just recently thoroughly reviewed our code related to Shutdown/Cleanup and posted a new build (2020.1.31) that contains the revised code. So you may want to try that build first and see if it resolves the issue for you. If that still does not resolve the issue 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 the test project, we will look into it and see what we can find.

Thanks!
ITS Immobilien Treuhand Software GmbH
Posted: Thursday, May 7, 2020 10:57:39 AM
Rank: Member
Groups: Member

Joined: 10/30/2019
Posts: 10
Hi,
I just testet after a Update (using the NuGet Pacakge Version 2020.1.31) and it still crashes on Exit for me.
I activated LocalDump, and checked the created Dump, and there is no instance of a WebView pressent, at the time of the crash.
I will see if I can redruce/reproduce it in a test project.

Anyway, not sure if this Helps, but here is the output of the call '!dumpheap -stat -type EO.' on the Debugger (WinDbg)
Quote:

0:000> !dumpheap -stat -type EO.
Statistics:
MT Count TotalSize Class Name
00007ffe969f2768 1 24 System.Collections.Generic.Dictionary`2+ValueCollection[[System.IntPtr, mscorlib],[EO.Internal.prva+kcfi, EO.Base]]
00007ffe969f21d8 1 24 System.Collections.Generic.Dictionary`2+KeyCollection[[EO.Internal.xcfo, EO.WebEngine],[System.String, mscorlib]]
00007ffe969f1ad0 1 24 System.Collections.Generic.Dictionary`2+ValueCollection[[System.Int32, mscorlib],[EO.WebEngine.Engine, EO.WebEngine]]
00007ffe969f1890 1 24 EO.WebEngine.Engine+scsq
00007ffe9648f2f0 1 24 EO.Internal.hoqq+miwx
00007ffe9648dad0 1 24 System.Collections.Generic.ObjectEqualityComparer`1[[EO.WebBrowser.WebView, EO.WebBrowser]]
00007ffe9648d080 1 24 System.Collections.Generic.Dictionary`2+ValueCollection[[System.Int32, mscorlib],[EO.Internal.psaj+mpbc, EO.Base]]
00007ffe9648bd78 1 24 EO.WebBrowser.WebView+speh[]
00007ffe9648ae08 1 24 EO.WinForm.WebViewHost+bdhl+lryc
00007ffe964815d0 1 24 System.Nullable`1[[EO.Internal.prum, EO.Base]]
00007ffe9645d5c8 1 24 System.Collections.Generic.EnumEqualityComparer`1[[EO.Internal.psal, EO.Base]]
00007ffe964526c8 1 24 EO.Internal.prvg+qcap
00007ffe9644ea38 1 24 EO.Internal.psaj+mpbd
00007ffe9644cd48 1 24 EO.Internal.psbc`2+tfxr[[EO.Internal.pruq+ixsq+cxxp, EO.Base],[System.Object, mscorlib]][]
00007ffe96446290 1 24 System.Collections.Generic.EnumEqualityComparer`1[[EO.Internal.prvj, EO.Base]]
00007ffe96444698 1 24 EO.Internal.pruq+ixsq+cxxs+wyht
00007ffe96444570 1 24 EO.Internal.pruq+ixsq+cxxs
00007ffe96443e70 1 24 EO.Internal.psah+cvdo
00007ffe96440b90 1 24 System.Collections.Generic.EnumEqualityComparer`1[[EO.Internal.xcev+lxxz, EO.WebEngine]]
00007ffe9640ee68 1 24 System.Collections.Generic.ObjectEqualityComparer`1[[EO.Internal.xcfo, EO.WebEngine]]
00007ffe9640c2d8 1 24 EO.WebEngine.CookieManager
00007ffe963dda68 1 24 EO.WebBrowser.NavigationTask[]
00007ffe963dca50 1 24 EO.Base.Action[]
00007ffe963d9ee8 1 24 System.Collections.Generic.ObjectEqualityComparer`1[[EO.Internal.prtw+lkhg, EO.Base]]
00007ffe963d43b8 1 24 EO.WebBrowser.WebView+spes
00007ffe963d41c8 1 24 EO.WebBrowser.Shortcut[]
00007ffe963d3050 1 24 EO.WebBrowser.WebView+spen
00007ffe964c0038 1 32 EO.Internal.psbf[]
00007ffe96459dc8 1 32 EO.Internal.przm
00007ffe9644df18 1 32 EO.Internal.prvp
00007ffe9640a9c0 1 32 EO.Internal.xcgg
00007ffe963dfdd8 1 32 EO.Internal.pruw`2[[System.Int32, mscorlib],[EO.WebBrowser.NavigationTask, EO.WebBrowser]]
00007ffe9454c2c0 1 32 EO.Internal.przd+irou
00007ffe9454b050 1 32 EO.Internal.psbu
00007ffe9648f720 1 40 EO.Internal.psbe
00007ffe9648ac10 1 40 EO.Internal.hoqk
00007ffe964561a0 1 40 EO.Internal.prvl
00007ffe9644e248 1 40 EO.Internal.psaj+mpbc
00007ffe9640beb0 1 40 EO.Internal.pruu`1[[System.Int64, mscorlib]]
00007ffe963d6768 1 40 System.Collections.Generic.List`1[[EO.Internal.prtw+lkhg, EO.Base]]
00007ffe963d3258 1 40 System.Collections.Generic.List`1[[EO.WebBrowser.WebView, EO.WebBrowser]]
00007ffe9454c468 1 40 EO.Internal.przd
00007ffe9648fad8 1 48 EO.Internal.psbf
00007ffe96484cb8 1 48 EO.Internal.psaz`3+wfko[[EO.Internal.prxc`1[[EO.Internal.przn+okov+emaj, EO.Base]], EO.Base],[EO.Internal.psbb`1+elgn[[EO.Internal.przn+okov+emaj, EO.Base]], EO.Base],[EO.Internal.psbb`1+elgo[[EO.Internal.przn+okov+emaj, EO.Base]], EO.Base]]
00007ffe9645b930 1 48 EO.Internal.przn+okov+emal
00007ffe9645a660 1 48 EO.Internal.przn+okoq
00007ffe96443a18 1 48 EO.Internal.psaw+oemy
00007ffe963da038 2 48 EO.Internal.prxu
00007ffe963d66d8 2 48 EO.Internal.prtw+lkhh
00007ffe9648f5e8 1 56 EO.Internal.psbh
00007ffe9645b658 1 56 EO.Internal.przn+okov
00007ffe96458c60 1 56 EO.Internal.przq
00007ffe969f1940 1 64 System.Comparison`1[[EO.WebEngine.Engine, EO.WebEngine]]
00007ffe9648af48 1 64 EO.Internal.hoqk+bumk
00007ffe9648a970 1 64 EO.Internal.hoqj
00007ffe96456d90 1 64 EO.Internal.xcfs
00007ffe9644d028 2 64 EO.Internal.prxa
00007ffe964420f8 1 64 EO.Internal.psah+cvdn
00007ffe96409d80 1 64 EO.Internal.xcga+fcah
00007ffe963d4908 1 64 EO.Internal.houp+yvdn
00007ffe9454a420 1 64 EO.Internal.psbo+jkib
00007ffe96484e40 1 80 System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[EO.Internal.psaz`3+wfko+dlvr[[EO.Internal.prxc`1[[EO.Internal.przn+okov+emaj, EO.Base]], EO.Base],[EO.Internal.psbb`1+elgn[[EO.Internal.przn+okov+emaj, EO.Base]], EO.Base],[EO.Internal.psbb`1+elgo[[EO.Internal.przn+okov+emaj, EO.Base]], EO.Base]], EO.Base]]
00007ffe96482c70 1 80 System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[EO.Internal.prva+kcfi, EO.Base]]
00007ffe96482568 1 80 System.Collections.Generic.Dictionary`2[[System.IntPtr, mscorlib],[EO.Internal.prva+kcfi, EO.Base]]
00007ffe9645c3c0 1 80 System.Collections.Generic.Dictionary`2[[EO.Internal.psal, EO.Base],[System.Object, mscorlib]]
00007ffe96458e68 1 80 System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[EO.Internal.przq, EO.Base]]
00007ffe96455528 2 80 System.Collections.Generic.List`1[[EO.Internal.prul+dxak, EO.Base]]
00007ffe9644e2f8 1 80 System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[EO.Internal.psaj+mpbc, EO.Base]]
00007ffe96445088 1 80 System.Collections.Generic.Dictionary`2[[EO.Internal.prvj, EO.Base],[EO.Internal.prvk, EO.Base]]
00007ffe96443230 1 80 System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[EO.Internal.psaw+oemx, EO.Base]]
00007ffe96442200 1 80 System.Collections.Generic.Dictionary`2[[System.IntPtr, mscorlib],[EO.Internal.psah, EO.Base]]
00007ffe9640e3d0 1 80 System.Collections.Generic.Dictionary`2[[EO.Internal.xcfo, EO.WebEngine],[System.String, mscorlib]]
00007ffe9640c9a8 1 80 System.Collections.Generic.Dictionary`2[[System.Int64, mscorlib],[EO.Internal.prut`2+wkqw[[System.Int64, mscorlib],[System.Int32, mscorlib]], EO.Base]]
00007ffe96409820 2 80 EO.Internal.xcev
00007ffe963d9238 1 80 System.Collections.Generic.Dictionary`2[[System.Object, mscorlib],[EO.Internal.prtw+lkhi+vwkn, EO.Base]]
00007ffe963d8998 1 80 System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[EO.WebEngine.Engine, EO.WebEngine]]
00007ffe963d8290 1 80 System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[EO.WebEngine.Engine, EO.WebEngine]]
00007ffe963d4700 2 80 EO.WebBrowser.WebView[]
00007ffe9454cb68 1 80 System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[EO.Internal.przd+irou+gqjl, EO.Base]]
00007ffe96487e78 1 96 System.Collections.Generic.Dictionary`2+Entry[[System.Int32, mscorlib],[EO.Internal.psaz`3+wfko+dlvr[[EO.Internal.prxc`1[[EO.Internal.przn+okov+emaj, EO.Base]], EO.Base],[EO.Internal.psbb`1+elgn[[EO.Internal.przn+okov+emaj, EO.Base]], EO.Base],[EO.Internal.psbb`1+elgo[[EO.Internal.przn+okov+emaj, EO.Base]], EO.Base]], EO.Base]][]
00007ffe96483840 1 96 System.Collections.Generic.Dictionary`2+Entry[[System.Int32, mscorlib],[EO.Internal.prva+kcfi, EO.Base]][]
00007ffe964834a8 1 96 System.Collections.Generic.Dictionary`2+Entry[[System.IntPtr, mscorlib],[EO.Internal.prva+kcfi, EO.Base]][]
00007ffe9645e728 2 96 EO.Internal.pryd[]
00007ffe964596c0 1 96 System.Collections.Generic.Dictionary`2+Entry[[System.String, mscorlib],[EO.Internal.przq, EO.Base]][]
00007ffe96456778 1 96 System.Collections.Generic.Dictionary`2+Entry[[System.Int32, mscorlib],[EO.Internal.psaw+oemx, EO.Base]][]
00007ffe96454c60 1 96 System.Collections.Generic.Dictionary`2+Entry[[System.IntPtr, mscorlib],[EO.Internal.psah, EO.Base]][]
00007ffe964468b0 1 96 System.Collections.Generic.Dictionary`2+Entry[[EO.Internal.prvj, EO.Base],[EO.Internal.prvk, EO.Base]][]
00007ffe96441cd8 1 96 System.Collections.Generic.Dictionary`2+Entry[[EO.Internal.xcfo, EO.WebEngine],[System.String, mscorlib]][]
00007ffe96441940 1 96 System.Collections.Generic.Dictionary`2+Entry[[System.String, mscorlib],[EO.WebEngine.Engine, EO.WebEngine]][]
00007ffe964415a8 1 96 System.Collections.Generic.Dictionary`2+Entry[[System.Int32, mscorlib],[EO.WebEngine.Engine, EO.WebEngine]][]
00007ffe96484698 1 128 EO.Internal.przn+okov+emak
00007ffe96409390 1 128 EO.WebEngine.EngineOptions
00007ffe9454dba8 2 128 EO.Base.Action
00007ffe9645b2c0 6 144 EO.Internal.pryd
00007ffe9640c420 3 144 EO.Internal.prvk
00007ffe963dfaf0 3 144 EO.Internal.prvy
00007ffe9640f950 2 160 System.Collections.Generic.Dictionary`2[[EO.Internal.xcev+lxxz, EO.WebEngine],[System.String, mscorlib]]
00007ffe9454cad8 7 168 EO.Internal.przd+irou+gqjl
00007ffe9645fed0 1 176 EO.Internal.prva+kcfi
00007ffe963d6ef0 2 176 EO.Internal.prtw+lkhg[]
00007ffe96483d50 1 192 System.Collections.Generic.Dictionary`2+Entry[[System.Int32, mscorlib],[EO.Internal.przd+irou+gqjl, EO.Base]][]
00007ffe96455e88 3 200 EO.Internal.prul+dxak[]
00007ffe96408c48 1 200 EO.Internal.xcfu
00007ffe9644d328 2 208 EO.Internal.prwy
00007ffe96401460 8 256 EO.WebBrowser.Request
00007ffe9454c738 7 280 EO.Internal.prup
00007ffe9640c8f8 8 384 EO.Internal.prut`2+wkqw[[System.Int64, mscorlib],[System.Int32, mscorlib]]
00007ffe964c5c08 6 432 EO.WebEngine.Cookie
00007ffe964c4148 1 432 System.Collections.Generic.Dictionary`2+Entry[[System.Int64, mscorlib],[EO.Internal.prut`2+wkqw[[System.Int64, mscorlib],[System.Int32, mscorlib]], EO.Base]][]
00007ffe9644ec08 1 432 System.Collections.Generic.Dictionary`2+Entry[[System.Int32, mscorlib],[EO.Internal.psaj+mpbc, EO.Base]][]
00007ffe963d9a90 1 432 System.Collections.Generic.Dictionary`2+Entry[[System.Object, mscorlib],[EO.Internal.prtw+lkhi+vwkn, EO.Base]][]
00007ffe9648efd8 5 480 EO.Internal.psbj
00007ffe964099c0 6 576 EO.Internal.xcfe
00007ffe9640c148 6 624 EO.WebEngine.CookieCollection
00007ffe964c4b20 8 704 EO.Internal.horm
00007ffe964411b0 2 864 System.Collections.Generic.Dictionary`2+Entry[[EO.Internal.xcev+lxxz, EO.WebEngine],[System.String, mscorlib]][]
00007ffe963dcd78 8 1088 EO.Internal.horr
00007ffe9640a708 2 2608 EO.Internal.xcge[]
00007ffe9454ada8 2 2608 EO.Internal.psbs[]
00007ffe9454b360 638 25520 EO.Internal.psbt
Total 841 objects
ITS Immobilien Treuhand Software GmbH
Posted: Thursday, May 7, 2020 11:15:01 AM
Rank: Member
Groups: Member

Joined: 10/30/2019
Posts: 10
I think I found the Reason, wo do Call 'System.Windows.Forms.Application.Exit()' or 'System.Environment.Exit(0)' when our Main Window is closed, or on the End-Button is clicked.
If I remove these Calls, then I get no crash, but if they are pressent, then it crashes.
I will submit a repor project soon.

Correction:
Removing these 2 Lines only fixes the Crash in the TestApp, not in our Normal application.
eo_support
Posted: Thursday, May 7, 2020 1:46:49 PM
Rank: Administration
Groups: Administration

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

We tested your application here and we are NOT able to reproduce the crash. Do you happen to have something else on your system that would interfere with it?

We ran your test application and then click the "X" button to close it. Please let us know if there are any specific steps we have to follow in order to reproduce the crash.

Thanks!
ITS Immobilien Treuhand Software GmbH
Posted: Friday, May 8, 2020 5:45:26 AM
Rank: Member
Groups: Member

Joined: 10/30/2019
Posts: 10
eo_support wrote:
Hi,

We tested your application here and we are NOT able to reproduce the crash. Do you happen to have something else on your system that would interfere with it?

We ran your test application and then click the "X" button to close it. Please let us know if there are any specific steps we have to follow in order to reproduce the crash.

Thanks!

Hi,
Did you run it as is?
I just checked the source I send, and noticed that I mistakenly commented the two Calls 'System.Windows.Forms.Application.Exit()' or 'System.Environment.Exit(0)' out.
So you may have to change:
Code: Visual Basic.NET
Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
        Application.DoEvents()
        'Application.Exit()
        'Environment.Exit(0)
    End Sub

To
Code: Visual Basic.NET
Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
        Application.DoEvents()
        Application.Exit()
        Environment.Exit(0)
    End Sub
eo_support
Posted: Friday, May 8, 2020 7:28:00 AM
Rank: Administration
Groups: Administration

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

We did uncomment those two lines and it still works fine.

Thanks!
ITS Immobilien Treuhand Software GmbH
Posted: Friday, May 8, 2020 10:24:52 AM
Rank: Member
Groups: Member

Joined: 10/30/2019
Posts: 10
eo_support wrote:
Hi,

We did uncomment those two lines and it still works fine.

Thanks!


We testet on multiple machines, with Different Windows Versions, and it crashed on all of them.
But we noticed, that on Some Windows-Version the Error Dialog wasn't displayed, but the Crash still happened. (But is logged in Eventlog)
Also, if You start a Debugging, then the Crash also doesn't happen.
eo_support
Posted: Friday, May 8, 2020 3:01:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Thanks for the additional information. We were able to reproduce the problem by running it under debugger with "enable native code debugging" option checked. Subsequently we were able to find out the root of the problem.

The root of the problem is we rely on Application.ThreadExit event to perform some clean up work. However in your case this event is not raised. We will change our code not to rely on this event in our next build and reply here again as soon as the new build is available.
eo_support
Posted: Friday, May 15, 2020 12:49:19 PM
Rank: Administration
Groups: Administration

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

This is just to let you know that we have posted a new build (2020.1.45) that should resolve this issue. You can download it from our download page. Please take a look and let us know how it goes.

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.