I built vim-7.2.181 with GTK1 GUI on Linux x86...
./configure --with-features=huge --enable-gui=gtk
... and I see the following errors with valgrind memory
checker when navigating in the menubar or when resizing
the window:
==15894== Conditional jump or move depends on uninitialised value(s)
==15894== at 0x8131BB3: utfc_ptr2len (mbyte.c:1705)
==15894== by 0x81D5B0C: gui_mch_draw_string (gui_gtk_x11.c:6103)
==15894== by 0x81CC7B9: gui_outstr_nowrap (gui.c:2251)
==15894== by 0x81CCE63: gui_screenchar (gui.c:1872)
==15894== by 0x81CD249: gui_redraw_block (gui.c:2500)
==15894== by 0x81CEB63: gui_redraw (gui.c:2393)
==15894== by 0x81D9028: expose_event (gui_gtk_x11.c:652)
==16861== Conditional jump or move depends on uninitialised value(s)
==16861== at 0x8131B4F: utfc_ptr2len (mbyte.c:1686)
==16861== by 0x815B7FD: mch_call_shell (os_unix.c:4314)
==16861== by 0x812AA07: call_shell (misc2.c:3058)
==16861== by 0x807F784: ex_diffpatch (diff.c:976)
==16861== by 0x80C9F86: do_one_cmd (ex_docmd.c:2620)
==16861== by 0x80C8292: do_cmdline (ex_docmd.c:1096)
==16861== by 0x81408BF: nv_colon (normal.c:5224)
==16861== by 0x81429A7: normal_cmd (normal.c:1188)
==16861== by 0x8101946: main_loop (main.c:1180)
==16861== by 0x8104CEA: main (main.c:939)
Attached patch fixes it.
-- Dominique
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
Index: gui_gtk_x11.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/gui_gtk_x11.c,v
retrieving revision 1.62
diff -c -r1.62 gui_gtk_x11.c
*** gui_gtk_x11.c 17 May 2009 14:24:14 -0000 1.62
--- gui_gtk_x11.c 17 May 2009 21:12:55 -0000
***************
*** 6100,6107 ****
if (has_mbyte)
{
width = 0;
! for (p = s; p < s + len; p += (*mb_ptr2len)(p))
! width += (*mb_ptr2cells)(p);
}
else
# endif
--- 6100,6111 ----
if (has_mbyte)
{
width = 0;
! if (enc_utf8)
! for (p = s; p < s + len; p += utfc_ptr2len_len(p, len - (p - s)))
! width += (*mb_ptr2cells)(p);
! else
! for (p = s; p < s + len; p += (*mb_ptr2len)(p))
! width += (*mb_ptr2cells)(p);
}
else
# endif
Index: os_unix.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/os_unix.c,v
retrieving revision 1.95
diff -c -r1.95 os_unix.c
*** os_unix.c 17 May 2009 11:31:42 -0000 1.95
--- os_unix.c 17 May 2009 21:12:59 -0000
***************
*** 4305,4311 ****
ta_buf[i] = '\n';
# ifdef FEAT_MBYTE
if (has_mbyte)
! i += (*mb_ptr2len)(ta_buf + i) - 1;
# endif
}
--- 4305,4316 ----
ta_buf[i] = '\n';
# ifdef FEAT_MBYTE
if (has_mbyte)
! if (enc_utf8)
! i += utfc_ptr2len_len(ta_buf + i,
! ta_len + len - i) - 1;
! else
! i += (*mb_ptr2len)(ta_buf + i) - 1;
!
# endif
}