Running cefclient with --off-screen-rendering-enabled crash

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.

Running cefclient with --off-screen-rendering-enabled crash

Postby pingu7931 » Fri Dec 02, 2016 8:31 am

Hi All

Running cefclient 32-bit in debug mode (VS2015) on Windows 7 x64 I'm getting the following:
Code: Select all
[1202/132620:FATAL:osr_window_win.cc(40)] Check failed: result.

cefclient.exe has triggered a breakpoint.


If I run in debug mode without debugging it just crashes.

CEF Version 3.2883.1539 - I'm building the client from the standard distribution - was hoping not to have to build cef itself
pingu7931
Techie
 
Posts: 21
Joined: Thu Dec 01, 2016 4:43 am

Re: Running cefclient with --off-screen-rendering-enabled cr

Postby pingu7931 » Fri Dec 02, 2016 9:27 am

Call stack if needed:

libcef.dll!cef_log(const char * file, int line, int severity, const char * message) Line 388 C++
cefclient.exe!cef::logging::LogMessage::~LogMessage() Line 181 C++
cefclient.exe!client::`anonymous namespace'::ScopedGLContext::~ScopedGLContext() Line 42 C++
cefclient.exe!client::OsrWindowWin::OnPaint(CefRefPtr<CefBrowser> browser, cef_paint_element_type_t type, const std::vector<CefRect,std::allocator<CefRect> > & dirtyRects, const void * buffer, int width, int height) Line 939 C++
cefclient.exe!client::ClientHandlerOsr::OnPaint(CefRefPtr<CefBrowser> browser, cef_paint_element_type_t type, const std::vector<CefRect,std::allocator<CefRect> > & dirtyRects, const void * buffer, int width, int height) Line 107 C++
cefclient.exe!`anonymous namespace'::render_handler_on_paint(_cef_render_handler_t * self, _cef_browser_t * browser, cef_paint_element_type_t type, unsigned int dirtyRectsCount, const _cef_rect_t * dirtyRects, const void * buffer, int width, int height) Line 244 C++
libcef.dll!CefRenderHandlerCToCpp::OnPaint(CefRefPtr<CefBrowser> browser, cef_paint_element_type_t type, const std::vector<CefRect,std::allocator<CefRect> > & dirtyRects, const void * buffer, int width, int height) Line 191 C++
libcef.dll!CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect & damage_rect, int bitmap_width, int bitmap_height, void * bitmap_pixels) Line 1338 C++
libcef.dll!base::internal::FunctorTraits<void (__thiscall CefRenderWidgetHostViewOSR::*)(gfx::Rect const &,int,int,void *),void>::Invoke<base::WeakPtr<CefRenderWidgetHostViewOSR> const &,gfx::Rect const &,int,int,void *>(void(CefRenderWidgetHostViewOSR::*)(const gfx::Rect &, int, int, void *) method, const base::WeakPtr<CefRenderWidgetHostViewOSR> & receiver_ptr, const gfx::Rect & <args_0>, int && <args_1>, int && <args_2>, void * && <args_3>) Line 215 C++
libcef.dll!base::internal::InvokeHelper<1,void>::MakeItSo<void (__thiscall CefRenderWidgetHostViewOSR::*const &)(gfx::Rect const &,int,int,void *),base::WeakPtr<CefRenderWidgetHostViewOSR> const &,gfx::Rect const &,int,int,void *>(void(CefRenderWidgetHostViewOSR::*)(const gfx::Rect &, int, int, void *) & functor, const base::WeakPtr<CefRenderWidgetHostViewOSR> & weak_ptr, const gfx::Rect & <args_0>, int && <args_1>, int && <args_2>, void * && <args_3>) Line 305 C++
libcef.dll!base::internal::Invoker<base::internal::BindState<void (__thiscall CefRenderWidgetHostViewOSR::*)(gfx::Rect const &,int,int,void *),base::WeakPtr<CefRenderWidgetHostViewOSR> >,void __cdecl(gfx::Rect const &,int,int,void *)>::Run(base::internal::BindStateBase * base, const gfx::Rect & <unbound_args_0>, int && <unbound_args_1>, int && <unbound_args_2>, void * && <unbound_args_3>) Line 339 C++
libcef.dll!base::internal::RunMixin<base::Callback<void __cdecl(GURL const &,enum SupervisedUserURLFilter::FilteringBehavior,enum supervised_user_error_page::FilteringBehaviorReason,bool),1,1> >::Run(const GURL & <args_0>, SupervisedUserURLFilter::FilteringBehavior <args_1>, supervised_user_error_page::FilteringBehaviorReason <args_2>, bool <args_3>) Line 64 C++
libcef.dll!CefSoftwareOutputDeviceOSR::OnPaint(const gfx::Rect & damage_rect) Line 114 C++
libcef.dll!CefSoftwareOutputDeviceOSR::EndPaint() Line 80 C++
libcef.dll!cc::SoftwareRenderer::FinishDrawingFrame(cc::DirectRenderer::DrawingFrame * frame) Line 81 C++
libcef.dll!cc::DirectRenderer::DrawFrame(std::vector<std::unique_ptr<cc::RenderPass,std::default_delete<cc::RenderPass> >,std::allocator<std::unique_ptr<cc::RenderPass,std::default_delete<cc::RenderPass> > > > * render_passes_in_draw_order, float device_scale_factor, const gfx::ColorSpace & device_color_space, const gfx::Size & device_viewport_size) Line 297 C++
libcef.dll!cc::Display::DrawAndSwap() Line 306 C++
libcef.dll!cc::DisplayScheduler::DrawAndSwap() Line 132 C++
libcef.dll!cc::DisplayScheduler::AttemptDrawAndSwap() Line 338 C++
libcef.dll!cc::DisplayScheduler::OnBeginFrameDeadline() Line 354 C++
libcef.dll!base::internal::InvokeHelper<1,void>::MakeItSo<void (__thiscall content::MediaStreamSource::*const &)(void),base::WeakPtr<content::MediaStreamAudioSource> const &>(void(content::MediaStreamSource::*)() & functor, const base::WeakPtr<content::MediaStreamAudioSource> & weak_ptr) Line 305 C++
libcef.dll!base::internal::Invoker<base::internal::BindState<void (__thiscall content::MediaStreamSource::*)(void),base::WeakPtr<content::MediaStreamAudioSource> >,void __cdecl(void)>::Run(base::internal::BindStateBase * base) Line 339 C++
libcef.dll!base::CancelableCallback<void __cdecl(void)>::Forward() Line 110 C++
libcef.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, const base::PendingTask & pending_task) Line 54 C++
> libcef.dll!base::MessageLoop::RunTask(const base::PendingTask & pending_task) Line 403 C++
libcef.dll!base::MessageLoop::DoWork() Line 510 C++
libcef.dll!base::MessagePumpForUI::DoRunLoop() Line 264 C++
libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate) Line 143 C++
libcef.dll!base::MessageLoop::RunHandler() Line 368 C++
libcef.dll!base::RunLoop::Run() Line 36 C++
libcef.dll!CefBrowserMessageLoop::RunMessageLoop() Line 128 C++
libcef.dll!CefRunMessageLoop() Line 227 C++
cefclient.exe!client::MainMessageLoopStd::Run() Line 16 C++
pingu7931
Techie
 
