On Wed, Sep 7, 2011 at 13:56, Bram Moolenaar <[email protected]> wrote: > > Gasper Azman wrote: > >> (Note: I can't post to this list yet, a mod has to approve this email. >> I'm also sorry for the gmail chat invites gmail spammed in my name, an >> unlucky misclick caused that and I didn't know how to stop it. I also >> sent this patch yesterday already, but it seems every one of the mods >> failed to post it to the list, so I'm sending it again in hope of it >> getting through this time.) >> >> Hi everyone, >> >> I also stumbled upon a segfault on autocompletion. I proceeded to find >> a bug in the latest hg source in edit.c that I think causes the crash >> - code forgets to check whether the leader pointer is null. >> >> This is what fixes the issue for me: >> >> #################################### >> diff -r d6c709d07173 src/edit.c >> --- a/src/edit.c Fri Sep 02 14:18:20 2011 +0200 >> +++ b/src/edit.c Tue Sep 06 15:22:02 2011 +0200 >> @@ -4604,7 +4604,7 @@ >> { >> if (!compl_get_longest || compl_used_match) >> ins_compl_insert(); >> - else >> + else if(compl_leader != NULL) >> ins_bytes(compl_leader + ins_compl_len()); >> } >> else >> #################################### > > I think patch 7.3.294, which reverts 7.3.289, already fixed this. > > How did you reproduce this crash? It might be useful to add a test. >
My .vimrc had completeopt+=longest. However, I can't reproduce the problem with a simple testcase, because it (somehow) works for every simple c++ file I produce. It only started crashing when clang had to parse half of the standard library plus some extras and took about a second to complete, and that's not a testcase (it was happening with the clang_complete plugin). So eek, sorry. Having to include half of openscenegraph probably isn't a valid test :) Otherwise, if you really want to know exactly what I did: I tried to complete something like std::vector. So I write the std:, so far so good. I then write the next ':', at which point completion kicks in and takes a second to calculate the menu, while I'm typing the next 've'. However, just 'v' is enough to complete the rest to 'vector', and when completion finally returns, vim enters 'ector' and then the final 'e' that I typed in earlier. At which point vim receives SIGSEGV with the backtrace I posted. I also tried typing slowly so that vim completes each step before the next keystroke is entered but it still crashed on entering the 'e' or anything that didn't lead to a completion really. That's basically it. Regards, Gašper -- 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
