Christian Brabandt wrote:
> Hi John!
>
> On Di, 25 Jan 2011, John Beckett wrote:
>
> > Hoss wrote:
> > > $ find . -mindepth 1 -maxdepth 1 -name '*.pm' | xargs sh -c
> > > '/usr/ local/bin/vim -p "$@" </dev/tty'
> > >
> > > The find command has 60 hits. Now, if I just run this
> > > command, it works fine, and I get 10 tabpages. I want each in
> > > their own tabpage, so I put this in my .vimrc file
> > >
> > > set tpm`
> > >
> > > With that change, when I run the command, I get the following:
> > >
> > > Vim: Caught deadly signal SEGV
> > > Vim: Finished
> > > Segmentation fault
> >
> > Please try a simpler test. Does the following lead to a crash?
>
> I can reproduce this. The problem here is a custom 'tabline' setting and
> this results in a crash in the build_stl_str_hl() function. I have a
> rather complicated tabline-setting, that I picked up in vim-use I guess.
> I never need it though (and in fact tend to forget about it ;))
>
> Here is a possible fix, that at least prevents the crash, but also
> prevents drawing the statusline and tabline label. I must admit, I
> haven't had time to investigate the build_stl_str_hl function in detail,
> so I don't know the proper fix:
> diff --git a/src/buffer.c b/src/buffer.c
> --- a/src/buffer.c
> +++ b/src/buffer.c
> @@ -3465,9 +3465,9 @@
> /*
> * Handle up to the next '%' or the end.
> */
> - while (*s != NUL && *s != '%' && p + 1 < out + outlen)
> + while (*s != NUL && *s != '%' && p + 1 < out + outlen && *p != NUL)
> *p++ = *s++;
> - if (*s == NUL || p + 1 >= out + outlen)
> + if (*s == NUL || p + 1 >= out + outlen || *p == NUL)
> break;
>
> /*
> diff --git a/src/screen.c b/src/screen.c
> --- a/src/screen.c
> +++ b/src/screen.c
> @@ -6429,7 +6429,7 @@
> int n;
> int len;
> int fillchar;
> - char_u buf[MAXPATHL];
> + char_u buf[MAXPATHL] = "";
> char_u *stl;
> char_u *p;
> struct stl_hlrec hltab[STL_MAX_ITEM];
This solution is bogus.
> Attached is:
> valgrind.log when running the vim -N -i NONE --cmd 'set tpme' -p
> /tmp/vim-crash/* (a directory containing about 60 files)
> tabline.vim My custom tabline setting
Looking through the code I found one situation where it would read
uninitialized memory:
:set stl=%!'asdf%'
However, the valgrind log looks different from what you show. I suspect
there is another problem. Or the same problem in another situation.
Can you check with patch 7.3.112 if you can still reproduce the valgrind
warning?
--
hundred-and-one symptoms of being an internet addict:
178. You look for an icon to double-click to open your bedroom window.
/// 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