Can't set sub process path on linux

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Re: Can't set sub process path on linux

Postby fddima » Wed May 15, 2013 1:54 am

1. I test in on linux (32 bit build), and i'm confirm that for zygote process BrowserSubprocessPath is not used. It used for other processes but not for zygote. I'm now not sure how it was be before, but i believe that it is bug, so please fill it in cef issue tracker.
2. You can workaround this by using CefBrowserProcessHandler.OnBeforeChildProcessLaunch. This method was introduced especially for mono and java platforms, when additional command line processing is required. You can check it from my example (it invokes mono for each subprocess). Basically calling something like
Code: Select all
commandLine.SetProgram("/path/to/child-process")
will be enough for you, if it is standalone child process.

About how to disable zygote - don't know. Needed to be explored inside code.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Can't set sub process path on linux

Postby magreenblatt » Wed May 15, 2013 3:41 am

fddima wrote:1. I test in on linux (32 bit build), and i'm confirm that for zygote process BrowserSubprocessPath is not used. It used for other processes but not for zygote. I'm now not sure how it was be before, but i believe that it is bug, so please fill it in cef issue tracker.

This is filed as https://code.google.com/p/chromiumembed ... ail?id=980
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Can't set sub process path on linux

Postby magreenblatt » Wed May 15, 2013 4:22 am

fddima wrote:2. You can workaround this by using CefBrowserProcessHandler.OnBeforeChildProcessLaunch.

I've verified that this works. See the example in the above issue.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Can't set sub process path on linux

Postby pchuong » Wed May 15, 2013 9:51 am

Using OnBeforeChildProcessLaunch method, the zygote process is created. Thanks!

I am wondering why the main process (java) is forked on linux. I see two java processes after the browser is opened. Is it expected that the parent process get forked?
On Windows, I don't see the second java process, only the child process(es) is listed when I attach with VS debugger.
pchuong
Mentor
 
Posts: 73
Joined: Tue Nov 06, 2012 1:41 pm

Re: Can't set sub process path on linux

Postby fddima » Wed May 15, 2013 10:15 am

pchuong wrote:Using OnBeforeChildProcessLaunch method, the zygote process is created. Thanks!
I am wondering why the main process (java) is forked on linux. I see two java processes after the browser is opened. Is it expected that the parent process get forked?
On Windows, I don't see the second java process, only the child process(es) is listed when I attach with VS debugger.

Using mono on linux it is never happens for me. I'm not believe that it is related to fork. Check command line arguments of second java process, and check parent process. Also you can debug related code https://code.google.com/p/chromium/code ... e=cs&l=599 , to see closely what happens.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Can't set sub process path on linux

Postby pchuong » Wed May 15, 2013 1:00 pm

This is the stack of my 2nd java process. It enters into the SandboxIPCProcess.run() method within the RenderSandboxHostLinux::Init() method.

content::RenderSandboxHostLinux::Init() at /home/patrick/chromium/src/content/browser/renderer_host/render_sandbox_host_linux.cc:694 0x884d003d
content::() at /home/patrick/chromium/src/content/browser/browser_main_loop.cc:133 0x88280ede
content::BrowserMainLoop::EarlyInitialization() at /home/patrick/chromium/src/content/browser/browser_main_loop.cc:325 0x88281608
content::BrowserMainRunnerImpl::Initialize() at /home/patrick/chromium/src/content/browser/browser_main_runner.cc:88 0x8828493b
CefMainDelegate::RunProcess() at /home/patrick/chromium/src/cef/libcef/common/main_delegate.cc:357 0x84e820d8
content::RunNamedProcessTypeMain() at /home/patrick/chromium/src/content/app/content_main_runner.cc:443 0x84f24ba5
content::ContentMainRunnerImpl::Run() at /home/patrick/chromium/src/content/app/content_main_runner.cc:760 0x84f25a14
CefContext::Initialize() at /home/patrick/chromium/src/cef/libcef/browser/context.cc:230 0x84e2e14b
CefInitialize() at /home/patrick/chromium/src/cef/libcef/browser/context.cc:92 0x84e2d3aa
cef_initialize() at /home/patrick/chromium/src/cef/libcef_dll/libcef_dll.cc:161 0x84d946b4


And here is the Init method, the parent java process is forked (see below). I am running into Segmentation Fault in the parent java process at random locations. I am suspecting that the child java process is messing up the parent java process and cause the parent java process to crash (is this possible?).

