memory leak when adding an item to a tuple fails
Maintainers usually reply within 13 days
Nobody has claimed this yet.
- #21596 by @yegappan — closed without merging
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start with the aid_tuple_append allocation path named in the reproducer, then run the provided Vim script under Valgrind with leak checking enabled. Done means the allocation failure displays E342: Out of memory! without leaking memory; a linked pull request is already open.
Written by the indexing model from the issue text.
Description
Steps to reproduce
let v:testing = 1
let s = 'ab'
let t1 = (1,)
let t2 = (s .. 'cd',)
" 34 is aid_tuple_append
call test_alloc_fail(34, 0, 0)
try | let x = t1 + t2 | catch | endtry
call test_alloc_fail(0, 0, 0)
qa!
Reproduced with valgrind --leak-check=full vim -u NONE -i NONE -N -X --not-a-term -es -S repro.vim. The same leak happens for let x = t3[0 : 1] where t3 has string items, and for a tuple literal whose first item is a string, let x = (s .. 'x', 2).
Expected behaviour
The message E342: Out of memory! is displayed and no memory leak.
Version of Vim
9.2.1202
Environment
Linux (Ubuntu)
- Dominant language
- Vim Script
- Stars
- 41.4k
- Forks
- 6.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vim/vim
-
autoconf failes to find libsodium even when present due to implicit function declarationPossibly taken @coderjoe claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 13 days
-
`json_decode()` uses a number as a string pointer when 'encoding' has no converterPossibly taken @mattn claimed this 7 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 13 days
-
GTK4 build's v:servername is prefixed with $XDG_RUNTIME_DIR/vimMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 13 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 13 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 13 days
Similar issues
-
Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
anthropics/skills#2328 ·
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
tonydzi/sqlite-graph-memory#133 · 1 comment ·
Maintainers usually reply within 1 day
-
area: build-and-ci S3: minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
manaflow-ai/cmux#72257 ·
Maintainers usually reply within 1 day