electron: Drag-Drop making element go black and crash

  • Electron version: 2.0.0
  • Operating system: Fedora Linux 28 - 4.16.5-300.fc28.x86_64
  • Hardware: Intel HD Graphics 4400
  • Last known working Electron version: 1.8.6 (but flashes black at the beginning of the drag) Message on debug 1.8.6: [6956:0503/113418.226485:ERROR:buffer_manager.cc(453)] [.DisplayCompositor-0x345f2e791700]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command

Expected behavior

Drag and drop without crash the Electron, and the element not turn to black.

Actual behavior

When drag an element it turn black, freeze Electron and the black element stay on screen even through other programs. No messages on debug, just freeze.

How to reproduce

Start any project with a button with attribute draggable=“true”. Start dragging it, done.

ckerr edit: duplicate bug https://github.com/electron/electron/issues/13384 has a repro repo

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 13
  • Comments: 36 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@codebytere @sofianguy Sorry to bug you, but is there any chance we could get a status update on this issue? I appreciate the labels and the “i’ll 👀 this soon”, but after five months even just something like “we have no idea, you’re on your own” would be a helpful communication. Thanks for your help!

@anchepiece Awesome. Thanks, I missed that. Just tested this workaround and it works. Also thanks to @bpasero.

Finally, my CPU gets a break from software rendering 💃

Turns out this is a Heisenbug, as I’ve accidentally found another workaround that makes no sense.

ELECTRON_ENABLE_STACK_DUMPING=true

I have no idea why this prevents the issue from happening, but it’s semi-maddening.

I’ve taken a short screencast to show the bug with electron --default, with and without the above workaround:

https://vimeo.com/283985893


Because I want to make sure this is actionable for everyone, you can apply this workaround indefinitely by adding the code to /etc/environment. You may (?) need to log out and log back in. Hell, you might even need to restart – I don’t really remember. For me, that looked something like this:

$ sudo sh -c "echo ELECTRON_ENABLE_STACK_DUMPING=true >> /etc/environment"
[sudo] password for christianbundy:
$ cat /etc/environment
ELECTRON_ENABLE_STACK_DUMPING=true
$

@christianbundy Thank you for finding a workaround! I added this code to run on only Linux in my project and drag-drop works! app.disableHardwareAcceleration()

@dev-zetta I encountered a similar issue and resolved it by redirecting (stdout) output as hinted above by @bpasero

Can you try launching using something like $ nohup yourapp Or if you want to capture the output $ nohup yourapp < /dev/null > nohup.out 2> nohup.err &

Electron 3.0.0-beta

Still not fixed. Flag --disable-gpu fixes the issue, albeit it does not fix the problem. There might be some projects out there that may need hardware acceleration.

yep, i’ll 👀 this soon!

Backtrace from when the program is in a frozen state after drag-and-drop:
#0  0x00007fffdda529f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fffffff1480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  0x00007fffdda529f3 in __pthread_cond_wait_common (abstime=0x0, mutex=0x7fffffff1430, cond=0x7fffffff1458)
    at pthread_cond_wait.c:502
#2  0x00007fffdda529f3 in __pthread_cond_wait (cond=0x7fffffff1458, mutex=0x7fffffff1430) at pthread_cond_wait.c:655
#3  0x00007ffff7d17320 in base::ConditionVariable::Wait() (this=0x7fffffff1458)
    at ./../../base/synchronization/condition_variable_posix.cc:71
#4  0x00007ffff7d18d59 in base::WaitableEvent::TimedWaitUntil(base::TimeTicks const&) (this=0x7fffffff1770, end_time=...)
    at ./../../base/synchronization/waitable_event_posix.cc:223
#5  0x00007ffff7d189ec in base::WaitableEvent::Wait() (this=0x7fffffff1770)
    at ./../../base/synchronization/waitable_event_posix.cc:154
#6  0x00007ffff03fa56b in gpu::GpuChannelHost::Send(IPC::Message*) (this=0x2721fa345820, msg=0x2721facbbf40)
    at ../../gpu/ipc/client/gpu_channel_host.cc:83
#7  0x00007ffff03ea720 in gpu::CommandBufferProxyImpl::Send(IPC::Message*) (this=0x2721fac09020, msg=0x2721facbbf40)
    at ../../gpu/ipc/client/command_buffer_proxy_impl.cc:681
