Bram Moolenaar <b...@moolenaar.net> wrote: > Valgrind has been reporting a leak when running test_popupwin. > I narrowed it down to Test_simple_popup(), somewhere halfway. > > The valgrind report is: > > ==22433== 8 bytes in 1 blocks are definitely lost in loss record 17 of 371 > ==22433== at 0x483874F: malloc (in > /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) > ==22433== by 0x280E74: lalloc (misc2.c:924) > ==22433== by 0x280D1F: alloc (misc2.c:827) > ==22433== by 0x281395: vim_strsave (misc2.c:1276) > ==22433== by 0x2BAA4A: buf_copy_options (option.c:5848) > ==22433== by 0x1872E4: buflist_new (buffer.c:2116) > ==22433== by 0x2D3AA9: popup_create (popupwin.c:1706) > ==22433== by 0x2D430A: f_popup_create (popupwin.c:1923) > > The buf_copy_options() line is: > > buf->b_p_nf = vim_strsave(p_nf); > > This is very strange, since several other buffer-local options are > allocated, and they are not reported. > > I did quite a bit of digging and finally found that this line in > defaults.vim triggers it: > > set nrformats-=octal > > I tried setting other options there, and got confusing results, until I > figured the leak is only reported if the string is exactly 8 bytes! That > is 7 text characters plus NUL. If I change nrformats to only "hex" or > make it "hex,hex,hex" then the leak is not reported. > > I assume this must be a bug in valgrind. Can't find anything about it > though.
Does it mean that you can reproduce the leak with something like: $ valgrind --leak-check=full vim --clean -c 'set nrformats-=octal' -c q If not, what is the minimalistic way of reproducing the leak? The above command does not leak for me. It's not impossible to find a bug with valgrind, but I think it's more likely to be a real bug with vim. Regards Dominique -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAON-T_jAARgA0wr%3DBymu1yEkJvWWYJP9VN2295uSMH0a_EVAvA%40mail.gmail.com.