Re: Patch 8.0.0329

2017-02-15 Fir de Conversatie Kazunobu Kuriyama
2017-02-15 6:51 GMT+09:00 Kazunobu Kuriyama :


> I'll see to them all and soon send you a patch which also addresses the
>> issue raised by Dominique.
>>
>
Hi Bram

Here is the patch.  Although this is almost the same as that I sent to
Dominique, it has been changed a little to fix a typo and improve style.

The differences are:

(1) Correction to a typo in the message argument of assert_false() in
Test_set_guifontwide().
(2) Replacement of the emptiness checks using binary operators with
empty(), except for environment variables.
(3) Replacement of the numerical incrementation using an assignment and an
arithmetic addition with the single operator +=.
(4) Skimming the scripts in testdir, I realized that the scope prefix 'l:'
is moderately used there.  Judging from the names of the local variables
used in test_gui.vim, I now think those 'l:'s are rather redundant and
hence have eliminated them from the variables.

Regards
Kazunobu

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


fix_Test_set_guifontset-update02.patch
Description: Binary data


Dead Link on vim.org

2017-02-15 Fir de Conversatie Mueller, Matthias
Hi,

There seems to be a defect link under http://www.vim.org/maillist.php#vim => 
Comments => tips archive



Follow HOB:

- HOB: http://www.hob.de/redirect/hob.html
- Xing: http://www.hob.de/redirect/xing.html
- LinkedIn: http://www.hob.de/redirect/linkedin.html
- HOBLink Mobile: http://www.hob.de/redirect/hoblinkmobile.html
- Facebook: http://www.hob.de/redirect/facebook.html
- Twitter: http://www.hob.de/redirect/twitter.html
- YouTube: http://www.hob.de/redirect/youtube.html
- E-Mail: http://www.hob.de/redirect/mail.html


HOB GmbH & Co. KG
Schwadermuehlstr. 3
D-90556 Cadolzburg

Geschaeftsfuehrung: Klaus Brandstaetter, Zoran Adamovic

AG Fuerth, HRA 5180
Steuer-Nr. 218/163/00107
USt-ID-Nr. DE 132747002

Komplementaerin HOB electronic Beteiligungs GmbH
AG Fuerth, HRB 3416

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [bug] invalid memory access with normal commands

2017-02-15 Fir de Conversatie Christian Brabandt
On Mi, 15 Feb 2017, Dominique Pellé wrote:

> Christian Brabandt wrote:
> > On Di, 14 Feb 2017, Dominique Pellé wrote:
> Your patch appears to fix the valgrind error.
> However, it's not correct. If I do...
> 
> $ echo "foo bar" | vim -u NONE -c'norm wvapo' -
> 
> ... then pressing  o  multiple times, the cursor remains
> at the beginning of the visual selection, instead of
> alternating at the beginning and at the end of the
> visual selection.

That's what I meant with "I did never notice that this is the exact same 
behaviour if you use V (e.g. only visually select a single line) and 
then press o"

Best,
Christian
-- 
Wen das Wort nicht schlägt, den schlägt auch der Stock nicht.
-- Sokrates (470-399 v.Chr.)

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.0.0329

2017-02-15 Fir de Conversatie Dominique Pellé
Kazunobu Kuriyama wrote:

> 2017-02-15 6:50 GMT+09:00 Kazunobu Kuriyama :
> 
>>
>>
>> I'll soon send you a patch which gives a useful test to both modern and
>> traditional locale-encoding systems.
>
>
> Hi Dominique
>
> Here is the patch.  Basically, it should work just like your patch does for
> your system, replacing ja_JP.eucJP with ja_JP.UTF-8.
>
> Hopefully, the attached patch could work for you.
>
> Regards,
> Kazunobu

Hi Kazunobu

All tests pass with your patch. I tried the Motif and GTK3 GUI.

Thanks.
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [bug] invalid memory access with normal commands

2017-02-15 Fir de Conversatie Dominique Pellé
Christian Brabandt wrote:

