Console crashes while dragging selected text

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.

Console crashes while dragging selected text

Postby smayoral » Wed May 13, 2020 10:06 am

I have changed a bit the client_handler.cc code to show the development tools and

instead of:

if (!has_devtools) {
// Create a new RootWindow for the DevTools browser that will be created
// by ShowDevTools().
has_devtools = CreatePopupWindow(browser, true, CefPopupFeatures(),
windowInfo, client, settings);

}

I have:

if (!hasDevTools) {
windowInfo.SetAsPopup(host->GetWindowHandle(), "development tools");
hasDevTools = true;

}

With the original version if text is selected in the console and tried to drag it somewhere else, a not allowed icon is shown and nothing happens.
But with the modified version this dragging operation is allowed but the application crashes...

This crash happens always. It can be easily reproduced. This is the stack trace I get:

2020-05-13 17:03:05.675 at CefBrowserHostImpl::CanDragEnter in Y:\work\CEF3_git\chromium\src\cef\libcef\browser\browser_host_impl.cc: line: 2315: address: 0x10E22DFE
2020-05-13 17:03:05.721 at content::WebContentsViewAura::DragEnteredCallback in Y:\work\CEF3_git\chromium\src\content\browser\web_contents\web_contents_view_aura.cc: line: 1271: address: 0xFF775AA
2020-05-13 17:03:05.752 at base::internal::FunctorTraits<void (content::WebContentsViewAura::*)(ui::DropTargetEvent, std::__1::unique_ptr<content::DropData,std::__1::default_delete<content::DropData> >, base::WeakPtr<content::RenderWidgetHostViewBase>, base::Optional<gfx::PointF>) __attribute__((thiscall)),void>::Invoke<void (content::WebContentsViewAura::*)(ui::DropTargetEvent, std::__1::unique_ptr<content::DropData,std::__1::default_delete<content::DropData> >, base::WeakPtr<content::RenderWidgetHostViewBase>, base::Optional<gfx::PointF>) __attribute__((thiscall)),base::WeakPtr<content::WebContentsViewAura>,ui::DropTargetEvent,std::__1::unique_ptr<content::DropData,std::__1::default_delete<content::DropData> >,base::WeakPtr<content::RenderWidgetHostViewBase>,base::Optional<gfx::PointF> > in Y:\work\CEF3_git\chromium\src\base\bind_internal.h: line: 499: address: 0xFF79476
2020-05-13 17:03:05.791 at base::internal::Invoker<base::internal::BindState<void (content::WebContentsViewAura::*)(ui::DropTargetEvent, std::__1::unique_ptr<content::DropData,std::__1::default_delete<content::DropData> >, base::WeakPtr<content::RenderWidgetHostViewBase>, base::Optional<gfx::PointF>) __attribute__((thiscall)),base::WeakPtr<content::WebContentsViewAura>,ui::DropTargetEvent,std::__1::unique_ptr<content::DropData,std::__1::default_delete<content::DropData> > >,void (base::WeakPtr<content::RenderWidgetHostViewBase>, base::Optional<gfx::PointF>)>::RunOnce in Y:\work\CEF3_git\chromium\src\base\bind_internal.h: line: 645: address: 0xFF793FE
2020-05-13 17:03:05.826 at base::OnceCallback<void (base::WeakPtr<content::RenderWidgetHostViewBase>, base::Optional<gfx::PointF>)>::Run in Y:\work\CEF3_git\chromium\src\base\callback.h: line: 98: address: 0xFEC39DC
2020-05-13 17:03:05.847 at content::RenderWidgetTargeter::TargetingRequest::RunCallback in Y:\work\CEF3_git\chromium\src\content\browser\renderer_host\render_widget_targeter.cc: line: 134: address: 0xFEC3972
2020-05-13 17:03:05.855 at content::RenderWidgetTargeter::FoundTarget in Y:\work\CEF3_git\chromium\src\content\browser\renderer_host\render_widget_targeter.cc: line: 500: address: 0xFEC41AA
2020-05-13 17:03:05.865 at content::RenderWidgetTargeter::ResolveTargetingRequest in Y:\work\CEF3_git\chromium\src\content\browser\renderer_host\render_widget_targeter.cc: line: 268: address: 0xFEC3D8E
2020-05-13 17:03:05.905 at content::RenderWidgetTargeter::FindTargetAndCallback in Y:\work\CEF3_git\chromium\src\content\browser\renderer_host\render_widget_targeter.cc: line: 232: address: 0xFEC4094
2020-05-13 17:03:05.920 at content::RenderWidgetHostInputEventRouter::GetRenderWidgetHostAtPointAsynchronously in Y:\work\CEF3_git\chromium\src\content\browser\renderer_host\render_widget_host_input_event_router.cc: line: 1390: address: 0xFEB9188
2020-05-13 17:03:05.947 at content::WebContentsViewAura::OnDragEntered in Y:\work\CEF3_git\chromium\src\content\browser\web_contents\web_contents_view_aura.cc: line: 1303: address: 0xFF777D0
2020-05-13 17:03:05.956 at views::DesktopDropTargetWin::Translate in Y:\work\CEF3_git\chromium\src\ui\views\widget\desktop_aura\desktop_drop_target_win.cc: line: 159: address: 0x137CED30
2020-05-13 17:03:05.971 at views::DesktopDropTargetWin::OnDragEnter in Y:\work\CEF3_git\chromium\src\ui\views\widget\desktop_aura\desktop_drop_target_win.cc: line: 66: address: 0x137CECAC
2020-05-13 17:03:05.976 at ui::DropTargetWin::DragEnter in Y:\work\CEF3_git\chromium\src\ui\base\dragdrop\drop_target_win.cc: line: 53: address: 0x137CF1F6
2020-05-13 17:03:05.979 at GetActiveObjectExt, address 0x77AE5C30
2020-05-13 17:03:05.979 in C:\WINDOWS\System32\ole32.dll
2020-05-13 17:03:05.980 at GetActiveObjectExt, address 0x77AE5C30
2020-05-13 17:03:05.980 in C:\WINDOWS\System32\ole32.dll
2020-05-13 17:03:05.981 at OleGetPackageClipboardOwner, address 0x77AB0290
2020-05-13 17:03:05.981 in C:\WINDOWS\System32\ole32.dll
2020-05-13 17:03:05.983 at OleGetPackageClipboardOwner, address 0x77AB0290
2020-05-13 17:03:05.983 in C:\WINDOWS\System32\ole32.dll
2020-05-13 17:03:06.003 at DoDragDrop, address 0x77AB9B40
2020-05-13 17:03:06.003 in C:\WINDOWS\System32\ole32.dll
2020-05-13 17:03:06.017 at views::DesktopDragDropClientWin::StartDragAndDrop in Y:\work\CEF3_git\chromium\src\ui\views\widget\desktop_aura\desktop_drag_drop_client_win.cc: line: 52: address: 0x132077BE
2020-05-13 17:03:06.054 at content::WebContentsViewAura::StartDragging in Y:\work\CEF3_git\chromium\src\content\browser\web_contents\web_contents_view_aura.cc: line: 1090: address: 0xFF76E68
2020-05-13 17:03:06.123 at content::RenderWidgetHostImpl::OnStartDragging in Y:\work\CEF3_git\chromium\src\content\browser\renderer_host\render_widget_host_impl.cc: line: 1809: address: 0xFEAEE52
2020-05-13 17:03:06.132 at IPC::MessageT<DragHostMsg_StartDragging_Meta,std::__1::tuple<content::DropData,blink::WebDragOperation,SkBitmap,gfx::Vector2d,content::DragEventSourceInfo>,void>::Dispatch<content::RenderWidgetHostImpl,content::RenderWidgetHostImpl,void,void (content::RenderWidgetHostImpl::*)(const content::DropData &, blink::WebDragOperation, const SkBitmap &, const gfx::Vector2d &, const content::DragEventSourceInfo &) __attribute__((thiscall))> in Y:\work\CEF3_git\chromium\src\ipc\ipc_message_templates.h: line: 146: address: 0xFEAED00
2020-05-13 17:03:06.172 at content::RenderWidgetHostImpl::OnMessageReceived in Y:\work\CEF3_git\chromium\src\content\browser\renderer_host\render_widget_host_impl.cc: line: 640: address: 0xFEAD294
2020-05-13 17:03:06.478 at content::RenderProcessHostImpl::OnMessageReceived in Y:\work\CEF3_git\chromium\src\content\browser\renderer_host\render_process_host_impl.cc: line: 3273: address: 0xFEA12F0
2020-05-13 17:03:06.562 at IPC::ChannelProxy::Context::OnDispatchMessage in Y:\work\CEF3_git\chromium\src\ipc\ipc_channel_proxy.cc: line: 324: address: 0x10FD0112
2020-05-13 17:03:06.612 at base::internal::Invoker<base::internal::BindState<void (media::AudioInputController::*)(const std::__1::basic_string<char> &) __attribute__((thiscall)),scoped_refptr<media::AudioInputController>,std::__1::basic_string<char> >,void ()>::RunOnce in Y:\work\CEF3_git\chromium\src\base\bind_internal.h: line: 645: address: 0xF8365C0
2020-05-13 17:03:06.664 at base::TaskAnnotator::RunTask in Y:\work\CEF3_git\chromium\src\base\task\common\task_annotator.cc: line: 142: address: 0x10EA2F10
2020-05-13 17:03:06.727 at base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl in Y:\work\CEF3_git\chromium\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc: line: 366: address: 0x1190B950
2020-05-13 17:03:06.797 at base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork in Y:\work\CEF3_git\chromium\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc: line: 221: address: 0x1190B7B0
2020-05-13 17:03:06.828 at base::MessagePumpForUI::DoRunLoop in Y:\work\CEF3_git\chromium\src\base\message_loop\message_pump_win.cc: line: 219: address: 0x10E79250
2020-05-13 17:03:06.848 at base::MessagePumpWin::Run in Y:\work\CEF3_git\chromium\src\base\message_loop\message_pump_win.cc: line: 77: address: 0x10E78B20
2020-05-13 17:03:06.888 at base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run in Y:\work\CEF3_git\chromium\src\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc: line: 463: address: 0x1190C1E0
2020-05-13 17:03:06.905 at base::RunLoop::Run in Y:\work\CEF3_git\chromium\src\base\run_loop.cc: line: 158: address: 0x10E8FE50
2020-05-13 17:03:06.982 at CefRunMessageLoop in Y:\work\CEF3_git\chromium\src\cef\libcef\browser\context.cc: line: 308: address: 0x10E27F39

