x11 FindChild fails during a call to CreateHostWindow

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.

x11 FindChild fails during a call to CreateHostWindow

Postby Czarek » Fri Aug 17, 2018 5:30 am

In CEF v66 I have problem with browser creation crashing with PyQt4 and PySide apps (based on Qt4). It works fine in PyQt5 and wxPython apps, but not with Qt4. It worked fine in CEF v57 and there weren't any code modifications in my app, only CEF was upgraded. The stack trace is following:

Code: Select all
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff1d9e0bf in FindChild () at ../../cef/libcef/browser/native/window_x11.cc:44
44   ../../cef/libcef/browser/native/window_x11.cc: No such file or directory.
(gdb) bt
#0  0x00007ffff1d9e0bf in FindChild () at ../../cef/libcef/browser/native/window_x11.cc:44
#1  Show () at ../../cef/libcef/browser/native/window_x11.cc:178
#2  0x00007ffff1d9aa57 in CreateHostWindow ()
    at ../../cef/libcef/browser/native/browser_platform_delegate_native_linux.cc:89
#3  0x00007ffff1cb5879 in CreateHostWindow () at ../../cef/libcef/browser/browser_host_impl.cc:3159
#4  CreateInternal () at ../../cef/libcef/browser/browser_host_impl.cc:418
#5  0x00007ffff1cb436f in Create () at ../../cef/libcef/browser/browser_host_impl.cc:359
#6  0x00007ffff1cb3b3d in CreateBrowserSync () at ../../cef/libcef/browser/browser_host_impl.cc:275


Here are the corresponding CEF source codes for the stack trace:
0. https://github.com/chromiumembedded/cef ... x11.cc#L44
1. https://github.com/chromiumembedded/cef ... 11.cc#L178
2. https://github.com/chromiumembedded/cef ... nux.cc#L89
3. https://github.com/chromiumembedded/cef ... l.cc#L3159
4. https://github.com/chromiumembedded/cef ... pl.cc#L418
5. https://github.com/chromiumembedded/cef ... pl.cc#L359
6. https://github.com/chromiumembedded/cef ... pl.cc#L275

The parent window in which CEF browser is embedded is shown and realized.

Any idea of what could go wrong? Thank your for help.

CEF 3359, Ubuntu 14.04.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: x11 FindChild fails during a call to CreateHostWindow

Postby magreenblatt » Fri Aug 17, 2018 11:11 am

Looks like XQueryTree is returning no children (it should have a child DesktopWindowTreeHostX11 created by Chromium). In any case the code should be fixed not to crash.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: x11 FindChild fails during a call to CreateHostWindow

Postby Czarek » Fri Aug 17, 2018 2:37 pm

Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: x11 FindChild fails during a call to CreateHostWindow

Postby loki » Sat May 11, 2019 3:18 am

Hi
I have the same issue, but with different configuration.
I have host app based on SDL2, and I am trying to create browser this way:

Code: Select all
    CefWindowInfo window_info;
    window_info.SetAsChild((cef_window_handle_t)window_handle, GetRectWebForm(window_handle, w, h));

    auto manager = CefCookieManager::GetGlobalManager(nullptr);
    manager->SetStoragePath(CEF_CACHE_FOLDER, false, nullptr);

    CefBrowserSettings browser_settings;

    CefBrowserHost::CreateBrowser(window_info, this, url, browser_settings, NULL);


where window_handle is X11::Window.

My app crashes in FindChild with SEGFAULT.
Any idia how to fix this?
loki
Newbie
 
Posts: 3
Joined: Sat May 11, 2019 3:11 am

Re: x11 FindChild fails during a call to CreateHostWindow

Postby Czarek » Sat May 11, 2019 11:33 am

@loki I have attached a patch in the tracker: https://bitbucket.org/chromiumembedded/ ... t-49187953
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: x11 FindChild fails during a call to CreateHostWindow

Postby loki » Sat May 11, 2019 11:58 pm

But the current code assums that there is always 1 child window (according to DCHECK_EQ(1U, nchildren);).
Will be all fine if FindChild return x11::None?
loki
Newbie
 
Posts: 3
Joined: Sat May 11, 2019 3:11 am

Re: x11 FindChild fails during a call to CreateHostWindow

Postby Czarek » Sun May 12, 2019 2:17 am

Yes, it works.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: x11 FindChild fails during a call to CreateHostWindow

Postby loki » Sun May 12, 2019 3:50 am

Thank you, I will try.
loki
Newbie
 
Posts: 3
Joined: Sat May 11, 2019 3:11 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 99 guests