Bram Moolenaar <[email protected]> wrote:
> Kazunobu Kuriyama wrote: > >> On Jun 19, 2015, at 23:33, Bram Moolenaar <[email protected]> wrote: >> >> > >> > Patch 7.4.745 >> > Problem: The entries added by matchaddpos() are returned by getmatches() >> > but can't be set with setmatches(). (Lcd) >> > Solution: Fix setmatches(). (Christian Brabandt) >> > Files: src/eval.c, src/testdir/test63.in, src/testdir/test63.ok >> > <snip> >> >> Hi, >> >> This patch causes a segfault at eval.c::17177 due to a trivial reason. >> >> The attached patch fixes it. > > Thanks! Unfortunately valgrind does not find this kind of error. The address sanitizer (asan) would find such bugs. It finds stack and global variable corruptions not detected by valgrind. And it's much faster than valgrind. On the other hand, asan does not find uninitialized memory access found by valgrind. Attached is a patch to offer the option to build vim with asan. Dominique -- -- 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]. For more options, visit https://groups.google.com/d/optout.
diff -r 2957a57decad src/Makefile --- a/src/Makefile Fri Jun 19 21:06:11 2015 +0200 +++ b/src/Makefile Sat Jun 20 06:14:59 2015 +0200 @@ -616,6 +616,12 @@ #PROFILE_LIBS = -pg #PROFILE_LIBS = -pg -lc +# Uncomment one of the next two lines to compile Vim with the +# address sanitizer or with the undefined sanitizer. +#SANITIZER_CFLAGS = -g -O0 -fsanitize=address -fno-omit-frame-pointer +#SANITIZER_CFLAGS = -g -O0 -fsanitize=undefined -fno-omit-frame-pointer +SANITIZER_LIBS = $(SANITIZER_CFLAGS) + # MEMORY LEAK DETECTION # Requires installing the ccmalloc library. # Configuration is in the .ccmalloc or ~/.ccmalloc file. @@ -1342,7 +1348,7 @@ PRE_DEFS = -Iproto $(DEFS) $(GUI_DEFS) $(GUI_IPATH) $(CPPFLAGS) $(EXTRA_IPATHS) POST_DEFS = $(X_CFLAGS) $(MZSCHEME_CFLAGS) $(TCL_CFLAGS) $(EXTRA_DEFS) -ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(LEAK_CFLAGS) $(POST_DEFS) +ALL_CFLAGS = $(PRE_DEFS) $(CFLAGS) $(PROFILE_CFLAGS) $(SANITIZER_CFLAGS) $(LEAK_CFLAGS) $(POST_DEFS) # Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together # with "-E". @@ -1374,6 +1380,7 @@ $(TCL_LIBS) \ $(RUBY_LIBS) \ $(PROFILE_LIBS) \ + $(SANITIZER_LIBS) \ $(LEAK_LIBS) # abbreviations
