Skip to content

100% CPU usage when helix shouldn't even be open #11667

Description

@gepbird

After editing some files on my raspberry server and exiting helix, a few hours/days later I noticed it's using 100% CPU.

I'm not sure how to reproduce this, but I'm keeping the process running for a few days in the hope of helping you debug this issue.

Strace showed nothing interesting, over a span of a minute there was only a futex call.
I'm not proficient with gdb, but here are the backtraces of all the threads:

gdb output
sudo gdb -p 687527
GNU gdb (GDB) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 687527
[New LWP 687533]
[New LWP 687531]
[New LWP 687530]
[New LWP 687529]
[New LWP 687528]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/nix/store/5qfsgr600bry4a6431w311jv4a73v8js-glibc-2.39-52/lib/libthread_db.so.1".
0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) info threads
  Id   Target Id                                          Frame
* 1    Thread 0x7fb85d2440 (LWP 687527) ".hx-wrapped"     0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
  2    Thread 0x7fb7c32ee0 (LWP 687533) ".hx-wrapped"     0x0000007fb83ce9e4 in read () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
  3    Thread 0x7fb7ebeee0 (LWP 687531) "tokio-runtime-w" 0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
  4    Thread 0x7fafffeee0 (LWP 687530) "tokio-runtime-w" 0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
  5    Thread 0x7fb80ceee0 (LWP 687529) "tokio-runtime-w" 0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
  6    Thread 0x7fb82deee0 (LWP 687528) "tokio-runtime-w" 0x0000007fb83da808 in epoll_pwait () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) bt
#0  0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#1  0x00000055675a6640 in parking_lot::condvar::Condvar::wait_until_internal ()
#2  0x0000005567745444 in tokio::runtime::park::Inner::park ()
#3  0x00000055674b2e24 in tokio::runtime::park::CachedParkThread::block_on ()
#4  0x0000005567506a6c in tokio::runtime::context::runtime::enter_runtime ()
#5  0x0000005567513be0 in tokio::runtime::runtime::Runtime::block_on ()
#6  0x0000005567538edc in hx::main ()
#7  0x0000005567539254 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#8  0x00000055674ff3e4 in std::rt::lang_start::{{closure}} ()
#9  0x00000055676ee408 in std::rt::lang_start_internal ()
#10 0x0000005567538fc8 in main ()
(gdb) thread 2
[Switching to thread 2 (Thread 0x7fb7c32ee0 (LWP 687533))]
#0  0x0000007fb83ce9e4 in read () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) bt
#0  0x0000007fb83ce9e4 in read () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#1  0x0000005566b3acf4 in <crossterm::event::source::unix::mio::UnixInternalEventSource as crossterm::event::source::EventSource>::try_read ()
#2  0x0000005566b333b0 in crossterm::event::read::InternalEventReader::poll ()
#3  0x0000005566b38d58 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#4  0x0000005566b396f4 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#5  0x00000055676dc42c in std::sys::pal::unix::thread::Thread::new::thread_start ()
#6  0x0000007fb836e8ac in start_thread () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#7  0x0000007fb83da48c in thread_start () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) thread 3
[Switching to thread 3 (Thread 0x7fb7ebeee0 (LWP 687531))]
#0  0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) bt
#0  0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#1  0x00000055675a6640 in parking_lot::condvar::Condvar::wait_until_internal ()
#2  0x0000005567748270 in tokio::runtime::scheduler::multi_thread::worker::Context::park_timeout ()
#3  0x00000055677476e0 in tokio::runtime::scheduler::multi_thread::worker::Context::run ()
#4  0x000000556773b514 in tokio::runtime::context::runtime::enter_runtime ()
#5  0x0000005567746a88 in tokio::runtime::scheduler::multi_thread::worker::run ()
#6  0x0000005567743524 in <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll ()
#7  0x00000055677286c4 in tokio::runtime::task::core::Core<T,S>::poll ()
#8  0x0000005567741ad8 in tokio::runtime::task::harness::Harness<T,S>::poll ()
#9  0x00000055677207c8 in tokio::runtime::blocking::pool::Inner::run ()
#10 0x000000556771a170 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#11 0x000000556771db14 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#12 0x00000055676dc42c in std::sys::pal::unix::thread::Thread::new::thread_start ()
#13 0x0000007fb836e8ac in start_thread () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#14 0x0000007fb83da48c in thread_start () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6

(gdb) thread 4
[Switching to thread 4 (Thread 0x7fafffeee0 (LWP 687530))]
#0  0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) bt
#0  0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#1  0x00000055675a6640 in parking_lot::condvar::Condvar::wait_until_internal ()
#2  0x0000005567748270 in tokio::runtime::scheduler::multi_thread::worker::Context::park_timeout ()
#3  0x00000055677476e0 in tokio::runtime::scheduler::multi_thread::worker::Context::run ()
#4  0x000000556773b514 in tokio::runtime::context::runtime::enter_runtime ()
#5  0x0000005567746a88 in tokio::runtime::scheduler::multi_thread::worker::run ()
#6  0x0000005567743524 in <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll ()
#7  0x00000055677286c4 in tokio::runtime::task::core::Core<T,S>::poll ()
#8  0x0000005567741ad8 in tokio::runtime::task::harness::Harness<T,S>::poll ()
#9  0x00000055677207c8 in tokio::runtime::blocking::pool::Inner::run ()
#10 0x000000556771a170 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#11 0x000000556771db14 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#12 0x00000055676dc42c in std::sys::pal::unix::thread::Thread::new::thread_start ()
#13 0x0000007fb836e8ac in start_thread () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#14 0x0000007fb83da48c in thread_start () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) thread 5
[Switching to thread 5 (Thread 0x7fb80ceee0 (LWP 687529))]
#0  0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) bt
#0  0x0000007fb83d7da4 in syscall () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#1  0x00000055675a6640 in parking_lot::condvar::Condvar::wait_until_internal ()
#2  0x0000005567748270 in tokio::runtime::scheduler::multi_thread::worker::Context::park_timeout ()
#3  0x00000055677476e0 in tokio::runtime::scheduler::multi_thread::worker::Context::run ()
#4  0x000000556773b514 in tokio::runtime::context::runtime::enter_runtime ()
#5  0x0000005567746a88 in tokio::runtime::scheduler::multi_thread::worker::run ()
#6  0x0000005567743524 in <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll ()
#7  0x00000055677286c4 in tokio::runtime::task::core::Core<T,S>::poll ()
#8  0x0000005567741ad8 in tokio::runtime::task::harness::Harness<T,S>::poll ()
#9  0x00000055677207c8 in tokio::runtime::blocking::pool::Inner::run ()
#10 0x000000556771a170 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#11 0x000000556771db14 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#12 0x00000055676dc42c in std::sys::pal::unix::thread::Thread::new::thread_start ()
#13 0x0000007fb836e8ac in start_thread () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#14 0x0000007fb83da48c in thread_start () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) thread 6
[Switching to thread 6 (Thread 0x7fb82deee0 (LWP 687528))]
#0  0x0000007fb83da808 in epoll_pwait () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
(gdb) bt
#0  0x0000007fb83da808 in epoll_pwait () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#1  0x0000005567588754 in mio::sys::unix::selector::epoll::Selector::select ()
#2  0x0000005567716464 in tokio::runtime::io::driver::Driver::turn ()
#3  0x000000556773df18 in tokio::runtime::time::Driver::park_internal ()
#4  0x0000005567748198 in tokio::runtime::scheduler::multi_thread::worker::Context::park_timeout ()
#5  0x00000055677476e0 in tokio::runtime::scheduler::multi_thread::worker::Context::run ()
#6  0x000000556773b514 in tokio::runtime::context::runtime::enter_runtime ()
#7  0x0000005567746a88 in tokio::runtime::scheduler::multi_thread::worker::run ()
#8  0x0000005567743524 in <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll ()
#9  0x00000055677286c4 in tokio::runtime::task::core::Core<T,S>::poll ()
#10 0x0000005567741ad8 in tokio::runtime::task::harness::Harness<T,S>::poll ()
#11 0x00000055677207c8 in tokio::runtime::blocking::pool::Inner::run ()
#12 0x000000556771a170 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#13 0x000000556771db14 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#14 0x00000055676dc42c in std::sys::pal::unix::thread::Thread::new::thread_start ()
#15 0x0000007fb836e8ac in start_thread () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6
#16 0x0000007fb83da48c in thread_start () from /nix/store/kz7xglxzhad64v667wwpn8vrxhjwcbna-glibc-2.39-52/lib/libc.so.6

Helix log, may be out of date:
helix.log

Platform: aarch64 Linux/NixOS
Helix installation: nixpkgs/nixos-unstable
Helix version: 24.07

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions