[bug] invalid memory access with invalid utf8

2015-04-20 Fir de Conversatie Dominique Pellé
Hi

vim-7.4.703 accesses invalid memory when doing:

  $ vim -E -u NONE -c 'call search(getline(.))' crash

... where 'crash' is the attached file (16 bytes).

Asan (address sanitizer) reports:

==27746== ERROR: AddressSanitizer: heap-buffer-overflow on address
0x60620001af00 at pc 0x625f1d bp 0x7ffdd32cbb50 sp 0x7ffdd32cbb48
READ of size 1 at 0x60620001af00 thread T0
#0 0x625f1c in utf_ptr2char /home/pel/sb/vim/src/mbyte.c:1696
#1 0x706a2c in find_match_text
/home/pel/sb/vim/src/regexp_nfa.c:5389 (discriminator 1)
#2 0x70eda9 in nfa_regexec_both /home/pel/sb/vim/src/regexp_nfa.c:7070
#3 0x70f8bb in nfa_regexec_multi /home/pel/sb/vim/src/regexp_nfa.c:7298
#4 0x7101bd in vim_regexec_multi /home/pel/sb/vim/src/regexp.c:8274
#5 0x741aa4 in searchit /home/pel/sb/vim/src/search.c:639
#6 0x4956d3 in search_cmn /home/pel/sb/vim/src/eval.c:16365
#7 0x495f70 in f_search /home/pel/sb/vim/src/eval.c:16515
#8 0x4799f1 in call_func /home/pel/sb/vim/src/eval.c:8760
#9 0x478a71 in get_func_tv /home/pel/sb/vim/src/eval.c:8560
#10 0x4662e1 in ex_call /home/pel/sb/vim/src/eval.c:3505
#11 0x4f71b0 in do_one_cmd /home/pel/sb/vim/src/ex_docmd.c:2940
#12 0x4edf74 in do_cmdline /home/pel/sb/vim/src/ex_docmd.c:1133
#13 0x4ecf39 in do_cmdline_cmd /home/pel/sb/vim/src/ex_docmd.c:738
#14 0x84c849 in exe_commands /home/pel/sb/vim/src/main.c:2922
#15 0x8469dd in main /home/pel/sb/vim/src/main.c:958
#16 0x7fc8f5c1bec4 in __libc_start_main
/build/buildd/eglibc-2.19/csu/libc-start.c:287
#17 0x405b18 in _start ??:?
0x60620001af00 is located 0 bytes to the right of 4096-byte region
[0x606200019f00,0x60620001af00)
allocated by thread T0 here:
#0 0x7fc8f76f841a in malloc ??:?
#1 0x604823 in lalloc /home/pel/sb/vim/src/misc2.c:926
#2 0x6045e3 in alloc /home/pel/sb/vim/src/misc2.c:821
#3 0x8580b9 in mf_alloc_bhdr /home/pel/sb/vim/src/memfile.c:952
#4 0x8564cf in mf_new /home/pel/sb/vim/src/memfile.c:392 (discriminator 1)
#5 0x5baa13 in ml_new_data /home/pel/sb/vim/src/memline.c:3545
#6 0x5abe82 in ml_open /home/pel/sb/vim/src/memline.c:408
#7 0x405d6e in open_buffer /home/pel/sb/vim/src/buffer.c:98
#8 0x84bd88 in create_windows /home/pel/sb/vim/src/main.c:2692
#9 0x8466ac in main /home/pel/sb/vim/src/main.c:881
#10 0x7fc8f5c1bec4 in __libc_start_main
/build/buildd/eglibc-2.19/csu/libc-start.c:287
Shadow bytes around the buggy address:
  0x0c0cbfffb590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c0cbfffb5a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c0cbfffb5b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c0cbfffb5c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c0cbfffb5d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=0x0c0cbfffb5e0:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0cbfffb5f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0cbfffb600: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0cbfffb610: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c0cbfffb620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c0cbfffb630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone: fa
  Heap righ redzone: fb
  Freed Heap region: fd
  Stack left redzone:f1
  Stack mid redzone: f2
  Stack right redzone:   f3
  Stack partial redzone: f4
  Stack after return:f5
  Stack use after scope: f8
  Global redzone:f9
  Global init order: f6
  Poisoned by user:  f7
  ASan internal: fe
==27746== ABORTING

