Hi Thomas! On Fr, 13 Apr 2012, Thomas Dziedzic wrote:
> On Fri, Apr 13, 2012 at 9:00 AM, Taylor Hedberg <tmhedb...@gmail.com> wrote: > > Arch x86_64 here and I can reproduce the segfault as well. My Vim is > > compiled with +python but not +python3, if that makes any difference. > > Hi, > > I was going to report this when I had more time to debug, but since > people are already posting it here, I will submit what I have. > > Yesterday I had a segfault with vim + neocomplcache turned on while > editing a file (reproducible). > The stack trace from that is at: https://gist.github.com/2377278 > > I can confirm the segfault with :python print "hello" > The stack trace is at: https://gist.github.com/2377276 > > They crash in the same location: > #0 0x00007ffff4b3f578 in memchr () from /lib/libc.so.6 > #1 0x00000000005a96e8 in writer (fn=0x4d5f70 <msg>, str=0x0, n=2) at > if_py_both.h:172 > #2 0x00000000005a9912 in OutputWrite (self=<optimized out>, > args=<optimized out>) at if_py_both.h:82 I really don't know the interface between Vim and python but I wonder why str is null. This patch guards against str being Null and should therefore prevent the segfault. However, this just means :python print "hello" won't return anything, so possibly parsing the argument gets wrong somewhere before. diff --git a/src/if_py_both.h b/src/if_py_both.h --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -74,7 +74,7 @@ char *str = NULL; int error = ((OutputObject *)(self))->error; - if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len)) + if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len) || str == NUL) return NULL; Py_BEGIN_ALLOW_THREADS regards, Christian -- 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