> Hi Dominique!
>
> On Di, 14 Feb 2017, Dominique Pellé wrote:
>
>> Hi
>>
>> afl-fuzz found another command that causes access to
>> invalid memory in Vim-8.0.329. It's not a recent regression
>> since bug is present in at least Vim-7.4.52 that comes
>> with ubuntu-14.04.
>>
>> I have not been able to find a fix yet.
>>
>> Step to reproduce:
>>
>> $ valgrind vim -u NONE -c'norm oxx' -c'norm vapo' -c'q!' 2>vg.log
>>
>> And vg.log contains:
>>
>> ==4259== Memcheck, a memory error detector
>> ==4259== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
>> ==4259== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright 
>> info
>> ==4259== Command: vim -u NONE -cnorm\ oxx -cnorm\ vapo -cq!
>> ==4259==
>> ==4259== Invalid read of size 1
>> ==4259==at 0x4CF4A0: utf_head_off (mbyte.c:3746)
>> ==4259==by 0x4D094C: mb_adjustpos (mbyte.c:4028)
>> ==4259==by 0x4E11C9: normal_cmd (normal.c:1292)
>> ==4259==by 0x468F25: exec_normal (ex_docmd.c:10418)
>> ==4259==by 0x469076: ex_normal (ex_docmd.c:10310)
>> ==4259==by 0x46B734: do_one_cmd (ex_docmd.c:2981)
>> ==4259==by 0x46B734: do_cmdline (ex_docmd.c:1120)
>> ==4259==by 0x5BFC2B: exe_commands (main.c:2905)
>> ==4259==by 0x5BFC2B: vim_main2 (main.c:781)
>> ==4259==by 0x40C3D3: main (main.c:415)
>> ==4259==  Address 0xa95bc50 is 0 bytes after a block of size 4,096 alloc'd
>> ==4259==at 0x4C2ABF5: malloc (vg_replace_malloc.c:299)
>> ==4259==by 0x4C4D0B: lalloc (misc2.c:942)
>> ==4259==by 0x5C0830: mf_alloc_bhdr.isra.3 (memfile.c:907)
>> ==4259==by 0x5C1546: mf_new (memfile.c:381)
>> ==4259==by 0x4AC6FF: ml_new_data (memline.c:3513)
>> ==4259==by 0x4AF0FC: ml_open (memline.c:400)
>> ==4259==by 0x414DD6: open_buffer (buffer.c:163)
>> ==4259==by 0x5BF891: create_windows (main.c:2677)
>> ==4259==by 0x5BF891: vim_main2 (main.c:704)
>> ==4259==by 0x40C3D3: main (main.c:415)
>>
>> Possibly related to this, the following command does not
>> seem to behave correctly, even if it does not trigger invalid
>> memory:
>>
>> $ echo "foo bar" | vim -u NONE -c'norm wvapo' -
>>
>> Then press  o  multiple times and observe that cursor
>> alternates between the beginning of the visual block
>> and the *middle* of the visual block.  I would expect it to
>> alternate between the beginning and the *end* of the
>> visual block.
>
> Interesting. The second issue happens, because current_par does
> internally switch to visual line mode, but does not reset the VIsual
> column correctly. This patch fixes it:
>
> diff --git a/src/search.c b/src/search.c
> index 36410e50f..ffda65837 100644
> --- a/src/search.c
> +++ b/src/search.c
> @@ -4241,6 +4241,7 @@ extend:
>  * line, we get stuck there.  Trap this here. */
> if (VIsual_mode == 'V' && start_lnum == curwin->w_cursor.lnum)
> goto extend;
> +   VIsual.col  = 0;
> VIsual.lnum = start_lnum;
> VIsual_mode = 'V';
> redraw_curbuf_later(INVERTED);  /* update the inversion */
>
> As a side effect this also disables switching cursor position using 'o'
> which is currently a no-op when only a single line is selected (since it
> effectively switches positions between the start of line and the start
> of line).
>
> Interestingly, I never noticed that this does nothing currently if a
> single visual line is selected.
>
> As it stands, I think this also fixes the invalid read mentioned above.
> I just wanted to take a look at that issue, when I noticed that this
> patch does not exhibit this behaviour, so I didn't check very closely
> why it works.
>
> I tried to add a test, to verify that this is fixed, but whatever I do,
> I always get back col 0 for the visual mode. I think this is because in
> getmark_buf_fnum() (mark.c:417) the column is explicitly set to zero for
> visual line mode and also using getpos('v') does not work, since by the
> time I run it, Visual mode is no longer active, so I cannot verify that
> this works in vimscript.

Hi Christian

Your patch appears to fix the valgrind error.
However, it's not correct. If I do...

$ echo "foo bar" | vim -u NONE -c'norm wvapo' -

... then pressing  o  multiple times, the cursor remains
at the beginning of the visual selection, instead of
alternating at the beginning and at the end of the
visual selection.

Regards
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.0.0329

2017-02-15 Fir de Conversatie Kazunobu Kuriyama
2017-02-15 6:50 GMT+09:00 Kazunobu Kuriyama :


>
> I'll soon send you a patch which gives a useful test to both modern and
> traditional locale-encoding systems.
>

Hi Dominique

Here is the patch.  Basically, it should work just like your patch does for
your system, replacing ja_JP.eucJP with ja_JP.UTF-8.

Hopefully, the attached patch could work for you.

Regards,
Kazunobu

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


fix_Test_set_guifontset-update01.patch
Description: Binary data