Bug was found by using a fuzzer:
'american fuzzy lop' (http://lcamtuf.coredump.cx/afl/).

Sorry, no patch. Not sure how to fix it.

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.


crash
Description: Binary data


Re: Bug Report: If gui=bold is not present in hi StatusLine, the status line does not render a background color.

2015-04-20 Fir de Conversatie Roland Eggner
Hi Christian!

On 2015-04-20 Monday at 10:38 +0200 Christian Brabandt wrote:
 Am 2015-04-20 09:24, schrieb Bidit Mazumder:
  If gui=bold is not present in the hi StatusLine of the active
  color scheme, then the status line does not render a background color.
  
  I don't know if this is a Vim issue or a MacVim issue.
 
 Does this happen only in the Gui version or also in the terminal 
 version?  Could you check? On my current Windows Gui, I can't seem to 
 replicate this problem.

Maybe patch 7.4.682 matters for this problem?

-- 
Roland Eggner

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


pgp0R87o9qrgA.pgp
Description: PGP signature


Re: Lua 5.3 detection on Windows using Vim 7.4.691

2015-04-20 Fir de Conversatie Andrei Olsen
On Monday, April 20, 2015 at 3:31:09 PM UTC+2, tux. wrote:
 Am 2015-04-19 18:53, schrieb Claudia Hardman:
 
  Tested with tuxproject 7.4.699 x64, and also with precompiled 7.4.691
  x64 from
  [veegee](https://bintray.com/veegee/generic/vim_x64/view#files),
  platform Windows 7. Lua 5.3 and 5.2, respectively are not detected,
  tests for lua return same results as noted by Pedro.
 
 So we can assume Lua (and Ruby?) integration for x64 is broken upstream?

Dynamic Lua 5.3 seems to be broken. Static seems to be okay. Lua 5.2 works 
fine. Tested with the above mentioned gvim builds.

Regarding Ruby, Ruby 2.2.x would need this patch:
https://groups.google.com/forum/#!topic/vim_dev/36I2nxOEUGk

-- 
-- 
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 Report: If gui=bold is not present in hi StatusLine, the status line does not render a background color.

2015-04-20 Fir de Conversatie Manuel Ortega
On Mon, Apr 20, 2015 at 10:56 PM, Roland Eggner ed...@systemanalysen.net
wrote:

 Hi Christian!

 On 2015-04-20 Monday at 10:38 +0200 Christian Brabandt wrote:
  Am 2015-04-20 09:24, schrieb Bidit Mazumder:
   If gui=bold is not present in the hi StatusLine of the active
   color scheme, then the status line does not render a background color.
  
   I don't know if this is a Vim issue or a MacVim issue.
 
  Does this happen only in the Gui version or also in the terminal
  version?  Could you check? On my current Windows Gui, I can't seem to
  replicate this problem.

 Maybe patch 7.4.682 matters for this problem?


It might, but MacVim doesn't have that patch level yet.

-Manny

-- 
-- 
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: Lua 5.3 detection on Windows using Vim 7.4.691

2015-04-20 Fir de Conversatie zeug

Am 2015-04-19 18:53, schrieb Claudia Hardman:


Tested with tuxproject 7.4.699 x64, and also with precompiled 7.4.691
x64 from
[veegee](https://bintray.com/veegee/generic/vim_x64/view#files),
platform Windows 7. Lua 5.3 and 5.2, respectively are not detected,
tests for lua return same results as noted by Pedro.


So we can assume Lua (and Ruby?) integration for x64 is broken upstream?

Is anyone confident enough to fix it? I received three bug reports last 
week for the tuxproject builds, all of them complaining about Lua. :-/


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


Bug Report: If gui=bold is not present in hi StatusLine, the status line does not render a background color.

2015-04-20 Fir de Conversatie Bidit Mazumder
If gui=bold is not present in the hi StatusLine of the active color scheme, 
then the status line does not render a background color.

I don't know if this is a Vim issue or a MacVim issue.

-- 
-- 
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 Report: If gui=bold is not present in hi StatusLine, the status line does not render a background color.

2015-04-20 Fir de Conversatie Christian Brabandt

Am 2015-04-20 09:24, schrieb Bidit Mazumder:

If gui=bold is not present in the hi StatusLine of the active
color scheme, then the status line does not render a background color.

I don't know if this is a Vim issue or a MacVim issue.


Does this happen only in the Gui version or also in the terminal 
version?
Could you check? On my current Windows Gui, I can't seem to replicate 
this

problem.

Best,
Christian

--
--
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 Report: If gui=bold is not present in hi StatusLine, the status line does not render a background color.

2015-04-20 Fir de Conversatie Bidit Mazumder
On Monday, April 20, 2015 at 11:39:03 AM UTC+3, Christian Brabandt wrote:
 Am 2015-04-20 09:24, schrieb Bidit Mazumder:
  If gui=bold is not present in the hi StatusLine of the active
  color scheme, then the status line does not render a background color.
  
  I don't know if this is a Vim issue or a MacVim issue.
 
 Does this happen only in the Gui version or also in the terminal 
 version?
 Could you check? On my current Windows Gui, I can't seem to replicate 
 this
 problem.
 
 Best,
 Christian

Hi Christian,

The bug is present only in the GUI version; Terminal version is fine. It might 
be a MacVim only issue.

-- 
-- 
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 Report: If gui=bold is not present in hi StatusLine, the status line does not render a background color.

2015-04-20 Fir de Conversatie Manuel Ortega
On Mon, Apr 20, 2015 at 3:24 AM, Bidit Mazumder bidit.mazum...@gmail.com
wrote:

 If gui=bold is not present in the hi StatusLine of the active color
 scheme, then the status line does not render a background color.

 I don't know if this is a Vim issue or a MacVim issue.


It's neither.  I can't reproduce in MacVim, with any of my colorschemes.

-Manny

-- 
-- 
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: expand(%) and utf-8 characters in directory names

2015-04-20 Fir de Conversatie Christian Brabandt

 Am 2015-04-20 18:28, schrieb Charles Campbell:

I've attached a small tarball illustrating the problem I'm having with
expand().

gunzip jose.tar.gz
tar xf jose.tar
cd josé
vi junk.vim
:so %
:echo x[4]
:echo y[4]

With the first echo, you'll see (using utf-8 for encoding)  e9.  This
is the hex code for a é.  The second echo shows c3.

:echo x

shows /jose9/junk.vim

:echo y

shows /josé/junk.vim

This problem has some definitely unwanted effects.  At least one person
redid their home directory's name to avoid the accent, because netrw
won't display it correctly (or use it correctly) because of this bug.


That is an encoding issue. The 'é' in your tar archive is latin1 encoded
while your Vim tries to read it as utf-8. BTW: How does the shell
display it? Somehow the shell should know the encoding, so you might
check the output of the locale command and try to use iconv() like this:
iconv(expand(%:p), 'latin1', 'utf-8')

BTW: There is a patch in the todo list, that should fix that issue.
Search for 'systemencoding'

Best,
Christian

--
--
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: expand(%) and utf-8 characters in directory names

2015-04-20 Fir de Conversatie Charles Campbell
Charles Campbell wrote:
 Christian Brabandt wrote:
 Hi Charles!

 On Fr, 27 Mär 2015, Charles Campbell wrote:

 Bram Moolenaar wrote:
 Charles Campbell wrote:

 I tried a directory named josé and found that netrw wasn't handling it
 well.  One of the reasons is expand(%), which is used to get the full
 path.  However, when in that directory, expand(%) shows
 /home/cec/joee9 instead of the desired /home/cec/josé .  Do I need to
 program around this or is this problem a bug with expand()?
 I don't see this problem.  What is 'encoding' set to?

 enc is utf-8.  By bisection of my .vimrc, I find that the following is
 enough in a .vimrc to cause the e9 to appear instead of é


 set nocp
 filetype plugin on
 set enc=utf-8
 In what filetype did you execute the expand() call?

 The filetype: netrw

 Try having a directory called josé with a file therein called one.

 vim -u (whatever you called the vimrc above)
 :echo expand(%:p)

 You'll see something like /home/cec/jose9/one

 With this, there's no filetype involved.

Hello!

I've attached a small tarball illustrating the problem I'm having with
expand().

gunzip jose.tar.gz
tar xf jose.tar
cd josé
vi junk.vim
:so %
:echo x[4]
:echo y[4]

With the first echo, you'll see (using utf-8 for encoding)  e9.  This
is the hex code for a é.  The second echo shows c3. 

:echo x

shows /jose9/junk.vim

:echo y

shows /josé/junk.vim

This problem has some definitely unwanted effects.  At least one person
redid their home directory's name to avoid the accent, because netrw
won't display it correctly (or use it correctly) because of this bug.

Regards,
Chip Campbell

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


jose.tar.gz
Description: GNU Zip compressed data