Welcome Guest Search | Active Topics | Sign In | Register

Type initialization exception Options
ruk
Posted: Monday, May 22, 2017 9:59:44 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 48
After setting the sub process exe name, launching the application containing the WebBrower crashes with the exception as noted below.

This can be reproduced with the TabbedBrowser sample app. To reproduce:
1) Set the sub process executable name, something like: EO.Base.Runtime.InitWorkerProcessExecutable("to.subprocess.exe");
2) Run the app once to generate the to.subprocess.exe.
3) Copy output files (the exe and all dlls) to a sub folder under the program files, say C:\Program Files (x86)\EO Sample. Note that the to.subprocess.exe is also copied.
4) Launch the sample app and it crashes with the following exception.

Our application is installed under the program files and this issue prevents it from using the web browser. Help appreciated.

Exception:
System.TypeInitializationException: The type initializer for 'EO.TabbedBrowser.MainWindow' threw an exception. ---> System.UnauthorizedAccessException: Access to the path 'C:\Program Files (x86)\aa\Debug\to.subprocess.exe' is denied.

at EO.Internal.jo.a(String A_0, Byte[] A_1)

at EO.Internal.jo.a(String A_0)

at EO.Base.Runtime.InitWorkerProcessExecutable(String exeFileName)

at EO.TabbedBrowser.MainWindow..cctor() in C:\My Box\EO\EO.Total 2017\Samples\CS\WebBrowser\TabbedBrowser\MainWindow.xaml.cs:line 53

--- End of inner exception stack trace ---

at EO.TabbedBrowser.MainWindow..ctor()

at EO.TabbedBrowser.App.Application_Startup(Object sender, StartupEventArgs e) in C:\My Box\EO\EO.Total 2017\Samples\CS\WebBrowser\TabbedBrowser\App.xaml.cs:line 43

at System.Windows.Application.OnStartup(StartupEventArgs e)

at System.Windows.Application.<.ctor>b__1_0(Object unused)

at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

ruk
Posted: Monday, May 22, 2017 10:25:34 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 48
BTW, I'm using Windows 10 and EssentialObjects version 2017.1.42.0.
eo_support
Posted: Tuesday, May 23, 2017 11:39:50 AM
Rank: Administration
Groups: Administration

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

Currently InitWorkerProcessExecutable will always try to overwrite the file, if it already exists. So if the file is currently in use and you call InitWorkerProcessExecutable, you will get this exception. You can add code to check if the file exists first and only call InitWorkerProcessExecutable when it does not exist.

We will also change our code to perform this check on our end in our next build.

Thanks!
ruk
Posted: Tuesday, May 23, 2017 12:03:39 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 48
Thank you. The reason we call InitWorkerProcessExecutable() is for two reasons - to enable large address space and to name the sub process to follow our naming conventions so the process is easily identifiable.

If we don't call the InitWorkerProcessExecutable() in our code, then it initializes the rundll32.exe instead of the named exe we wanted. Note that this happens even if the named sub process exe is present in the main executable folder.

Will your fix avoid recreating the sub process exe if one already exists? If so, this would address this issue.

Thank you again for the prompt response.
eo_support
Posted: Tuesday, May 23, 2017 1:25:37 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,066
ruk wrote:
Will your fix avoid recreating the sub process exe if one already exists? If so, this would address this issue.


Yes. This will be implemented in our next build. In the mean time, you can add a if (File.Exists(fileName)) test before calling InitWorkerProcessExecutable. It's just a single line of code.
eo_support
Posted: Friday, May 26, 2017 2:37:30 PM
Rank: Administration
Groups: Administration

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

We have posted a new build that will automatically check if the file already exists and also verify the file's signature (so you won't be able to substitute it with another file). This should resolve the issue for you. Please download the new build from our download page and let us know how it goes.

Thanks!
ruk
Posted: Tuesday, May 30, 2017 11:29:23 AM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2017
Posts: 48
Thank you. We have tested with the latest build and it fixes the issue reported.

We have a question related to the architecture of the sub process being launched by the web browser. This may be done at the Chromium layer. But would be helpful if there are any information/links related to sub process. Specifically we would like to understand these:
- What are these sub process do, their responsibilities.
- Relationship between number of web control instance to number of sub processes.
- We noticed when running the same app on two different machines, the number of sub processes are different. On a machine with older graphic card (not sure if this is the one making the difference), we see 3 sub processes while on another machine, running the same app has 5 sub processes.

Appreciate any information to get an understanding of these sub processes.
eo_support
Posted: Tuesday, May 30, 2017 11:54:22 AM
Rank: Administration
Groups: Administration

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

The sub process are mostly done both by the Chromium layer and it may change in future version of Chromium. So here we can only give you brief summary:

1. There is one render process per site. For example, if you create three WebViews that loads "site1.com/page1", "site1.com/page2", "site2.com/page3", then there will be two render processes: one for site1.com and one for site2.com;
2. There usually is one GPU process --- this process may not exist if the system does not support hardware GPU acceleration;
3. There can be multiple utility process running from time to time. These processes are for specific tasks and it usually exits as soon as the task is done. For example, a printing task will start a utility process for each page that it prints;
4. There can be multiple processes for plugins. Each type of plugin runs in a single process;
5. There is one browser process that coordinates all the above processes and is also responsible for loading resources for network;

If you want to know more details about these processes, you can search online for Chromium documentations/discussions.

The above sub process are created by the Chromium browser engine. We also create a single process that facilitate our internal works such as dll loading, logs, etc.

So at a minimum you will have three sub processes:

1 EO sub process;
1 browser sub process;
1 render sub process

Hope this helps.

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.