> > > > Can you turn the example into a test? I gave it a try but it didn't
> > > > trigger the error.
> > > >
> > > >
> > > >
> > > I am able to reproduce this error with the following function:
> > >
> > > ===============================================
> > > func Test()
> > > call writefile(['test1', 'test2'], 'Xfile')
> > > edit Xfile
> > > let s:bufnr = bufnr()
> > > call setloclist(1, [{'bufnr' : s:bufnr, 'lnum' : 1, 'text' : 'test1'},
> > > \ {'bufnr' : s:bufnr, 'lnum' : 2, 'text' : 'test2'}])
> > >
> > > augroup Test_LocList
> > > au!
> > > autocmd BufEnter * call setloclist(1,
> > > \ [{'bufnr' : s:bufnr, 'lnum' : 1, 'text' : 'test1'},
> > > \ {'bufnr' : s:bufnr, 'lnum' : 2, 'text' : 'test2'}], 'r')
> > > augroup END
> > >
> > > lopen
> > > exe "normal j\<CR>"
> > >
> > > augroup Test_LocList
> > > au!
> > > augroup END
> > > call delete('Xfile')
> > > endfunc
> > > ===============================================
> >
> > Strangely, when running this under valgrind I have to change the line
> > with the normal command to catch the E926 error, which makes sense:
> >
> > call assert_fails('exe "normal j\<CR>"', 'E926:')
> >
> > However, when not using valgrind it reports "command did not fail".
> > Thus there must still be something wrong.
>
> Running with ASAN has a similar effect: The test passes and no errors
> are reported. I suspect both Valgrind and ASAN initialize pointers
> in some way, and when not doing that the error is not caught.
Using the changedtick besides the pointers makes it reliable.
I suspect that valgrind and ASAN never re-use previously used memory,
while in practice recently freed memory of the same size is used again.
Thus even though the entries were replaced, the pointers can be
unchanged.
--
Beer & pretzels can't be served at the same time in any bar or restaurant.
[real standing law in North Dakota, United States of America]
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202009132047.08DKlCVT1468812%40masaka.moolenaar.net.