On 27 August 2013, Manpreet Singh <manpreet.si...@gmail.com> wrote:
> On 8/27/13 1:04 PM, Dominique Pellé wrote:
> >Manpreet Singh <manpreet.si...@gmail.com> wrote:
> >
> >>(Please excuse any duplicate posts. Posting via news.gmane.org seems to 
> >>have bounced)
> >>
> >>Platform: Mac OS X 10.8.4 64-bit (latest release at time of posting)
> >>
> >>Version: MacVim 7.4.9 (vim original (hg) or vim/gvim based on macvim 
> >>sources)
> >>
> >>Reproduction:
> >>
> >>   :call expand('a', 'p', 0700)
> >>
> >>causes immediate bus error.
> >
> >I can't reproduce it on my Linux x86_64 laptop.
> >
> >But SIGBUS would happen for a misaligned memory access which is
> >problematic on some processors (SPARC, MIPS, ...) but not other
> >(x86...).  That's probably why I don't see the bug.
> >
> >Can you provide a stack trace with gdb and/or reproduce it with
> >valgrind?
> >
> >Dominique
> >
>
> Hmm, I couldn't reproduce it with just expand this time though now but
> mkdir still crashes in f_mkdir. Stack below:
> 
> % gdb /Applications/MacVim.app/Contents/MacOS/Vim
> (gdb) set args -u NONE -U NONE +'call mkdir(expand("abc", "p", 0700))'
> (gdb) run
> Error detected while processing command line:
> Program received signal EXC_BAD_ACCESS, Could not access memory.

    The second problem is easy to reproduce with ':call mkdir([])'.
Please see the patch below for a fix.

    I have no idea about the initial problem though.  I can't reproduce
it, and I don't see any obvious bug in the code.

    /lcd


diff -r 477b4f701156 src/eval.c
--- a/src/eval.c        Sun Aug 25 17:46:08 2013 +0200
+++ b/src/eval.c        Wed Aug 28 13:53:25 2013 +0300
@@ -14292,6 +14292,8 @@
        return;
 
     dir = get_tv_string_buf(&argvars[0], buf);
+    if (*dir == NUL)
+       return;
     if (*gettail(dir) == NUL)
        /* remove trailing slashes */
        *gettail_sep(dir) = NUL;

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui