Giter Club home page Giter Club logo

Comments (13)

krobelus avatar krobelus commented on June 18, 2024

looks like you spawn an awk process that eats up all memory. I assume no other process uses a signifcant amount of memory.
How do you start that awk process? I can't find Convert a position a document to a position in our list of flags anywhere.
Can you give a small reproducer?

from kakoune.

vbauerster avatar vbauerster commented on June 18, 2024

I'm not sure how to reproduce exactly. Maybe it is specific to my config, but I have disabled major plugins like kak-lsp before test. Also this is not happening with release with same config.

from kakoune.

krobelus avatar krobelus commented on June 18, 2024

To fix this we need to find out who is using all the 22GB of memory. The awk command and its stdin might be enough.

So you're saying the OOM does not happen on the release? Or only the coredump?

from kakoune.

vbauerster avatar vbauerster commented on June 18, 2024

So you're saying the OOM does not happen on the release? Or only the coredump?

Exactly, with release version of kakoune I don't have both.

from kakoune.

vbauerster avatar vbauerster commented on June 18, 2024

Ok, I found culprit plugin.

from kakoune.

krobelus avatar krobelus commented on June 18, 2024

does it reproduce consistently?
If yes, it shouldn't take long to run a git bisect.
There are only 28 commits in git log v2023.08.05..origin/master src
On Linux, you could limit the amount of memory using cgroups to prevent a general system freeze. Also disable swap for reproducing this.

from kakoune.

vbauerster avatar vbauerster commented on June 18, 2024

OOM and crash not happening with disabled scrollbar.kak plugin. But surprisingly it works in release version.

from kakoune.

krobelus avatar krobelus commented on June 18, 2024

ok the easiest approach might be to add print statements to every loop in the awk process. It's only 4 loops.

I suspect that in

for (i=flags_start; i<=flags_end; i++) {
    flags_by_line[i] = 1
}

flags_start > flags_end so we loop for billions of times.
This could be the case if %val{window_range} is reported differently for new clients.
Maybe 9787756 (Use last display setup instead of recomputing for window_range, 2023-09-08).

from kakoune.

vbauerster avatar vbauerster commented on June 18, 2024

I invoke scrollbar-enable at WinCreate hook, like:

hook global WinCreate .* %{
    scrollbar-enable
}

With this hook disabled, invoking at prompt new; scrollbar-enable works as expected, i.e. not causing OOM and crash.

from kakoune.

vbauerster avatar vbauerster commented on June 18, 2024

ok the easiest approach might be to add print statements to every loop in the awk process. It's only 4 loops.

I suspect that in

for (i=flags_start; i<=flags_end; i++) {
    flags_by_line[i] = 1
}

flags_start > flags_end so we loop for billions of times. This could be the case if %val{window_range} is reported differently for new clients. Maybe 9787756 (Use last display setup instead of recomputing for window_range, 2023-09-08).

I managed to print flats_start and flags_end values right before the loop, so flags_end ends up having enormous big values:

flags_start: 0
flags_end: 360284
flags_start: 0
flags_end: 348847
flags_start: 0
flags_end: 338113

from kakoune.

krobelus avatar krobelus commented on June 18, 2024

I can reproduce with

timeout -sKILL 5 src/kak -e 'source ../scrollbar.kak/scrollbar.kak; hook g WinCreate .* scrollbar-enable; new; new; new; new'; reset

the clients that don't manage to show the scratch buffer triggered the bug.
Bisects to 9787756 (Use last display setup instead of recomputing for window_range, 2023-09-08).
Haven't root-caused it yet. window_range appears to be zero even in the affected clients.
Maybe it's some kind of UB causing kakoune to run into a loop or something

from kakoune.

Screwtapello avatar Screwtapello commented on June 18, 2024

Yeah, I reported this as #4975 and then tried to update the documentation in #4994. Unfortunately it seems I still don't quite understand how things should work, so I haven't been able to fix the docs properly or fix the scrollbar plugin.

from kakoune.

krobelus avatar krobelus commented on June 18, 2024

right I forgot to run with sanitizers

from kakoune.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.