#8  0x00007ffff03eac77 in gpu::CommandBufferProxyImpl::WaitForGetOffsetInRange(unsigned int, int, int) (this=0x2721fac09020, set_get_buffer_count=1, start=308, end=308) at ../../gpu/ipc/client/command_buffer_proxy_impl.cc:344
#9  0x00007ffff030e946 in gpu::CommandBufferHelper::WaitForGetOffsetInRange(int, int) (this=0x2721fa8e5340, start=308, end=308)
    at ../../gpu/command_buffer/client/cmd_buffer_helper.cc:166
#10 0x00007ffff030ec8d in gpu::CommandBufferHelper::Finish() (this=0x2721fa8e5340)
    at ../../gpu/command_buffer/client/cmd_buffer_helper.cc:226
#11 0x00007fffd7d01e73 in gpu::ImplementationBase::WaitForCmd() (this=0x2721fadb0128)
    at ../../gpu/command_buffer/client/implementation_base.cc:176
#12 0x00007fffd7ca3299 in gpu::gles2::GLES2Implementation::GetShaderiv(unsigned int, unsigned int, int*) (this=0x2721fadb0120, shader=1, pname=35713, params=0x7fffffff2c80) at ../../gpu/command_buffer/client/gles2_implementation_impl_autogen.h:1266
#13 0x00007fffe6f2c0fa in viz::ProgramBindingBase::LoadShader(gpu::gles2::GLES2Interface*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (this=0x2721fae021a0, context=0x2721fadb0120, type=35633, shader_source=...) at ../../components/viz/service/display/program_binding.cc:242
#14 0x00007fffe6f2bc5a in viz::ProgramBindingBase::Init(gpu::gles2::GLES2Interface*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (this=0x2721fae021a0, context=0x2721fadb0120, vertex_shader=..., fragment_shader=...)
---Type <return> to continue, or q <return> to quit---
    at ../../components/viz/service/display/program_binding.cc:182
#15 0x00007fffe6efd2c1 in viz::Program::InitializeInternal(viz::ContextProvider*) (this=0x2721fae021a0, context_provider=0x2721fad25860) at ../../components/viz/service/display/program_binding.h:434
#16 0x00007fffe6efa267 in viz::Program::Initialize(viz::ContextProvider*, viz::ProgramKey const&) (this=0x2721fae021a0, context_provider=0x2721fad25860, key=...) at ../../components/viz/service/display/program_binding.h:220
#17 0x00007fffe6edc57d in viz::GLRenderer::SetUseProgram(viz::ProgramKey const&, gfx::ColorSpace const&, gfx::ColorSpace const&) (this=0x2721fadfe020, program_key_no_color=..., src_color_space=..., dst_color_space=...)
    at ../../components/viz/service/display/gl_renderer.cc:2960
#18 0x00007fffe6ee6247 in viz::GLRenderer::DrawContentQuadNoAA(viz::ContentDrawQuadBase const*, unsigned int, gfx::QuadF const*) (this=0x2721fadfe020, quad=0x2721f9efe2c0, resource_id=2, clip_region=0x0) at ../../components/viz/service/display/gl_renderer.cc:1986
#19 0x00007fffe6ee4eff in viz::GLRenderer::DrawContentQuad(viz::ContentDrawQuadBase const*, unsigned int, gfx::QuadF const*) (this=0x2721fadfe020, quad=0x2721f9efe2c0, resource_id=2, clip_region=0x0) at ../../components/viz/service/display/gl_renderer.cc:1822
#20 0x00007fffe6eda5c3 in viz::GLRenderer::DrawTileQuad(viz::TileDrawQuad const*, gfx::QuadF const*) (this=0x2721fadfe020, quad=0x2721f9efe2c0, clip_region=0x0) at ../../components/viz/service/display/gl_renderer.cc:1789
#21 0x00007fffe6ed7214 in viz::GLRenderer::DoDrawQuad(viz::DrawQuad const*, gfx::QuadF const*) (this=0x2721fadfe020, quad=0x2721f9efe2c0, clip_region=0x0) at ../../components/viz/service/display/gl_renderer.cc:505
#22 0x00007fffe6e7a35b in viz::DirectRenderer::DrawRenderPass(viz::RenderPass const*) (this=0x2721fadfe020, render_pass=0x2721fad32860) at ../../components/viz/service/display/direct_renderer.cc:584
#23 0x00007fffe6e78d16 in viz::DirectRenderer::DrawRenderPassAndExecuteCopyRequests(viz::RenderPass*) (this=0x2721fadfe020, render_pass=0x2721fad32860) at ../../components/viz/service/display/direct_renderer.cc:469
#24 0x00007fffe6e78554 in viz::DirectRenderer::DrawFrame(std::__1::vector<std::__1::unique_ptr<viz::RenderPass, std::__1::default_delete<viz::RenderPass> >, std::__1::allocator<std::__1::unique_ptr<viz::RenderPass, std::__1::default_delete<viz::RenderPass> > > >*, float, gfx::Size const&) (this=0x2721fadfe020, render_passes_in_draw_order=0x7fffffff7040, device_scale_factor=1, device_viewport_size=...) at ../../components/viz/service/display/direct_renderer.cc:331
#25 0x00007fffe6e8ee3c in viz::Display::DrawAndSwap() (this=0x2721f9f6d220) at ../../components/viz/service/display/display.cc:359
#26 0x00007fffe6ec0b0f in viz::DisplayScheduler::DrawAndSwap() (this=0x2721fadc1020)
    at ../../components/viz/service/display/display_scheduler.cc:213
#27 0x00007fffe6ebf995 in viz::DisplayScheduler::AttemptDrawAndSwap() (this=0x2721fadc1020)
    at ../../components/viz/service/display/display_scheduler.cc:487
#28 0x00007fffe6ebf2a0 in viz::DisplayScheduler::OnBeginFrameDeadline() (this=0x2721fadc1020)
    at ../../components/viz/service/display/display_scheduler.cc:503
---Type <return> to continue, or q <return> to quit---
#29 0x00007fffe6ec548f in base::internal::FunctorTraits<void (viz::DisplayScheduler::*)(), void>::Invoke<void (viz::DisplayScheduler::*)(), base::WeakPtr<viz::DisplayScheduler> const&>(void (viz::DisplayScheduler::*)(), base::WeakPtr<viz::DisplayScheduler> const&) (method=(void (viz::DisplayScheduler::*)(viz::DisplayScheduler * const)) 0x7fffe6ebf0e0 <viz::DisplayScheduler::OnBeginFrameDeadline()>, receiver_ptr=...) at ../../base/bind_internal.h:507
#30 0x00007fffe6ec53da in base::internal::InvokeHelper<true, void>::MakeItSo<void (viz::DisplayScheduler::* const&)(), base::WeakPtr<viz::DisplayScheduler> const&>(void (viz::DisplayScheduler::* const&)(), base::WeakPtr<viz::DisplayScheduler> const&) (functor=@0x2721fadf59c0: (void (viz::DisplayScheduler::*)(viz::DisplayScheduler * const)) 0x7fffe6ebf0e0 <viz::DisplayScheduler::OnBeginFrameDeadline()>, weak_ptr=...) at ../../base/bind_internal.h:627
#31 0x00007fffe6ec5370 in base::internal::Invoker<base::internal::BindState<void (viz::DisplayScheduler::*)(), base::WeakPtr<viz::DisplayScheduler> >, void ()>::RunImpl<void (viz::DisplayScheduler::* const&)(), std::__1::tuple<base::WeakPtr<viz::DisplayScheduler> > const&, 0ul>(void (viz::DisplayScheduler::* const&)(), std::__1::tuple<base::WeakPtr<viz::DisplayScheduler> > const&, std::__1::integer_sequence<unsigned long, 0ul>) (functor=@0x2721fadf59c0: (void (viz::DisplayScheduler::*)(viz::DisplayScheduler * const)) 0x7fffe6ebf0e0 <viz::DisplayScheduler::OnBeginFrameDeadline()>, bound=...) at ../../base/bind_internal.h:680
#32 0x00007fffe6ec528c in base::internal::Invoker<base::internal::BindState<void (viz::DisplayScheduler::*)(), base::WeakPtr<viz::DisplayScheduler> >, void ()>::Run(base::internal::BindStateBase*) (base=0x2721fadf59a0) at ../../base/bind_internal.h:662
#33 0x00007fffe6ec7cbd in base::RepeatingCallback<void ()>::Run() const & (this=0x2721fadc1110) at ../../base/callback.h:129
#34 0x00007fffe6ec7c75 in base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::ForwardRepeating<>() (this=0x2721fadc1110) at ../../base/cancelable_callback.h:120
#35 0x00007fffe6ec548f in base::internal::FunctorTraits<void (viz::DisplayScheduler::*)(), void>::Invoke<void (viz::DisplayScheduler::*)(), base::WeakPtr<viz::DisplayScheduler> const&>(void (viz::DisplayScheduler::*)(), base::WeakPtr<viz::DisplayScheduler> const&) (method=(void (viz::DisplayScheduler::*)(viz::DisplayScheduler * const)) 0x7fffe6ec7c60 <base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::ForwardRepeating<>()>, receiver_ptr=...) at ../../base/bind_internal.h:507
#36 0x00007fffe6ec53da in base::internal::InvokeHelper<true, void>::MakeItSo<void (viz::DisplayScheduler::* const&)(), base::WeakPtr<viz::DisplayScheduler> const&>(void (viz::DisplayScheduler::* const&)(), base::WeakPtr<viz::DisplayScheduler> const&) (functor=@0x2721fac13440: (void (viz::DisplayScheduler::*)(viz::DisplayScheduler * const)) 0x7fffe6ec7c60 <base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::ForwardRepeating<>()>, weak_ptr=...) at ../../base/bind_internal.h:627
#37 0x00007fffe6ec5370 in base::internal::Invoker<base::internal::BindState<void (viz::DisplayScheduler::*)(), base::WeakPtr<viz::DisplayScheduler> >, void ()>::RunImpl<void (viz::DisplayScheduler::* const&)(), std::__1::tuple<base::WeakPtr<viz::DisplayScheduler> > const&, 0ul>(void (viz::DisplayScheduler::* const&)(), std::__1::tuple<base::WeakPtr<viz::DisplayScheduler> > const&, std::__1::integer_sequence<unsigned long, 0ul>) (functor=@0x2721fac13440: (void (viz::DisplayScheduler::*)(viz::DisplayScheduler * const)) 0x7fffe6ec7c60 <base::internal::CancelableCallbackImpl<base::RepeatingCallback<void ()> >::ForwardRepeating<>()>, bound=...)
---Type <return> to continue, or q <return> to quit---
    at ../../base/bind_internal.h:680
