apimall / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
0 stars 1 forks source link

NULL message loop pointer when running a daemon on a headless machine #1523

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Headless ubuntu 14.04
2. Run Xvfb 
3. Run a CEF application as an init.d daemon

What is the expected output? What do you see instead?
The application is expected to run and generate screenshots
Instead I get a segmentation fault:
#0  base::MessageLoop::type() const () at 
../../base/message_loop/message_loop.h:288
#1  0x00007f9a9ac59cd4 in CefBrowserMessageLoop::current() () at 
../../cef/libcef/browser/browser_message_loop.cc:17
#2  0x00007f9a9ac7bb79 in CefRunMessageLoop() () at 
../../cef/libcef/browser/context.cc:177
#3  0x00007f9a9ab8f9a9 in cef_run_message_loop () at 
../../cef/libcef_dll/libcef_dll.cc:284
#4  0x00000000004784c2 in CefRunMessageLoop () at 
/mnt/work/stylls/PrintGeneratorCEF/cef_binary_3_linux64/libcef_dll/wrapper/libce
f_dll_wrapper.cc:276
#5  0x00000000004443dc in main (argc=1, argv=0x7fffa8ad4c08) at 
/mnt/work/stylls/PrintGeneratorCEF/printGenerator/cefgenerator_linux.cpp:96

What version of the product are you using? On what operating system?
CEF Version: 3.2171.1972
OS: Ubuntu 14.04.1 LTS

Please provide any additional information below.
The application is working great if its run as a normal executable. If I use it 
as a daemon or have it started automatically by monit it receives this core 
dump.

I've had a similar error before when Xvfb was not running, i'm not sure if its 
related. (See: https://code.google.com/p/chromiumembedded/issues/detail?id=1503)

Original issue reported on code.google.com by yona...@stylls.com on 4 Feb 2015 at 10:35

GoogleCodeExporter commented 9 years ago
The problem is likely something in your environment -- either necessary 
services have not yet started or perhaps there are restrictions on executables 
run by init.d. Are you sure that Xvfb is actually running and available at the 
time that the CEF-based application is started?

Original comment by magreenb...@gmail.com on 5 Feb 2015 at 6:52

GoogleCodeExporter commented 9 years ago
Yes,
I can see the Xvfb process running in the process list

I try to run the CEF application as a service and it crashes after a few 
seconds and then right after I run the executable normally and it will run with 
no issues.

Original comment by yona...@stylls.com on 5 Feb 2015 at 7:24

GoogleCodeExporter commented 9 years ago
@#2: It seems that for some reason the MessageLoop object is not being created 
in your use case. The MessageLoop should be created in 
CefBrowserMainParts::PreMainMessageLoopStart(). Here's the call stack from 
Windows at trunk revision 2020 (it should be similar on Linux):

    libcef.dll!base::MessageLoop::MessageLoop(base::MessageLoop::Type type) Line 136    C++
    libcef.dll!base::MessageLoopForUI::MessageLoopForUI() Line 528  C++
    libcef.dll!CefBrowserMessageLoop::CefBrowserMessageLoop() Line 8    C++
>   libcef.dll!CefBrowserMainParts::PreMainMessageLoopStart() Line 60   C++
    libcef.dll!content::BrowserMainLoop::MainMessageLoopStart() Line 472    C++
    libcef.dll!content::BrowserMainRunnerImpl::Initialize(const content::MainFunctionParams & parameters) Line 186  C++
    libcef.dll!CefMainDelegate::RunProcess(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & process_type, const content::MainFunctionParams & main_function_params) Line 457    C++
    libcef.dll!content::RunNamedProcessTypeMain(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & process_type, const content::MainFunctionParams & main_function_params, content::ContentMainDelegate * delegate) Line 411  C++
    libcef.dll!content::ContentMainRunnerImpl::Run() Line 803   C++
    libcef.dll!CefContext::Initialize(const CefMainArgs & args, const CefStructBase<CefSettingsTraits> & settings, CefRefPtr<CefApp> application, void * windows_sandbox_info) Line 292 C++
    libcef.dll!CefInitialize(const CefMainArgs & args, const CefStructBase<CefSettingsTraits> & settings, CefRefPtr<CefApp> application, void * windows_sandbox_info) Line 124  C++
    libcef.dll!cef_initialize(const _cef_main_args_t * args, const _cef_settings_t * settings, _cef_app_t * application, void * windows_sandbox_info) Line 171  C++
    cefclient.exe!CefInitialize(const CefMainArgs & args, const CefStructBase<CefSettingsTraits> & settings, CefRefPtr<CefApp> application, void * windows_sandbox_info) Line 163   C++

It's possible that one of the methods leading up to this call is bailing out 
early on your system. You will likely need to debug the problem and report back 
with your findings.

Original comment by magreenb...@gmail.com on 5 Feb 2015 at 7:42

GoogleCodeExporter commented 9 years ago
CEF is transitioning from Google Code to Bitbucket project hosting. If you 
would like to continue receiving notifications on this issue please add 
yourself as a Watcher at the new location: 
https://bitbucket.org/chromiumembedded/cef/issue/1523

Original comment by magreenb...@gmail.com on 14 Mar 2015 at 3:37