David Fishburn wrote:

> Good Morning.
>
> My gVim (1-394)  Windows XP SP3 has just crashed 2 times this morning.
>
> So I synced up and re-compiled and started it again.
> Just crashed again, here is the stack trace supplied.
>
>>       gvim.exe!free(void * pBlock=0x01dc3770)  Line 110       C
>        gvim.exe!free_screenlines()  Line 7789 + 0x13 bytes     C
>        gvim.exe!screenalloc(int clear=0)  Line 7714    C
>        gvim.exe!screenclear()  Line 7801 + 0x7 bytes   C
>        gvim.exe!set_shellsize(int width=0, int height=0, int mustset=0)  Line 
> 3112     C
>        gvim.exe!gui_resize_shell(int pixel_width=1920, int
> pixel_height=1143)  Line 1318 + 0x8 bytes       C
>        gvim.exe!gui_mch_newfont()  Line 3189 + 0x3f bytes      C
>        gvim.exe!gui_set_shellsize(int mustset=0, int fit_to_display=0, int
> direction=2)  Line 1495 C
>        gvim.exe!gui_init_which_components(unsigned char *
> oldval=0x00000000)  Line 3373 + 0x9 bytes       C
>        gvim.exe!enter_tabpage(tabpage_S * tp=0x00000000)  Line 3682 + 0x1e 
> bytes       C
>        gvim.exe!goto_tabpage_tp(tabpage_S * tp=0x00000000)  Line 3779 + 0x5 
> bytes      C
>        gvim.exe!goto_tabpage(int n=0)  Line 3761       C
>        gvim.exe!normal_cmd(oparg_S * oap=0x0013fc68, int toplevel=1)  Line 
> 1196        C
>        gvim.exe!main_loop(int cmdwin=0, int noexmode=0)  Line 1211 + 0xb 
> bytes C
>        gvim.exe!VimMain()  Line 961    C
>        gvim.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ *
> hPrevInst=0x00000000, char * lpszCmdLine=0x00162326, int nCmdShow=10)
> Line 131        C
>        gvim.exe!__tmainCRTStartup()  Line 324 + 0x1c bytes     C
>        kernel32.dll!7c817077()
>        gvim.exe!nv_brackets(cmdarg_S * cap=0x006e0061)  Line 6573      C
>        gvim.exe!nv_brackets(cmdarg_S * cap=0x006e0061)  Line 6573      C
>        gvim.exe!nv_brackets(cmdarg_S * cap=0x006e0061)  Line 6573      C
>        gvim.exe!nv_brackets(cmdarg_S * cap=0x00660069)  Line 6573      C
>
>
>
> Here is my :ver
>
>
> VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Mar 11 2010 09:45:27)
> MS-Windows 32-bit GUI version with OLE support
> Included patches: 1-394
> Compiled by fishb...@fishburn-d830
> Big version with GUI.  Features included (+) or not (-):
> +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
> +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist
> +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con_gui
> +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search
>  +farsi +file_in_path +find_in_path +float +folding -footer
> +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist +keymap
> +langmap
>  +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession
> +modify_fname +mouse +mouseshape +multi_byte +multi_lang -mzscheme
> +netbeans_intg +ole -osfiletype +path_extra +perl/dyn -postscript
> +printer -profile +python/dyn +quickfix +reltime +rightleft -ruby
> +scrollbind +signs +smartindent -sniff +startuptime +statusline
> -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl
> -tgetent -termresponse +textobjects +title +toolbar +user_commands
> +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
> +wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save 
> +xpm_w32
>   system vimrc file: "$VIM\vimrc"
>     user vimrc file: "$HOME\_vimrc"
>  2nd user vimrc file: "$VIM\_vimrc"
>      user exrc file: "$HOME\_exrc"
>  2nd user exrc file: "$VIM\_exrc"
>  system gvimrc file: "$VIM\gvimrc"
>    user gvimrc file: "$HOME\_gvimrc"
> 2nd user gvimrc file: "$VIM\_gvimrc"
>    system menu file: "$VIMRUNTIME\menu.vim"
> Compilation: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32
> -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG   -DFEAT_XPM_W32   -DWINVER=0x0400
> -D_WIN32_WINNT=0x0400  /Fo.\ObjGOLY/ /Ox /GL -DNDEBUG  /Zl /MT
> -DFEAT_OLE -DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT
> -DFEAT_PYTHON -DDYNAMIC_PYTHON  -DDYNAMIC_PYTHON_DLL=\"python25.dll\"
> -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl58.dll\"
> -DFEAT_BIG /Fd.\ObjGOLY/ /Zi
> Linking: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS
> oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib
> comdlg32.lib ole32.lib uuid.lib /machine:i386 /nodefaultlib gdi32.lib
> version.lib   winspool.lib comctl32.lib advapi32.lib shell32.lib
> /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib  user32.lib
> /nodefaultlib:python25.lib    WSock32.lib
> C:\download\OpenSrc\vim\XPM_support_for_Netbeans\xpm-4.2.0\lib\libXpm.lib
> /PDB:gvim.pdb -debug
>
>
>
> Seems to be trigger by flipping tabs, but can't be sure.
>
> Anyway, if there is something I can do to help determine the cause of
> this, please let me know.  I could also run a debug version (since I
> compile that as well).

I don't know how to reproduce this issue.  Perhaps you
have something special in your vimrc or use a plugin
that is triggering the bug.  If you don't mind sharing
your ~/.vimrc and ~/.vim content, or tell us which plugins
you use, it could perhaps help others to reproduce it.

Valgrind does not exist for Windows there is no plan
to port it to Windows. See:
  http://valgrind.org/info/platforms.html

There are as far as I know only "expensive" alternative to
Valgrind/memcheck for Windows (purify, insure++,
BoundsChecker and others) which can find memory
issues on Windows, but but in very different ways than
Valgrind.

How about settings the pointers to NULL right after
freeing them in free_screenlines(...) so if something is
using free memory, it will at least crash immediately.
It may help to detect problems earlier. Of course the
bug may be something else than using freed memory
anyway but it's worth trying.

You can do as in the patch below (this is just for debugging,
we should not need in theory to apply this patch of Vim):

diff -r aab202d244b6 src/screen.c
--- a/src/screen.c      Wed Mar 10 17:16:12 2010 +0100
+++ b/src/screen.c      Fri Mar 12 05:26:48 2010 +0100
@@ -7780,17 +7780,19 @@
 #ifdef FEAT_MBYTE
     int                i;

-    vim_free(ScreenLinesUC);
+    vim_free(ScreenLinesUC); ScreenLinesUC = NULL;
     for (i = 0; i < Screen_mco; ++i)
-       vim_free(ScreenLinesC[i]);
-    vim_free(ScreenLines2);
-#endif
-    vim_free(ScreenLines);
-    vim_free(ScreenAttrs);
-    vim_free(LineOffset);
-    vim_free(LineWraps);
-#ifdef FEAT_WINDOWS
-    vim_free(TabPageIdxs);
+    {
+       vim_free(ScreenLinesC[i]); ScreenLinesC[i] = NULL;
+    }
+    vim_free(ScreenLines2); ScreenLines2 = NULL;
+#endif
+    vim_free(ScreenLines); ScreenLines = NULL;
+    vim_free(ScreenAttrs); ScreenAttrs = NULL;
+    vim_free(LineOffset); LineOffset = NULL;
+    vim_free(LineWraps); LineWraps = NULL;
+#ifdef FEAT_WINDOWS
+    vim_free(TabPageIdxs); TabPageIdxs = NULL;
 #endif
 }

You may want to do the same in other places
which you may think are relevant.

Maybe it's related to asynchronously resizing
the window since I see some resize in the stack.
So trying to resize the window with the mouse
may help to do some stress tests.

> Incidently, today is my last day before I head on vacation for a week
> (for future followups).
>
> Thanks,
> Dave

I hope it does not ruin your vacations! :-)

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

Raspunde prin e-mail lui