#38 0x00007fffe6ec528c in base::internal::Invoker<base::internal::BindState<void (viz::DisplayScheduler::*)(), base::WeakPtr<viz::DisplayScheduler> >, void ()>::Run(base::internal::BindStateBase*) (base=0x2721fac13420) at ../../base/bind_internal.h:662
#39 0x00007ffff7a20bde in base::OnceCallback<void ()>::Run() && (this=0x7fffffff7de8) at ../../base/callback.h:99
#40 0x00007ffff79d4102 in base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) (this=0x2721f9b1bd18, queue_function=0x7ffff7931a7d "MessageLoop::PostTask", pending_task=0x7fffffff7de8) at ./../../base/debug/task_annotator.cc:101

#41 0x00007ffff7a9403c in base::MessageLoop::RunTask(base::PendingTask*) (this=0x2721f9ae4020, pending_task=0x7fffffff7de8)
    at ./../../base/message_loop/message_loop.cc:421
#42 0x00007ffff7a942b8 in base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) (this=0x2721f9ae4020, pending_task=...)
    at ./../../base/message_loop/message_loop.cc:432
#43 0x00007ffff7a94689 in base::MessageLoop::DoWork() (this=0x2721f9ae4020) at ./../../base/message_loop/message_loop.cc:480
#44 0x00007ffff7a970a6 in base::MessagePumpGlib::Run(base::MessagePump::Delegate*) (this=0x2721f9b1d1e0, delegate=0x2721f9ae4020)
    at ./../../base/message_loop/message_pump_glib.cc:309
#45 0x00007ffff7a9382b in base::MessageLoop::Run(bool) (this=0x2721f9ae4020, application_tasks_allowed=true)
    at ./../../base/message_loop/message_loop.cc:373
#46 0x00007ffff7b37b9d in base::RunLoop::Run() (this=0x7fffffff86e8) at ./../../base/run_loop.cc:102
#47 0x00007fffe9f153f7 in views::X11WholeScreenMoveLoop::RunMoveLoop(aura::Window*, ui::Cursor) (this=0x2721f9b2f520, source=
    0x2721fa60c620, cursor=...) at ./../../ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc:186
#48 0x00007fffe9efc530 in views::DesktopDragDropClientAuraX11::StartDragAndDrop(ui::OSExchangeData const&, aura::Window*, aura::Window*, gfx::Point const&, int, ui::DragDropTypes::DragEventSource) (this=0x2721fa4807a0, data=..., root_window=0x2721fa8a11a0, source_window=0x2721fa60c620, screen_location=..., operation=7, source=ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE)
    at ./../../ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc:804
#49 0x00007ffff51f88ff in content::WebContentsViewAura::StartDragging(content::DropData const&, blink::WebDragOperation, gfx::ImageSkia const&, gfx::Vector2d const&, content::DragEventSourceInfo const&, content::RenderWidgetHostImpl*) (this=0x2721fa9bcec0, drop_data=..., operations=blink::kWebDragOperationEvery, image=..., image_offset=..., event_info=..., source_rwh=0x2721f9fe7020)
    at ./../../content/browser/web_contents/web_contents_view_aura.cc:940