void RenderSandboxHostLinux::Init(const std::string& sandbox_path) {
....

pid_ = fork();
if (pid_ == 0) {
if (HANDLE_EINTR(close(fds[0])) < 0)
DPLOG(ERROR) << "close";
if (HANDLE_EINTR(close(pipefds[1])) < 0)
DPLOG(ERROR) << "close";

SandboxIPCProcess handler(child_lifeline_fd, browser_socket, sandbox_path);
handler.Run();
_exit(0);
}
}
pchuong
Mentor
 
Posts: 73
Joined: Tue Nov 06, 2012 1:41 pm

Re: Can't set sub process path on linux

Postby pchuong » Wed May 15, 2013 1:09 pm

I tried to use the single_process mode, it doesn't seem to have any affect.. The child processes are still running...
pchuong
Mentor
 
Posts: 73
Joined: Tue Nov 06, 2012 1:41 pm

Re: Can't set sub process path on linux

Postby fddima » Wed May 15, 2013 2:23 pm

You are right, currently it is fork main process for some reason. It is something new to me.
Code: Select all
fddima    2192  2130  0 22:18 pts/1    00:00:00         /usr/bin/cli ./Xilium.CefGlue.Demo.GtkSharp.exe
fddima    2196  2192  0 22:18 pts/1    00:00:00           /usr/bin/cli ./Xilium.CefGlue.Demo.GtkSharp.exe
fddima    2197  2192  0 22:18 pts/1    00:00:00           /home/fddima/prj.xilium/xilium.cefglue/CefGlue.Demo.GtkSharp/bin/Debug/cefclient --type=zygote --no-sandbox --lang=en-US --locales-dir-path=/home/fddima/prj.xilium/xilium.cefglue/CefGlue.Demo.GtkSha
fddima    2218  2197  0 22:18 pts/1    00:00:00             /home/fddima/prj.xilium/xilium.cefglue/CefGlue.Demo.GtkSharp/bin/Debug/cefclient --type=renderer --no-sandbox --lang=en-US --lang=en-US --locales-dir-path=/home/fddima/prj.xilium/xilium.cefglue/Ce


Chrome do same:
Code: Select all
fddima    2228     1  2 22:18 ?        00:00:02   /opt/google/chrome/chrome       
fddima    2235  2228  0 22:18 ?        00:00:00     /opt/google/chrome/chrome       
fddima    2236  2228  0 22:18 ?        00:00:00     /opt/google/chrome/chrome-sandbox /opt/google/chrome/chrome --type=zygote
fddima    2237  2236  0 22:18 ?        00:00:00       /opt/google/chrome/chrome --type=zygote
fddima    2241  2237  0 22:18 ?        00:00:00         /opt/google/chrome/nacl_helper_bootstrap /opt/google/chrome/nacl_helper --reserved_at_zero=0x0000000040000000 --r_debug=0x0000000040000000
fddima    2242  2237  0 22:18 ?        00:00:00         /opt/google/chrome/chrome --type=zygote
fddima    2273  2242  0 22:18 ?        00:00:00           /opt/google/chrome/chrome --type=renderer --lang=en-US --force-fieldtrials=AsyncDns/AsyncDnsA/AutocompleteDynamicTrial_0/LiveSpellingExperiment/AutocompleteDynamicTrial_1/DisabledProviders_16/Autoco
fddima    2287  2242  0 22:18 ?        00:00:00           /opt/google/chrome/chrome --type=renderer --lang=en-US --force-fieldtrials=AsyncDns/AsyncDnsA/AutocompleteDynamicTrial_0/LiveSpellingExperiment/AutocompleteDynamicTrial_1/DisabledProviders_16/Autoco



UPD: Only one, that i'm did not get crashes.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Can't set sub process path on linux

Postby pchuong » Wed May 15, 2013 3:17 pm

I see that the gtksharp process uses no-sandbox, where chrome does. Does it make any differences?
pchuong
Mentor
 
Posts: 73
Joined: Tue Nov 06, 2012 1:41 pm

Re: Can't set sub process path on linux

Postby fddima » Wed May 15, 2013 3:33 pm

pchuong wrote:I see that the gtksharp process uses no-sandbox, where chrome does. Does it make any differences?

CEF doesn't support sandbox at this moment, so you will have same.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

PreviousNext

Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 31 guests