2008/11/18 Bram Moolenaar <[EMAIL PROTECTED]>:

> Dominique Pelle wrote:
>
>> I observe a bug with the latest Vim-7.2.42 (huge) on Linux x86.
>> It's not recently introduced since I can reproduce at least with
>> Vim-7.1.314 which comes with Ubuntu-8.10.  It only happens in
>> a terminal (gvim does not seem affected).
>>
>> Steps to reproduce:
>>
>> 1/ start Vim in a terminal (xterm or gnome-terminal) with:   vim -u NONE
>>
>> 2/ enter INSERT mode with:    i
>>
>> 3/ select (into clipboard) a few lines of text with the mouse from
>>    another terminal
>>
>> 4/ paste those selected lines with the mouse into Vim (middle click)
>>
>> 5/ visual select all text with and reformat with:   <Esc>1GVGgq
>>
>> 6/ delete everything with:        :%d
>>
>> 7/ enter insert mode again with:    i
>>
>> 8/ paste same again text still in clipboard with the mouse (middle click)
>>
>>
>> Observe that after pasting test in step 8/, Vim either crashes with:
>>
>>     Vim: Caught deadly signal ABRT
>>     Vim: preserving files...
>>
>> .. or sometimes Vim just misbehaves (hangs or not longer accepts all
>> keystrokes for example).  Sometimes the text is not inserted at all
>> when pasting the second time at step 8/.
>>
>> Running the same test with Valgrind, I see errors 100% of the times
>> but so far I did not find how to fix them:
>>
>> ==11904== Conditional jump or move depends on uninitialised value(s)
>> ==11904==    at 0x47D8548: (within /usr/lib/libXt.so.6.0.0)
>> ==11904==    by 0x47D891A: (within /usr/lib/libXt.so.6.0.0)
>> ==11904==    by 0x47C23E4: XtDispatchEventToWidget (in 
>> /usr/lib/libXt.so.6.0.0)
>> ==11904==    by 0x47C2D87: (within /usr/lib/libXt.so.6.0.0)
>> ==11904==    by 0x47C1CF6: XtDispatchEvent (in /usr/lib/libXt.so.6.0.0)
>> ==11904==    by 0x81415D6: xterm_update (os_unix.c:6513)
>> ==11904==    by 0x813F8A1: RealWaitForChar (os_unix.c:4969)
>> ==11904==    by 0x813F50E: WaitForChar (os_unix.c:4640)
>> ==11904==    by 0x813B53B: mch_inchar (os_unix.c:366)
>> ==11904==    by 0x81A4706: ui_inchar (ui.c:193)
>> ==11904==    by 0x80D274A: inchar (getchar.c:2959)
>> ==11904==    by 0x80D237D: vgetorpeek (getchar.c:2735)
>> ==11904==    by 0x80D0919: vgetc (getchar.c:1552)
>> ==11904==    by 0x80D0E94: safe_vgetc (getchar.c:1757)
>> ==11904==    by 0x806368A: edit (edit.c:711)
>> ==11904==    by 0x81233CC: invoke_edit (normal.c:8885)
>> ==11904==    by 0x8123372: nv_edit (normal.c:8858)
>> ==11904==    by 0x8116C54: normal_cmd (normal.c:1184)
>> ==11904==    by 0x80DE8DA: main_loop (main.c:1180)
>> ==11904==    by 0x80DE427: main (main.c:939)
>> (more errors after that)
>>
>> Does anybody else see that bug too?
>
> Perhaps you can trigger it earlier, when it's caused, by setting the
> 'writedelay' option to some value.


Setting writedelay does not change anything. It just makes
refreshing screen slower, but I see see the same problem.

But I can simplify the way to reproduce it. It happens whenever
I do a visual selection in between:
- selecting text in clipboard with the mouse
- and pasting with middle click.

Example:

1/ start vim with valgrind:   valgrind 2> valgrind.log  vim -u NONE
2/ select some text with mouse outside vim (one line is enough)
3/ enter INSERT mode in vim and type some text:   iThis is a test<Esc>
4/ visual select line typed in 3/  with:   V
5/ click middle mouse to paste text selected in 2/

Observe errors in valgrind.log right after middle mouse click in step 5/

I see this with Vim-7.2.42 (normal or huge, GTK2) on Ubuntu-8.10
as well as Vim-7.1.314 (GTK2-GNOME) on Ubuntu-8.10

I tried on 2 other machines:

- vim-7.2.42 (huge, GTK2 GUI) on  openSUSE 10.3 :  no bug
  observed, valgrind does not complain either (I tried several times)

- vim-7.2.42 (huge, GTK2 GUI) on Ubuntu-7.04 : no apparent bug
  but valgrind reports errors as soon as I paste text in step 5/

==12698== Syscall param write(buf) points to uninitialised byte(s)
==12698==    at 0x40007F2: (within /lib/ld-2.5.so)
==12698==    by 0x487A64E: _X11TransWrite (in /usr/lib/libX11.so.6.2.0)
==12698==    by 0x4872526: (within /usr/lib/libX11.so.6.2.0)
==12698==    by 0x48725FA: _XReply (in /usr/lib/libX11.so.6.2.0)
==12698==    by 0x486C5C9: XSync (in /usr/lib/libX11.so.6.2.0)
==12698==    by 0x465E211: (within /usr/lib/libXt.so.6.0.0)
==12698==    by 0x46618A4: (within /usr/lib/libXt.so.6.0.0)
==12698==    by 0x464B394: XtDispatchEventToWidget (in /usr/lib/libXt.so.6.0.0)
==12698==    by 0x464BD37: (within /usr/lib/libXt.so.6.0.0)
==12698==    by 0x464ACA6: XtDispatchEvent (in /usr/lib/libXt.so.6.0.0)
==12698==    by 0x8151C38: xterm_update (os_unix.c:6513)
==12698==    by 0x8150103: RealWaitForChar (os_unix.c:4969)
==12698==    by 0x814FE7F: WaitForChar (os_unix.c:4642)
==12698==    by 0x814BDFF: mch_inchar (os_unix.c:366)
==12698==    by 0x81B85AF: ui_inchar (ui.c:193)
==12698==    by 0x80D7DBD: inchar (getchar.c:2959)
==12698==    by 0x80D79D1: vgetorpeek (getchar.c:2735)
==12698==    by 0x80D5E73: vgetc (getchar.c:1552)
==12698==    by 0x80D63EE: safe_vgetc (getchar.c:1757)
==12698==    by 0x8064184: edit (edit.c:711)
==12698==    by 0x81328AB: invoke_edit (normal.c:8885)
==12698==    by 0x8132850: nv_edit (normal.c:8858)
==12698==    by 0x8125E7A: normal_cmd (normal.c:1184)
==12698==    by 0x80E7FD4: main_loop (main.c:1180)
==12698==    by 0x80E7B21: main (main.c:939)

So I see those valgrind errors on only 2 out of 3 machines
which is odd.  Also strange the fact that I'm on the only one
who can reproduce this.

I tried to checkout with CVS some tags older than 7.1.314
to see whether it was introduced by a patch but I see the
error on all the version I tried to check-out so far:

7.1.200 .... same error
7.1.100 .... same error
7.1.050 .... same error

-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui