Comment #10 on issue 267 by [email protected]: Segmentation fault with if_lua (during or after the GC)
https://code.google.com/p/vim/issues/detail?id=267

Try to reproduce the bug after building vim with ASan (= address sanitizer) using the following patch to src/Makefile. Then run vim normally, ASan will report useful stacks if a memory bug is detected at runtime (double free, used of free memory, heap/stack/global overflow) Make sure that you run vim unstripped which should be the case if you ran src/vim. It assumes that you compile with a compiler that is not too ancient (>= gcc-4.8 or or >= clang-3.3 should be fine):

diff -r bfecd68c04dd src/Makefile
--- a/src/Makefile      Fri Oct 31 19:51:36 2014 +0100
+++ b/src/Makefile      Wed Nov 05 04:15:14 2014 +0100
@@ -616,6 +616,11 @@
 #PROFILE_LIBS = -pg
 #PROFILE_LIBS = -pg -lc

+# Build with address sanitizer.
+# See: # https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer
+ASAN_CFLAGS = -fsanitize=address -fno-omit-frame-pointer -O1 -g
+ASAN_LIBS = $(ASAN_CFLAGS)
+
 # MEMORY LEAK DETECTION
 # Requires installing the ccmalloc library.
 # Configuration is in the .ccmalloc or ~/.ccmalloc file.
@@ -1342,7 +1347,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) $(ASAN_CFLAGS) $(LEAK_CFLAGS) $(POST_DEFS)

 # Exclude $CFLAGS for osdef.sh, for Mac 10.4 some flags don't work together
 # with "-E".
@@ -1374,6 +1379,7 @@
           $(TCL_LIBS) \
           $(RUBY_LIBS) \
           $(PROFILE_LIBS) \
+          $(ASAN_LIBS) \
           $(LEAK_LIBS)

 # abbreviations


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
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.

Raspunde prin e-mail lui