#50 0x00007ffff51f939c in non-virtual thunk to content::WebContentsViewAura::StartDragging(content::DropData const&, blink::WebDragOperation, gfx::ImageSkia const&, gfx::Vector2d const&, content::DragEventSourceInfo const&, content::RenderWidgetHostImpl*) ()
    at ../../base/bind_internal.h:507
#51 0x00007ffff4f38f7c in content::RenderWidgetHostImpl::OnStartDragging(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&) (this=0x2721f9fe7020, drop_data=..., drag_operations_mask=blink:---Type <return> to continue, or q <return> to quit---
:kWebDragOperationEvery, bitmap=..., bitmap_offset_in_dip=..., event_info=...)
    at ./../../content/browser/renderer_host/render_widget_host_impl.cc:1861
#52 0x00007ffff504ed23 in base::DispatchToMethodImpl<content::RenderWidgetHostImpl*, void (content::RenderWidgetHostImpl::*)(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&), std::__1::tuple<content::DropData, blink::WebDragOperation, SkBitmap, gfx::Vector2d, content::DragEventSourceInfo>, 0ul, 1ul, 2ul, 3ul, 4ul>(content::RenderWidgetHostImpl* const&, void (content::RenderWidgetHostImpl::*)(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&), std::__1::tuple<content::DropData, blink::WebDragOperation, SkBitmap, gfx::Vector2d, content::DragEventSourceInfo>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul>) (obj=@0x7fffffffa410: 0x2721f9fe7020, method=
    (void (content::RenderWidgetHostImpl::*)(content::RenderWidgetHostImpl * const, const content::DropData &, blink::WebDragOperation, const SkBitmap &, const gfx::Vector2d &, const content::DragEventSourceInfo &)) 0x7ffff4f38040 <content::RenderWidgetHostImpl::OnStartDragging(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&)>, args=...) at ../../base/tuple.h:52
#53 0x00007ffff504eba8 in base::DispatchToMethod<content::RenderWidgetHostImpl*, void (content::RenderWidgetHostImpl::*)(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&), std::__1::tuple<content::DropData, blink::WebDragOperation, SkBitmap, gfx::Vector2d, content::DragEventSourceInfo> >(content::RenderWidgetHostImpl* const&, void (content::RenderWidgetHostImpl::*)(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&), std::__1::tuple<content::DropData, blink::WebDragOperation, SkBitmap, gfx::Vector2d, content::DragEventSourceInfo>&&) (obj=@0x7fffffffa410: 0x2721f9fe7020, method=
    (void (content::RenderWidgetHostImpl::*)(content::RenderWidgetHostImpl * const, const content::DropData &, blink::WebDragOperation, const SkBitmap &, const gfx::Vector2d &, const content::DragEventSourceInfo &)) 0x7ffff4f38040 <content::RenderWidgetHostImpl::OnStartDragging(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&)>, args=...) at ../../base/tuple.h:60
#54 0x00007ffff504eb34 in IPC::DispatchToMethod<content::RenderWidgetHostImpl, void (content::RenderWidgetHostImpl::*)(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&), void, std::__1::tuple<content::DropData, blink::WebDragOperation, SkBitmap, gfx::Vector2d, content::DragEventSourceInfo> >(content::RenderWidgetHostImpl*, void (content::RenderWidgetHostImpl::*)(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&), void*, std::__1::tuple<content::DropData, blink::WebDragOperation, SkBitmap, gfx::Vector2d, content::DragEventSourceInfo>&&) (obj=0x2721f9fe7020, method=
    (void (content::RenderWidgetHostImpl::*)(content::RenderWidgetHostImpl * const, const content::DropData &, blink::WebDragOperation, const SkBitmap &, const gfx::Vector2d &, const content::DragEventSourceInfo &)) 0x7ffff4f38040 <content::RenderWidgetHostImpl::O---Type <return> to continue, or q <return> to quit---