Posts: 21
Joined: Thu Dec 01, 2016 4:43 am

Re: Running cefclient with --off-screen-rendering-enabled cr

Postby pingu7931 » Fri Dec 02, 2016 11:20 am

It works fine in release mode so a workaround is to remove the Debug check from the destructor in osr_window_win.cc.

Code: Select all
class ScopedGLContext {
 public:
  ScopedGLContext(HDC hdc, HGLRC hglrc, bool swap_buffers)
    : hdc_(hdc),
      swap_buffers_(swap_buffers) {
    BOOL result = wglMakeCurrent(hdc, hglrc);
    ALLOW_UNUSED_LOCAL(result);
    DCHECK(result);
  }
  ~ScopedGLContext() {
    BOOL result = wglMakeCurrent(NULL, NULL);
    DCHECK(result);
    if (swap_buffers_) {
      result = SwapBuffers(hdc_);
      //DCHECK(result);
    }
  }

 private:
  const HDC hdc_;
  const bool swap_buffers_;
};
pingu7931
Techie
 
Posts: 21
Joined: Thu Dec 01, 2016 4:43 am

Re: Running cefclient with --off-screen-rendering-enabled cr

Postby magreenblatt » Fri Dec 02, 2016 11:50 am

What specifically are you doing in cefclient when you hit this DCHECK? You can add a call to GetLastError after the failed call to SwapBuffers to get more information on why its failing.
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: Running cefclient with --off-screen-rendering-enabled cr

Postby pingu7931 » Mon Dec 05, 2016 6:06 am

I'm building cefclient as it comes in the standard distribution as downloaded from http://opensource.spotify.com/cefbuilds/index.html (3.2883.1539.gd7f087e)
I have made no code modifications. The wiki states that this should work out of the box: https://bitbucket.org/chromiumembedded/ ... -rendering

SwapBuffers is returning 0 and GetLastError() also returns 0. So not much help I'm afraid.
pingu7931
Techie
 
Posts: 21
Joined: Thu Dec 01, 2016 4:43 am


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 24 guests