Can anyone give me a hint what to do to avoid this crash?
Thanks in advance
smayoral
Techie
 
Posts: 39
Joined: Wed Jan 10, 2018 8:58 am

Re: Console crashes while dragging selected text

Postby magreenblatt » Wed May 13, 2020 10:24 am

What OS and CEF version?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Console crashes while dragging selected text

Postby smayoral » Wed May 13, 2020 12:21 pm

sorry I forgot to mention it:

Windows 10 and cef_binary_78.3.9+gc7345f2+chromium-78.0.3904.108
smayoral
Techie
 
Posts: 39
Joined: Wed Jan 10, 2018 8:58 am

Re: Console crashes while dragging selected text

Postby magreenblatt » Wed May 13, 2020 12:28 pm

Can you try with a supported version?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Console crashes while dragging selected text

Postby smayoral » Wed May 13, 2020 12:49 pm

same problem with 81.3.3+g072a5f5+chromium-81.0.4044.138
smayoral
Techie
 
Posts: 39
Joined: Wed Jan 10, 2018 8:58 am

Re: Console crashes while dragging selected text

Postby magreenblatt » Wed May 13, 2020 1:24 pm

smayoral wrote:instead of:

if (!has_devtools) {
// Create a new RootWindow for the DevTools browser that will be created
// by ShowDevTools().
has_devtools = CreatePopupWindow(browser, true, CefPopupFeatures(),
windowInfo, client, settings);

}

I have:

if (!hasDevTools) {
windowInfo.SetAsPopup(host->GetWindowHandle(), "development tools");
hasDevTools = true;

}

In this example you're passing nullptr as the CefClient argument to the ShowDevTools call that follows. The |client_| parameter is therefore nullptr in CefBrowserHostImpl::CanDragEnter and you get a crash. I've filed issue #2934 for this.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Console crashes while dragging selected text

Postby smayoral » Wed May 13, 2020 1:47 pm

nice, thanks a lot

really cool. I created a CefClient helper class for ShowDevTools function call and it now works as expected. Hopefully this also clears some other crashes we had when working with the console.
smayoral
Techie
 
Posts: 39
Joined: Wed Jan 10, 2018 8:58 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 48 guests