nStartDragging(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&)>, tuple=...) at ../../ipc/ipc_message_templates.h:51
#55 0x00007ffff4ffb270 in 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::*)(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&)>(IPC::Message const*, content::RenderWidgetHostImpl*, content::RenderWidgetHostImpl*, void*, void (content::RenderWidgetHostImpl::*)(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&)) (msg=0x2721fac02f38, obj=0x2721f9fe7020, sender=0x2721f9fe7020, parameter=0x0, func=
    (void (content::RenderWidgetHostImpl::*)(content::RenderWidgetHostImpl * const, const content::DropData &, blink::WebDragOperation, const SkBitmap &, const gfx::Vector2d &, const content::DragEventSourceInfo &)) 0x7ffff4f38040 <content::RenderWidgetHostImpl::OnStartDragging(content::DropData const&, blink::WebDragOperation, SkBitmap const&, gfx::Vector2d const&, content::DragEventSourceInfo const&)>) at ../../ipc/ipc_message_templates.h:146
#56 0x00007ffff4f36b8f in content::RenderWidgetHostImpl::OnMessageReceived(IPC::Message const&) (this=0x2721f9fe7020, msg=...)
    at ./../../content/browser/renderer_host/render_widget_host_impl.cc:680
#57 0x00007ffff4f189c3 in content::RenderProcessHostImpl::OnMessageReceived(IPC::Message const&) (this=0x2721fa975f20, msg=...)
    at ./../../content/browser/renderer_host/render_process_host_impl.cc:3170
#58 0x00007fffef7ac1f5 in IPC::ChannelProxy::Context::OnDispatchMessage(IPC::Message const&) (this=0x2721fa9a8c60, message=...)
    at ../../ipc/ipc_channel_proxy.cc:320
#59 0x00007fffef7b234f in base::internal::FunctorTraits<void (IPC::ChannelProxy::Context::*)(IPC::Message const&), void>::Invoke<void (IPC::ChannelProxy::Context::*)(IPC::Message const&), scoped_refptr<IPC::ChannelProxy::Context> const&, IPC::Message const&>(void (IPC::ChannelProxy::Context::*)(IPC::Message const&), scoped_refptr<IPC::ChannelProxy::Context> const&, IPC::Message const&) (method=
    (void (IPC::ChannelProxy::Context::*)(IPC::ChannelProxy::Context * const, const IPC::Message &)) 0x7fffef7ac160 <IPC::ChannelProxy::Context::OnDispatchMessage(IPC::Message const&)>, receiver_ptr=..., args=...) at ../../base/bind_internal.h:507
#60 0x00007fffef7b22af in base::internal::InvokeHelper<false, void>::MakeItSo<void (IPC::ChannelProxy::Context::* const&)(IPC::Message const&), scoped_refptr<IPC::ChannelProxy::Context> const&, IPC::Message const&>(void (IPC::ChannelProxy::Context::* const&)(IPC::Message const&), scoped_refptr<IPC::ChannelProxy::Context> const&, IPC::Message const&) (functor=
    @0x2721fac02f20: (void (IPC::ChannelProxy::Context::*)(IPC::ChannelProxy::Context * const, const IPC::Message &)) 0x7fffef7ac160 <IPC::ChannelProxy::Context::OnDispatchMessage(IPC::Message const&)>, args=..., args=...) at ../../base/bind_internal.h:607
#61 0x00007fffef7b223d in base::internal::Invoker<base::internal::BindState<void (IPC::ChannelProxy::Context::*)(IPC::Message const&), scoped_refptr<IPC::ChannelProxy::Context>, IPC::Message>, void ()>::RunImpl<void (IPC::ChannelProxy::Context::* const&)(IPC::Mess---Type <return> to continue, or q <return> to quit---
age const&), std::__1::tuple<scoped_refptr<IPC::ChannelProxy::Context>, IPC::Message> const&, 0ul, 1ul>(void (IPC::ChannelProxy::Context::* const&)(IPC::Message const&), std::__1::tuple<scoped_refptr<IPC::ChannelProxy::Context>, IPC::Message> const&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) (functor=
    @0x2721fac02f20: (void (IPC::ChannelProxy::Context::*)(IPC::ChannelProxy::Context * const, const IPC::Message &)) 0x7fffef7ac160 <IPC::ChannelProxy::Context::OnDispatchMessage(IPC::Message const&)>, bound=...) at ../../base/bind_internal.h:680
#62 0x00007fffef7b214c in base::internal::Invoker<base::internal::BindState<void (IPC::ChannelProxy::Context::*)(IPC::Message const&), scoped_refptr<IPC::ChannelProxy::Context>, IPC::Message>, void ()>::Run(base::internal::BindStateBase*) (base=0x2721fac02f00)
    at ../../base/bind_internal.h:662
