Skip to content

High CPU and memory usage on a specific condition on Linux #1267

Open
@hikyae

Description

@hikyae

Code editor

Vim 9.1

Platform

Arch Linux

Version

5.4.3

What steps will reproduce the bug?

  1. Create a directory
    mkdir a
  2. Move to the directory
    cd a
  3. Create a sub directory whose name begins with "."(dot)
    mkdir .a
  4. In the sub directory, create a symbolic link that refers to root directory
    ln -s / .a/a
  5. Create the minimum vimrc(here it's named reproduce.vim) as follows (I use vim-plug for plugin manager)
call plug#begin()
Plug 'prabirshrestha/vim-lsp'
call plug#end()
if executable('bash-language-server')
  autocmd User lsp_setup call lsp#register_server({
        \ 'name': 'bash-language-server',
        \ 'cmd': {server_info->[&shell, &shellcmdflag, 'bash-language-server start']},
        \ 'allowlist': ['sh', 'bash'],
        \ })
endif
  1. Create and open a simple shell script with vim -u reproduce.vim -N justecho.sh
#!/bin/sh

echo hi
 
  1. Just wait a few seconds and the CPU fan starts to spin up

How often does it reproduce? Is there a required condition?

Those steps above always reproduce the issue.

What is the expected behavior?

My CPU is still calm

What do you see instead?

Wasted high CPU and memory usage

Additional information

Renaming the hidden directory to non-hidden directory avoids the phenomenon.
mv .a a

I've found the bug while I was editing a shell script in my home directory which has .wine directory.

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