[3029] Migration from 2743 - OnPaint in OSR not being called

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: [3029] Migration from 2743 - OnPaint in OSR not being ca

Postby fokz » Tue Apr 04, 2017 1:47 pm

Thank you, I have just found the same thing: https://msdn.microsoft.com/pl-pl/librar ... 51(v=vs.85).aspx

This is why chromium does not detect OS correctly. Geeez....
fokz
Techie
 
Posts: 22
Joined: Sat Jun 18, 2016 10:53 am

Re: [3029] Migration from 2743 - OnPaint in OSR not being ca

Postby fokz » Wed Apr 05, 2017 1:24 pm

The manifest solved the problem but I have one more issue I have hard time debugging.

Renderer process crashes when I use WebSockets in JavaScript. I cannot reproduce the problem in chrome and in cefclient (but I had to load using file:// and in my application I use custom scheme handler - don't know if this might be the cause)

Anyway the log message is following:
Code: Select all
[0405/193606.725:INFO:url_request_manager.cc(279)] CefURLRequestManager hit for twe://editor/js/bundle.js
[0405/193608.443:ERROR:validation_errors.cc(87)] Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED
[0405/193608.444:ERROR:render_process_host_impl.cc(3084)] Terminating render process for bad Mojo message: Received bad user message: Validation failed for WebSocket::AddChannelRequest deserializer [VALIDATION_ERROR_DESERIALIZATION_FAILED]
[0405/193608.444:ERROR:bad_message.cc(23)] Terminating renderer for bad IPC message, reason 123


The moment I comment out any use of WebSocket class it stops crashing. It worked on 2743 and fails at 3029.

This is enought in JavaScript that is needed to trigger this crash:
Code: Select all
socket = new WebSocket("ws://localhost:9002/api/");


The full callstack at the time of logged error:
Code: Select all
>   libcef.dll!content::RenderProcessHostImpl::OnMojoError() Line 3084   C++
    libcef.dll!base::internal::FunctorTraits<void (__cdecl*)(int,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &),void>::Invoke<int const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &>() Line 164   C++
    libcef.dll!base::internal::InvokeHelper<0,void>::MakeItSo<void (__cdecl*const &)(int,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &),int const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &>() Line 285   C++
    libcef.dll!base::internal::Invoker<base::internal::BindState<void (__cdecl*)(int,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &),int>,void __cdecl(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)>::RunImpl<void (__cdecl*const &)(int,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &),std::tuple<int> const &,0>() Line 361   C++
    libcef.dll!base::internal::Invoker<base::internal::BindState<void (__cdecl*)(int,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &),int>,void __cdecl(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &)>::Run() Line 339   C++
    libcef.dll!base::internal::RunMixin<base::Callback<void __cdecl(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &),1,1> >::Run() Line 85   C++
    libcef.dll!mojo::edk::NodeChannel::NotifyBadMessage() Line 227   C++
    libcef.dll!mojo::edk::NodeController::NotifyBadMessageFrom() Line 394   C++
    libcef.dll!mojo::edk::Core::NotifyBadMessage() Line 775   C++
    libcef.dll!MojoNotifyBadMessageImpl() Line 255   C++
    libcef.dll!MojoNotifyBadMessage() Line 282   C++
    libcef.dll!mojo::NotifyBadMessage() Line 78   C++
    libcef.dll!mojo::internal::MessageBuffer::NotifyBadMessage() Line 47   C++
    libcef.dll!mojo::Message::NotifyBadMessage() Line 158   C++
    libcef.dll!mojo::internal::ReportValidationError() Line 89   C++
    libcef.dll!mojo::internal::ReportValidationErrorForMessage() Line 102   C++
    libcef.dll!blink::mojom::WebSocketStubDispatch::Accept() Line 973   C++
    libcef.dll!blink::mojom::WebSocketStub<mojo::RawPtrImplRefTraits<blink::mojom::WebSocket> >::Accept() Line 267   C++
    libcef.dll!mojo::InterfaceEndpointClient::HandleValidatedMessage() Line 411   C++
    libcef.dll!mojo::InterfaceEndpointClient::HandleIncomingMessageThunk::Accept() Line 130   C++
    libcef.dll!mojo::FilterChain::Accept() Line 41   C++
    libcef.dll!mojo::InterfaceEndpointClient::HandleIncomingMessage() Line 296   C++
    libcef.dll!mojo::internal::MultiplexRouter::ProcessIncomingMessage() Line 901   C++
    libcef.dll!mojo::internal::MultiplexRouter::Accept() Line 633   C++
    libcef.dll!mojo::FilterChain::Accept() Line 41   C++
    libcef.dll!mojo::Connector::ReadSingleMessage() Line 257   C++
    libcef.dll!mojo::Connector::ReadAllAvailableMessages() Line 283   C++
    libcef.dll!mojo::Connector::OnHandleReadyInternal() Line 216   C++
    libcef.dll!mojo::Connector::OnWatcherHandleReady() Line 193   C++
    libcef.dll!base::internal::FunctorTraits<void (__thiscall mojo::Connector::*)(unsigned int),void>::Invoke<mojo::Connector *,unsigned int>() Line 215   C++
    libcef.dll!base::internal::InvokeHelper<0,void>::MakeItSo<void (__thiscall mojo::Connector::*const &)(unsigned int),mojo::Connector *,unsigned int>() Line 285   C++
    libcef.dll!base::internal::Invoker<base::internal::BindState<void (__thiscall mojo::Connector::*)(unsigned int),base::internal::UnretainedWrapper<mojo::Connector> >,void __cdecl(unsigned int)>::RunImpl<void (__thiscall mojo::Connector::*const &)(unsigned int),std::tuple<base::internal::UnretainedWrapper<mojo::Connector> > const &,0>() Line 361   C++
    libcef.dll!base::internal::Invoker<base::internal::BindState<void (__thiscall mojo::Connector::*)(unsigned int),base::internal::UnretainedWrapper<mojo::Connector> >,void __cdecl(unsigned int)>::Run() Line 339   C++
    libcef.dll!base::internal::RunMixin<base::Callback<void __cdecl(unsigned int),1,1> >::Run() Line 85   C++
    libcef.dll!mojo::Watcher::OnHandleReady() Line 88   C++
    libcef.dll!base::internal::FunctorTraits<void (__thiscall mojo::Watcher::*)(unsigned int),void>::Invoke<base::WeakPtr<mojo::Watcher> const &,unsigned int const &>() Line 215   C++
    libcef.dll!base::internal::InvokeHelper<1,void>::MakeItSo<void (__thiscall mojo::Watcher::*const &)(unsigned int),base::WeakPtr<mojo::Watcher> const &,unsigned int const &>() Line 305   C++
    libcef.dll!base::internal::Invoker<base::internal::BindState<void (__thiscall mojo::Watcher::*)(unsigned int),base::WeakPtr<mojo::Watcher>,unsigned int>,void __cdecl(void)>::RunImpl<void (__thiscall mojo::Watcher::*const &)(unsigned int),std::tuple<base::WeakPtr<mojo::Watcher>,unsigned int> const &,0,1>() Line 361   C++
    libcef.dll!base::internal::Invoker<base::internal::BindState<void (__thiscall mojo::Watcher::*)(unsigned int),base::WeakPtr<mojo::Watcher>,unsigned int>,void __cdecl(void)>::Run() Line 339   C++
    libcef.dll!base::internal::RunMixin<base::Callback<void __cdecl(void),0,0> >::Run() Line 68   C++
    libcef.dll!base::debug::TaskAnnotator::RunTask() Line 61   C++
    libcef.dll!base::MessageLoop::RunTask() Line 421   C++
    libcef.dll!base::MessageLoop::DeferOrRunPendingTask() Line 434   C++
    libcef.dll!base::MessageLoop::DoWork() Line 524   C++
    libcef.dll!base::MessagePumpForIO::DoRunLoop() Line 483   C++
    libcef.dll!base::MessagePumpWin::Run() Line 58   C++
    libcef.dll!base::MessageLoop::RunHandler() Line 385   C++
    libcef.dll!base::RunLoop::Run() Line 38   C++
    libcef.dll!base::Thread::Run() Line 251   C++
    libcef.dll!content::BrowserThreadImpl::IOThreadRun() Line 278   C++
    libcef.dll!content::BrowserThreadImpl::Run() Line 312   C++
    libcef.dll!base::Thread::ThreadMain() Line 336   C++
    libcef.dll!base::`anonymous namespace'::ThreadFunc() Line 91   C++


The error originates at:
chromium\src\out\Debug_GN_x86\gen\third_party\WebKit\public\platform\modules\websockets\websocket.mojom.cc

Its hard to debug it, I can step over function calls but cannot inspect any values so I am not sure what is wrong but it did step into this branch:
Code: Select all
if (!input_data_view.ReadOrigin(&p_origin))
  success = false;


I suspect that this might be the issue in my custom scheme handler implementation and is somehow affected in newer versions of chromium
Code: Select all
  CefResponse::HeaderMap headers;
  headers.emplace("Access-Control-Allow-Origin", "*"); <--


At this point I am absolutely clueless and act blindly but I was trying to check with: commandLine_->AppendSwitch("allow-insecure-websocket-from-https-origin"); but it didnt help (I found this: https://codereview.chromium.org/248863003/)

I don't need any HTTPS/WSS or whatever since its local app talking to itself, and I need easy way to transfer data from js to the C++ side without binding to JvaScript.
Any ideas?

EDIT: Now I am 100% sure this is due to custom scheme handler. When loading same .html that loads given javascript file using the file:// protocol it works. It breaks when using twe:// and this is something new since 2743. That is why it was working in chrome and cefclient (since I couldn't test it with custom scheme handler).

EDIT2: Problem solved... Either this was something new or this is one of those moments called 'How the **** did it work before?' I failed to call AddCustomScheme for my custom scheme handler on the scheme registrar object.

Now it works like it used to.
fokz
Techie
 
Posts: 22
Joined: Sat Jun 18, 2016 10:53 am

Previous

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 211 guests