#63 0x00007ffff7a20bde in base::OnceCallback<void ()>::Run() && (this=0x7fffffffb338) at ../../base/callback.h:99
#64 0x00007ffff79d4102 in base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) (this=0x2721f9b1bd18, queue_function=0x7ffff7931a7d "MessageLoop::PostTask", pending_task=0x7fffffffb338) at ./../../base/debug/task_annotator.cc:101
#65 0x00007ffff7a9403c in base::MessageLoop::RunTask(base::PendingTask*) (this=0x2721f9ae4020, pending_task=0x7fffffffb338)
    at ./../../base/message_loop/message_loop.cc:421
#66 0x00007ffff7a942b8 in base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) (this=0x2721f9ae4020, pending_task=...)
    at ./../../base/message_loop/message_loop.cc:432
#67 0x00007ffff7a94689 in base::MessageLoop::DoWork() (this=0x2721f9ae4020) at ./../../base/message_loop/message_loop.cc:480
#68 0x00007ffff7a970a6 in base::MessagePumpGlib::Run(base::MessagePump::Delegate*) (this=0x2721f9b1d1e0, delegate=0x2721f9ae4020)
    at ./../../base/message_loop/message_pump_glib.cc:309
#69 0x00007ffff7a9382b in base::MessageLoop::Run(bool) (this=0x2721f9ae4020, application_tasks_allowed=true)
    at ./../../base/message_loop/message_loop.cc:373
#70 0x00007ffff7b37b9d in base::RunLoop::Run() (this=0x7fffffffbbf0) at ./../../base/run_loop.cc:102
#71 0x00007ffff44294ec in content::BrowserMainLoop::MainMessageLoopRun() (this=0x2721f99eab60)
    at ./../../content/browser/browser_main_loop.cc:1575
#72 0x00007ffff4429142 in content::BrowserMainLoop::RunMainMessageLoopParts() (this=0x2721f99eab60)
    at ./../../content/browser/browser_main_loop.cc:1037
#73 0x00007ffff442f0a0 in content::BrowserMainRunnerImpl::Run() (this=0x2721f9b1ea40)
    at ./../../content/browser/browser_main_runner_impl.cc:162
#74 0x00007ffff441bc50 in content::BrowserMain(content::MainFunctionParams const&) (parameters=...)
    at ./../../content/browser/browser_main.cc:47
#75 0x00007ffff63872c4 in content::RunBrowserProcessMain(content::MainFunctionParams const&, content::ContentMainDelegate*) (main_function_params=..., delegate=0x7fffffffd6c8) at ../../content/app/content_main_runner_impl.cc:596
---Type <return> to continue, or q <return> to quit---
#76 0x00007ffff6389c07 in content::ContentMainRunnerImpl::Run(bool) (this=0x2721f9ada700, start_service_manager_only=false)
    at ../../content/app/content_main_runner_impl.cc:947
#77 0x00007ffff637e23c in content::ContentServiceManagerMainDelegate::RunEmbedderProcess() (this=0x7fffffffd638)
    at ../../content/app/content_service_manager_main_delegate.cc:53
#78 0x00007fffeb4b938a in service_manager::Main(service_manager::MainParams const&) (params=...)
    at ../../services/service_manager/embedder/main.cc:472
#79 0x00007ffff6384493 in content::ContentMain(content::ContentMainParams const&) (params=...)
    at ../../content/app/content_main.cc:19
#80 0x0000555555e381ef in main(int, char**) (argc=2, argv=0x7fffffffd858) at ../../electron/atom/app/atom_main.cc:171
(gdb) k

@christianbundy if I had to guess then this has something to do with how stdout is handled in the one case vs. the other case. I can reproduce the issue of seeing this message popping up from a simple fiddle with a draggable element:

[31176:0919/100345.056256:ERROR:buffer_manager.cc(453)] [.DisplayCompositor-0x145e13148800]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command

Possibly, there is a crash while doing the DND operation when trying to write this message to stdout and this causes the freeze.

Output for $ sudo lspci -v | sed -n '/VGA/,/^$/p'

65:00.0 VGA compatible controller: NVIDIA Corporation GP107GL [Quadro P600] (rev a1) (prog-if 00 [VGA controller])
	Subsystem: NVIDIA Corporation GP107GL [Quadro P600]
	Flags: bus master, fast devsel, latency 0, IRQ 66, NUMA node 0
	Memory at df000000 (32-bit, non-prefetchable) [size=16M]
	Memory at c0000000 (64-bit, prefetchable) [size=256M]
	Memory at d0000000 (64-bit, prefetchable) [size=32M]
	I/O ports at b000 [size=128]
	Expansion ROM at e0000000 [disabled] [size=512K]
	Capabilities: [60] Power Management version 3
	Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [78] Express Legacy Endpoint, MSI 00
	Capabilities: [100] Virtual Channel
	Capabilities: [250] Latency Tolerance Reporting
	Capabilities: [128] Power Budgeting <?>
	Capabilities: [420] Advanced Error Reporting
	Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
	Capabilities: [900] #19
	Kernel driver in use: nouveau
	Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia

