[vim/vim] matchfuzzy() leaks allocated lists (PR #17980)

14 views
Skip to first unread message

zeertzjq

unread,
Aug 12, 2025, 10:12:44 PMAug 12
to vim/vim, Subscribed

Problem: matchfuzzy() leaks allocated lists (after 9.1.1627).
Solution: Restore the "retmatchpos" condition.

The memory leak cannot be caught by ASAN as the garbage collector still
tracks these lists, but it can be reproduced by the following script,
which increases Vim's memory usage to over 1 GiB without this fix:

for i in range(100000)
  call matchfuzzy([repeat('a', 300)], repeat('a', 257))
endfor

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/17980

Commit Summary

  • 53507b5 matchfuzzy() leaks allocated lists

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17980@github.com>

zeertzjq

unread,
Aug 12, 2025, 10:15:34 PMAug 12
to vim/vim, Subscribed
zeertzjq left a comment (vim/vim#17980)

cc @girishji


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17980/c3181957317@github.com>

girish

unread,
Aug 12, 2025, 10:54:15 PMAug 12
to vim/vim, Subscribed
girishji left a comment (vim/vim#17980)

Thanks for fixing this. I believe it was leaking the lmatchpos list.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17980/c3182011393@github.com>

zeertzjq

unread,
Aug 12, 2025, 10:55:31 PMAug 12
to vim/vim, Push

@zeertzjq pushed 1 commit.

  • 5e0f3a8 matchfuzzy() leaks allocated lists


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17980/before/fa36f82912ce44733f53618e1dd0cb7864f72cc0/after/5e0f3a8d58f987dae2ddab084c4c1479171b1f8e@github.com>

zeertzjq

unread,
Aug 13, 2025, 8:02:56 AMAug 13
to vim/vim, Subscribed
zeertzjq left a comment (vim/vim#17980)

Closing in favor of #17984


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17980/c3183549503@github.com>

zeertzjq

unread,
Aug 13, 2025, 8:02:58 AMAug 13
to vim/vim, Subscribed

Closed #17980.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/17980/issue_event/19135693216@github.com>

Reply all
Reply to author
Forward
0 new messages