Skip to content

Multiline String Literal cause nvim to freeze with high CPU usage #260

@onion108

Description

@onion108

TL;DR

I've figure out where the problem is, by experimenting a little bit.
When a multiline string literal appears in file, like

var stringVar = """
maimaiDX
Chunithm
Ongeki
"""

then nvim freezes.

An easy test that proves this still isn't nvim's problem is, I tried to create a Python file with multiline string literal and it works fine. That means nvim can handle such lexical item which spans across lines properly. Other tests that proved nvim probably isn't the one cause the problem has been shown in the original text.

Original Text

The completion data provided by csharp-ls cause nvim to freeze with 100% CPU usage somehow.
A screenshot of nvim stucking:
Image

Since I couldn't figure out what's actually happening, I'll provided all information that is related as much as possible, so this issue might be super long and contains useless information (well I don't know what is useful so of course I'll provide them all)

Actual Content

First of all trace logs are obtained, of course: https://gist.github.com/onion108/5649c0fccac27b03139778f13542b184

A fastfetch of my system environment:

Image

nvim version: v0.12.0-dev-1178+gc553008e74
csharp-ls version: 0.19.0.0

Unfortunately I am not able to provide a minimal reproducible example because it seems hard to reproduce on new project. It happens on a specific project and even more unfortunately I am not able publish the source code because I'm just helping a closed-source thing. (Though, I'm just told that the project is closed-source and there is no thing like legal announcement nor signed I on some contract-like things so I should be safe to reveal part of it, so if more proof should be provided (e.g. a screen record of constantly reproducing it) I'll be happy to provide, as long as it doesn't require to reveal the whole project. )

At first I suspect it's my completion engine's problem, so I changed blink.cmp to nvim-cmp, and neovim still freezes. So I changed csharp-ls to omnisharp and suprisingly it doesn't freeze now, that's why I highly suspect csharpls gave neovim something that caused it to freeze. Haven't tested on other editors yet.

The project I'm editing is an ASP.NET WebAPI project, I could provide a dependency list:

    <PackageReference Include="BCrypt.Net-Next" Version="4.0.3" />
    <PackageReference Include="MailKit" Version="4.11.0" />
    <PackageReference Include="MongoDB.Driver" Version="3.3.0" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
    <PackageReference Include="Semver" Version="3.0.0" />
    <PackageReference Include="SixLabors.ImageSharp" Version="3.1.7" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1" />

and the project's .NET SDK version is set to 8.0 if it's related.

As a reference, my neovim config: https://codeberg.org/onion27/onion27-nvim-config

This problem seems only happening on files in a specific folder in the Project... which made it more weird.

EDIT: Just tried, rebooting doesn't change anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions