I discovered stack overflow in WIN32 builds of VIm. Repeatability is 100%
Here is scenario:
1) start vim
2) set enc option to for example iso-8859-2.
3) vim crash
Attached os_win32.c.diff patch contains patch that fixes previously
mentioned stack overflow .This is caused by loading of iconv library.
Loading mechanism calls functions that utilises encoding conversion,
and these functions load iconv library again, because it is not loaded
yet.
Attached Make_mvc.mak.diff contains patch file that adds version of
nmake that is distributed with Visual studio 6 service pack 6.
On Wednesday, September 12, 2012 4:03:46 PM UTC-5, Jiri Sedlak wrote:
> Hello,
> I discovered stack overflow in WIN32 builds of VIm. Repeatability is 100%
> Here is scenario:
> 1) start vim
> 2) set enc option to for example iso-8859-2.
> 3) vim crash
Reproduced in 7.3.646, which I was doubtful of, because my .vimrc contains "set encoding=utf-8" and I've never seen a crash because of it. In the past I've also set the encoding to cp1252 and others without problems.
But setting it to iso-8859-2 causes Vim to terminate with no warning or dialog popping up on the very next keystroke (which in my case happened to be ':', because I was attempting to type ":set enc?").
Codepages are not re-coded by iconv but by MultiByteToWideChar
function. So if you set cp... the iconv library is not loaded.
SO was introduced in VIm7.3.034 so it is realy long time ago. But I
needed open file in iso-8859-2 coding on Monday, so I came across it.
Regards
JiriS
On 12 September 2012 23:53, Ben Fritz <fritzophre...@gmail.com> wrote:
> On Wednesday, September 12, 2012 4:03:46 PM UTC-5, Jiri Sedlak wrote:
>> Hello,
>> I discovered stack overflow in WIN32 builds of VIm. Repeatability is 100%
>> Here is scenario:
>> 1) start vim
>> 2) set enc option to for example iso-8859-2.
>> 3) vim crash
> Reproduced in 7.3.646, which I was doubtful of, because my .vimrc contains "set encoding=utf-8" and I've never seen a crash because of it. In the past I've also set the encoding to cp1252 and others without problems.
> But setting it to iso-8859-2 causes Vim to terminate with no warning or dialog popping up on the very next keystroke (which in my case happened to be ':', because I was attempting to type ":set enc?").
> I haven't tried the patch.
> --
> 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
четверг, 13 сентября 2012 г., 10:05:16 UTC+4 пользователь Jiri Sedlak написал:
> Hello,
> Codepages are not re-coded by iconv but by MultiByteToWideChar
> function. So if you set cp... the iconv library is not loaded.
> SO was introduced in VIm7.3.034 so it is realy long time ago. But I
> needed open file in iso-8859-2 coding on Monday, so I came across it.
You must not be using this option for opening files with particular encoding, you corrupt any existing non-ASCII string already loaded in memory that way. There are enough pointers to a correct way of opening a file in “:h 'encoding'”.
On Thursday, September 13, 2012 9:51:24 AM UTC-5, ZyX wrote:
> четверг, 13 сентября 2012 г., 10:05:16 UTC+4 пользователь Jiri Sedlak написал:
> > Hello,
> > Codepages are not re-coded by iconv but by MultiByteToWideChar
> > function. So if you set cp... the iconv library is not loaded.
> > SO was introduced in VIm7.3.034 so it is realy long time ago. But I
> > needed open file in iso-8859-2 coding on Monday, so I came across it.
> You must not be using this option for opening files with particular encoding, you corrupt any existing non-ASCII string already loaded in memory that way. There are enough pointers to a correct way of opening a file in “:h 'encoding'”.
Regardless, Vim should not crash. When I reproduced it, the "set encoding" command was the first thing done in a configuration-less Vim.
On Thursday, September 13, 2012 9:54:02 AM UTC-5, Ben Fritz wrote:
> On Thursday, September 13, 2012 9:51:24 AM UTC-5, ZyX wrote:
> > четверг, 13 сентября 2012 г., 10:05:16 UTC+4 пользователь Jiri Sedlak написал:
> > > Hello,
> > > Codepages are not re-coded by iconv but by MultiByteToWideChar
> > > function. So if you set cp... the iconv library is not loaded.
> > > SO was introduced in VIm7.3.034 so it is realy long time ago. But I
> > > needed open file in iso-8859-2 coding on Monday, so I came across it.
> > You must not be using this option for opening files with particular encoding, you corrupt any existing non-ASCII string already loaded in memory that way. There are enough pointers to a correct way of opening a file in “:h 'encoding'”.
> Regardless, Vim should not crash. When I reproduced it, the "set encoding" command was the first thing done in a configuration-less Vim.
:set enc=utf-8
:call mkdir("\u1234") " Create directory with unicode character
:cd <U+1234> " which is not contained current codepage.
:pwd
C:\Users\yukihiro\tmp\<U+1234>
:call libcall('a.dll', 'b', 'c') " No need existing dll for this test.
E364: Library call failed for "b()"
:pwd
C:\Users\yukihiro\tmp\vim\src " Directory is changed.
On Sun, Sep 16, 2012 at 10:50 AM, Ken Takata <ken...@csc.jp> wrote:
> 2012/09/16 Sun 8:12:34 UTC+9 Yukihiro Nakadaira:
>> This patch doesn't work for unicode path.