PS: what is interesting is that I can reproduce the error message while dragging even with 1.7.x already, so it seems it has always been there. I am quite sure, fixing that error message to output would fix the freeze.

Hi. I’m having similar issues on apps using eletron (crashe on drag’n’drop). In my case, it’s with VSCode and Slack desktop client.

I’m using archlinux with xorg & i3. Same issues happen when running sway instead of xorg. GPU is Inter Graphics (cpu integrated). @christianbundy’s workaround doesn’t work for me.

If I start my slack or vscode with the --disable-gpu it doesn’t crash anymore. BUT it doesn’t always fix drag’n’drop either. Some app sessions will work perfectly. But for some others, d’n’d will not make the app crash but will have no effect.

Also, without the --disable-gpu, VSCode crashes sometimes when I unlock my screen (i3-lock).

I guess it’s a problem only occuring for some people with specific GPUs.

@christianbundy Yes works fine with --disable-gpu.

Workaround: --disable-gpu

I found this suggestion here: https://github.com/electron/electron/issues/4380#issuecomment-18844866

@leotada Can you verify that electron --disable-gpu works for you as well?

Additional notes

  • --disable-gpu-blacklist doesn’t fix the issue
  • It isn’t this bug (I’m using freetype2 2.9.1.1)
  • Seems related to transparency, https://github.com/electron/electron/pull/12561 may be relevant
  • My Electron GPU process flags:
    • --type=gpu-process
    • --no-sandbox
    • --supports-dual-gpus=false
    • --gpu-driver-bug-workarounds=1,9,27,70,84
    • --disable-gl-extensions=GL_KHR_blend_equation_advanced
    • GL_KHR_blend_equation_advanced_coherent
    • --disable-accelerated-video-decode
    • --gpu-vendor-id=0x8086
    • --gpu-device-id=0x1616
    • --gpu-driver-vendor
    • --gpu-driver-version
    • --gpu-driver-date
    • --service-request-channel-token=0EB803B34379058862EC3D63D17A989E
  • My Electron renderer process flags:
    • --type=renderer
    • --no-sandbox
    • --service-pipe-token=7A0DA93E3DA90C3F2E2E91228251969D
    • --lang=en-US
    • --app-path=/home/christianbundy/src/electron-test/node_modules/electron/dist/resources/default_app.asar
    • --node-integration=true
    • --node-integration-in-worker
    • --webview-tag=true
    • --no-sandbox
    • --background-color=#FFFFFF
    • --context-id=2
    • --enable-pinch
    • --num-raster-threads=2
    • --enable-main-frame-before-activation
    • --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,3553;0,16,3553;0,17,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;1,16,3553;1,17,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;2,16,3553;2,17,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553;3,16,3553;3,17,3553;4,0,3553;4,1,3553;4,2,3553;4,3,3553;4,4,3553;4,5,3553;4,6,3553;4,7,3553;4,8,3553;4,9,3553;4,10,3553;4,11,3553;4,12,3553;4,13,3553;4,14,3553;4,15,3553;4,16,3553;4,17,3553
    • --disable-accelerated-video-decode
    • --enable-gpu-async-worker-context
    • --service-request-channel-token=7A0DA93E3DA90C3F2E2E91228251969D
    • --renderer-client-id=4
    • --shared-files=v8_nat

Not completely sure how to further debug, but at least we can pin it down to the GPU.

Reproduction steps:

  1. Open any Electron application.
  2. Copy any text within the app.
  3. Click and drag.

Expected (and working in v1.8.4):

  • Selected text is copied below your mouse with ~50% transparency.
  • Text follows your mouse until you release your click.
  • Text disappears.
  • If you’re hovering over an input, the text goes into the input.

Actual (v2.0.0):

  • Black rectangle with the area of the selected text is copied under your cursor.
  • Black rectangle follows your mouse until you release your click.
  • Electron freezes and won’t die.
  • Black rectangle is always visible and overlaps any other applications you try to drag over it.
  • Black rectangle remains until you kill Electron.

screenshot from 2018-05-06 14-53-46

“I’m setting the more-information-needed label for the above reasons. After you’ve responded, please @ me in a followup comment.” – @codebytere

Nope, I think this is fixed in Electron 11.