Skip to content

[Bug]: Crash in WebContents::DevToolsOpened -> WebContents::SetOwnerWindow #34042

Closed

Description

@t57ser

Preflight Checklist

Electron Version

17.4.1

What operating system are you using?

Windows

Operating System Version

Windows 10 19042.985

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

No crash

Actual Behavior

Electron crashed when trying to open the devtools

2022-05-03 13_06_33-Break Mode (Debugging) - Microsoft Visual Studio

Testcase Gist URL

No response

Additional Information

No response

Activity

  1. codebytere commented on May 4, 2022

    @codebytere
    Member

    Thanks for reporting this and helping to make Electron better!

    Because of time constraints, triaging code with third-party dependencies is usually not feasible for a small team like Electron's.

    Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

    Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

    I'm adding the blocked/need-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

  2. added
    blocked/need-repro
    on May 4, 2022
  3. t57ser commented on May 5, 2022

    @t57ser
    ContributorAuthor

    @codebytere Not sure what you mean with third-party dependencies.
    This happened when trying to open the devtools of a BrowserWindow.
    Since this is the first time this crash happened and I haven't seen further such cases I highly doubt it will be possible to create a small test case.
    I thought that the crash dump might give enough insight for a possible fix since that helped in past bug reports but if it does not feel free to close the issue as I will not be able to provide anything further.

  4. boutetnico commented on Sep 21, 2022

    @boutetnico

    Had a similar crash on Electron 20.1.4. Can't reproduce it.

    OS Version: Debian 11.4
     (-17-amd64 #1 SMP Debian 5.10.136-1 (2022-08-13) x86_64)
    Report Version: 104
    
    Crashed Thread: 6024
    
    Application Specific Information:
    Fatal Error: SIGSEGV / SEGV_MAPERR / 0x110
    
    Thread 6024 Crashed:
    0   MyApp               0x55bb2d44caed      electron::api::WebContents::SetOwnerWindow (swap.h:35)
    1   MyApp               0x55bb2d44c92c      electron::api::WebContents::DevToolsOpened (electron_api_web_contents.cc:2006)
    2   MyApp               0x55bb2d4d176c      electron::InspectableWebContents::LoadCompleted (inspectable_web_contents.cc:592)
    3   MyApp               0x55bb3399a078      (anonymous namespace)::ParseAndHandle<T> (callback.h:242)
    4   MyApp               0x55bb3399a0b8      base::internal::Invoker<T>::Run (bind_internal.h:436)
    5   MyApp               0x55bb3399a03b      DispatcherImpl::Dispatch (callback.h:242)
    6   MyApp               0x55bb2d4d3d8f      electron::InspectableWebContents::HandleMessageFromDevToolsFrontend (inspectable_web_contents.cc:932)
    7   MyApp               0x55bb2d4d559c      base::internal::Invoker<T>::Run (bind_internal.h:541)
    8   MyApp               0x55bb2fa453d3      content::DevToolsFrontendHostImpl::DispatchEmbedderMessage (callback.h:242)
    9   MyApp               0x55bb2e2a1f74      blink::mojom::DevToolsFrontendHostStubDispatch::Accept (devtools_frontend.mojom.cc:424)
    10  MyApp               0x55bb305ac451      mojo::InterfaceEndpointClient::HandleValidatedMessage (interface_endpoint_client.cc:952)
    11  MyApp               0x55bb305b179b      mojo::MessageDispatcher::Accept (message_dispatcher.cc:43)
    12  MyApp               0x55bb305adf19      mojo::InterfaceEndpointClient::HandleIncomingMessage (interface_endpoint_client.cc:686)
    13  MyApp               0x55bb3088dd46      base::internal::Invoker<T>::RunOnce (ipc_mojo_bootstrap.cc:1010)
    14  MyApp               0x55bb30297545      base::TaskAnnotator::RunTaskImpl (callback.h:143)
    15  MyApp               0x55bb302b4ab4      base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork (task_annotator.h:74)
    16  MyApp               0x55bb3025dfc5      base::MessagePumpGlib::Run (message_pump_glib.cc:405)
    17  MyApp               0x55bb302b5410      base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run (thread_controller_with_message_pump_impl.cc:534)
    18  MyApp               0x55bb3027cee1      base::RunLoop::Run (run_loop.cc:141)
    19  MyApp               0x55bb2f4a549e      content::BrowserMainLoop::RunMainMessageLoop (browser_main_loop.cc:1039)
    20  MyApp               0x55bb2f4a7001      content::BrowserMainRunnerImpl::Run (browser_main_runner_impl.cc:157)
    21  MyApp               0x55bb2f4a2c1d      content::BrowserMain (browser_main.cc:30)
    22  MyApp               0x55bb2d66aba0      content::RunBrowserProcessMain (content_main_runner_impl.cc:675)
    23  MyApp               0x55bb2d66c0bc      content::ContentMainRunnerImpl::RunBrowser (content_main_runner_impl.cc:1185)
    24  MyApp               0x55bb2d66bbae      content::ContentMainRunnerImpl::Run (content_main_runner_impl.cc:1056)
    25  MyApp               0x55bb2d6690cc      content::RunContentProcess (content_main.cc:411)
    26  MyApp               0x55bb2d6698b3      content::ContentMain (content_main.cc:439)
    27  MyApp               0x55bb2d3d091a      main (electron_main_linux.cc:44)
    28  libc.so.6                       0x7fd4c4d27d0a      <unknown>
    29  MyApp               0x55bb2d3d07cf      uv__random_sysctl
    30  libc.so.6                       0x7fd4c4d3f902      <unknown>
    31  MyApp               0x55bb2d04a029      _start
    32  <unknown>                       0x7ffe243556e8      <unknown>
    
    Thread 6026
    0   libc.so.6                       0x7fd4c4df43ff      <unknown>
    1   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    2   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    3   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6029
    0   libc.so.6                       0x7fd4c4dff116      <unknown>
    1   MyApp               0x55bb3040699a      event_base_loop (event.c:512)
    2   MyApp               0x55bb30300601      base::MessagePumpLibevent::Run (message_pump_libevent.cc:246)
    3   MyApp               0x55bb302b5410      base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run (thread_controller_with_message_pump_impl.cc:534)
    4   MyApp               0x55bb3027cee1      base::RunLoop::Run (run_loop.cc:141)
    5   MyApp               0x55bb302cf747      base::Thread::Run (thread.cc:334)
    6   MyApp               0x55bb302bc36c      base::internal::ServiceThread::Run (service_thread.cc:15)
    7   MyApp               0x55bb302cf8d6      base::Thread::ThreadMain (thread.cc:405)
    8   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    9   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    10  libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6032
    0   libc.so.6                       0x7fd4c4dff116      <unknown>
    1   MyApp               0x55bb3040699a      event_base_loop (event.c:512)
    2   MyApp               0x55bb30300601      base::MessagePumpLibevent::Run (message_pump_libevent.cc:246)
    3   MyApp               0x55bb302b5410      base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run (thread_controller_with_message_pump_impl.cc:534)
    4   MyApp               0x55bb3027cee1      base::RunLoop::Run (run_loop.cc:141)
    5   MyApp               0x55bb302cf747      base::Thread::Run (thread.cc:334)
    6   MyApp               0x55bb2f4a7f0e      content::BrowserProcessIOThread::IOThreadRun (browser_process_io_thread.cc:124)
    7   MyApp               0x55bb302cf8d6      base::Thread::ThreadMain (thread.cc:405)
    8   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    9   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    10  libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6033
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb302eeff2      base::ConditionVariable::Wait (condition_variable_posix.cc:79)
    
    Thread 6034
    0   libc.so.6                       0x7fd4c4dff116      <unknown>
    1   MyApp               0x55bb2d3bf891      uv_run (core.c:389)
    2   MyApp               0x55bb33cfb990      node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Run (node_platform.cc:88)
    3   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    4   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6035
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb2d3cb3c8      uv_cond_wait (thread.c:780)
    3   MyApp               0x55bb33cfbb41      node::TaskQueue<T>::BlockingPop (node_mutex.h:175)
    4   MyApp               0x55bb33cf9741      node::(anonymous namespace)::PlatformWorkerThread (node_platform.cc:42)
    5   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    6   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6036
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb2d3cb3c8      uv_cond_wait (thread.c:780)
    3   MyApp               0x55bb33cfbb41      node::TaskQueue<T>::BlockingPop (node_mutex.h:175)
    4   MyApp               0x55bb33cf9741      node::(anonymous namespace)::PlatformWorkerThread (node_platform.cc:42)
    5   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    6   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6037
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb2d3cb3c8      uv_cond_wait (thread.c:780)
    3   MyApp               0x55bb33cfbb41      node::TaskQueue<T>::BlockingPop (node_mutex.h:175)
    4   MyApp               0x55bb33cf9741      node::(anonymous namespace)::PlatformWorkerThread (node_platform.cc:42)
    5   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    6   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6038
    0   libpthread.so.0                 0x7fd4c6587174      <unknown>
    1   libpthread.so.0                 0x7fd4c6587278      <unknown>
    2   libpthread.so.0                 0x7fd4c6587130      <unknown>
    3   MyApp               0x55bb2d3cb20f      uv_sem_wait (thread.c:626)
    4   MyApp               0x55bb33d7640c      node::inspector::(anonymous namespace)::StartIoThreadMain (inspector_agent.cc:82)
    5   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    6   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6046
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb2d3cb3c8      uv_cond_wait (thread.c:780)
    3   MyApp               0x55bb2d3bc007      worker (threadpool.c:76)
    4   MyApp               0x55bb2d3bbf8f      reset_once (threadpool.c:244)
    
    Thread 6047
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb2d3cb3c8      uv_cond_wait (thread.c:780)
    3   MyApp               0x55bb2d3bc007      worker (threadpool.c:76)
    4   MyApp               0x55bb2d3bbf8f      reset_once (threadpool.c:244)
    
    Thread 6048
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb2d3cb3c8      uv_cond_wait (thread.c:780)
    3   MyApp               0x55bb2d3bc007      worker (threadpool.c:76)
    4   MyApp               0x55bb2d3bbf8f      reset_once (threadpool.c:244)
    
    Thread 6049
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb2d3cb3c8      uv_cond_wait (thread.c:780)
    3   MyApp               0x55bb2d3bc007      worker (threadpool.c:76)
    4   MyApp               0x55bb2d3bbf8f      reset_once (threadpool.c:244)
    
    Thread 6052
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb302eeff2      base::ConditionVariable::Wait (condition_variable_posix.cc:79)
    
    Thread 6053
    0   libc.so.6                       0x7fd4c4dff116      <unknown>
    1   MyApp               0x55bb3040699a      event_base_loop (event.c:512)
    2   MyApp               0x55bb30300563      base::MessagePumpLibevent::Run (message_pump_libevent.cc:246)
    3   MyApp               0x55bb302b5410      base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run (thread_controller_with_message_pump_impl.cc:534)
    4   MyApp               0x55bb3027cee1      base::RunLoop::Run (run_loop.cc:141)
    5   MyApp               0x55bb302cf747      base::Thread::Run (thread.cc:334)
    6   MyApp               0x55bb302cf8d6      base::Thread::ThreadMain (thread.cc:405)
    7   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    8   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    9   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6054
    0   libpthread.so.0                 0x7fd4c658808c      <unknown>
    1   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    2   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    3   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6058
    0   libc.so.6                       0x7fd4c4df43ff      <unknown>
    1   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    2   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    3   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6060
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb302eeff2      base::ConditionVariable::Wait (condition_variable_posix.cc:79)
    3   MyApp               0x55bb31375319      cc::SingleThreadTaskGraphRunner::Run (single_thread_task_graph_runner.cc:129)
    4   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    5   MyApp               0x55bb302f2f4f      base::PlatformThread::GetDefaultThreadStackSize
    6   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    7   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6061
    0   libpthread.so.0                 0x7fd4c6584ad8      <unknown>
    1   MyApp               0x55bb302c1896      base::internal::TaskTracker::RunTask (task_tracker.cc:556)
    
    Thread 6062
    0   libpthread.so.0                 0x7fd4c65847b2      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   MyApp               0x55bb302eeff2      base::ConditionVariable::Wait (condition_variable_posix.cc:79)
    
    Thread 6063
    0   libpthread.so.0                 0x7fd4c6587174      <unknown>
    1   libpthread.so.0                 0x7fd4c6587278      <unknown>
    2   libpthread.so.0                 0x7fd4c6587130      <unknown>
    3   MyApp               0x55bb2d50ab66      electron::NodeBindings::WakeupMainThread (node_bindings.cc:666)
    4   MyApp               0x55bb2d3cb20f      uv_sem_wait (thread.c:626)
    5   MyApp               0x55bb2d50a8e8      electron::NodeBindings::EmbedThreadRunner (node_bindings.cc:680)
    6   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    7   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6070
    0   libpthread.so.0                 0x7fd4c6584ad8      <unknown>
    1   MyApp               0x55bb302c1896      base::internal::TaskTracker::RunTask (task_tracker.cc:556)
    
    Thread 6083
    0   libc.so.6                       0x7fd4c4dff116      <unknown>
    1   MyApp               0x55bb3040699a      event_base_loop (event.c:512)
    2   MyApp               0x55bb30300601      base::MessagePumpLibevent::Run (message_pump_libevent.cc:246)
    3   MyApp               0x55bb302b5410      base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run (thread_controller_with_message_pump_impl.cc:534)
    4   MyApp               0x55bb3027cee1      base::RunLoop::Run (run_loop.cc:141)
    5   MyApp               0x55bb302cf747      base::Thread::Run (thread.cc:334)
    6   MyApp               0x55bb302cf8d6      base::Thread::ThreadMain (thread.cc:405)
    7   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    8   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    9   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 6425
    0   libc.so.6                       0x7fd4c4dff116      <unknown>
    1   MyApp               0x55bb3040699a      event_base_loop (event.c:512)
    2   MyApp               0x55bb30300601      base::MessagePumpLibevent::Run (message_pump_libevent.cc:246)
    3   MyApp               0x55bb302b5410      base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run (thread_controller_with_message_pump_impl.cc:534)
    4   MyApp               0x55bb3027cee1      base::RunLoop::Run (run_loop.cc:141)
    5   MyApp               0x55bb302cf747      base::Thread::Run (thread.cc:334)
    6   MyApp               0x55bb302cf8d6      base::Thread::ThreadMain (thread.cc:405)
    7   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    8   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    9   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 21591
    0   libc.so.6                       0x7fd4c4dff116      <unknown>
    1   MyApp               0x55bb3040699a      event_base_loop (event.c:512)
    2   MyApp               0x55bb30300563      base::MessagePumpLibevent::Run (message_pump_libevent.cc:246)
    3   MyApp               0x55bb302b5410      base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run (thread_controller_with_message_pump_impl.cc:534)
    4   MyApp               0x55bb3027cee1      base::RunLoop::Run (run_loop.cc:141)
    5   MyApp               0x55bb302cf747      base::Thread::Run (thread.cc:334)
    6   MyApp               0x55bb302cf8d6      base::Thread::ThreadMain (thread.cc:405)
    7   MyApp               0x55bb302f2fee      base::(anonymous namespace)::ThreadFunc (platform_thread_posix.cc:101)
    8   libpthread.so.0                 0x7fd4c657dea7      <unknown>
    9   libc.so.6                       0x7fd4c4dfedef      <unknown>
    
    Thread 188242
    0   libpthread.so.0                 0x7fd4c6584ad8      <unknown>
    1   MyApp               0x55bb302c1896      base::internal::TaskTracker::RunTask (task_tracker.cc:556)
    
    Thread 188351
    0   libpthread.so.0                 0x7fd4c6584ad8      <unknown>
    1   MyApp               0x55bb302c1896      base::internal::TaskTracker::RunTask (task_tracker.cc:556)
    
    Thread 188352
    0   libpthread.so.0                 0x7fd4c6584ad8      <unknown>
    1   MyApp               0x55bb302c1896      base::internal::TaskTracker::RunTask (task_tracker.cc:556)
    
    Thread 188353
    0   libpthread.so.0                 0x7fd4c6584ad8      <unknown>
    1   MyApp               0x55bb302c1896      base::internal::TaskTracker::RunTask (task_tracker.cc:556)
    
    Thread 188558
    0   libpthread.so.0                 0x7fd4c6584ad8      <unknown>
    1   libpthread.so.0                 0x7fd4c6584540      <unknown>
    2   linux-vdso.so.1                 0x7ffe243659f7      <unknown>
    3   MyApp               0x55bb302ef135      base::ConditionVariable::TimedWait (condition_variable_posix.cc:131)
    
    
    
    EOF
    
  5. electron-issue-triage commented on Jun 30, 2025

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  6. added
    status/confirmed
    and removed on Jun 30, 2025
  7. self-assigned this
    on Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

blocked/need-reprobug 🪲status/confirmed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions