Hi Pablo
Could you send a minimalistic script which reproduces the problem.
Make sure the script sets all required options so it can be started
by something like "$ vim -u NONE -S bug.vim" to make sure it does
not depend on your ~/.vimrc or ~/.vim files.
Cheers
-- Dominique
Hi Dominique,
I have removed most of the junk and left the muscle of my script. The script gets called by the CursorHold time-out. On my _vimrc i set ut=950, so the script gets called about once per sec.
~ 40 HIGHLIGHT commands
time 60 calls per minute
time 60 minutes per hour
= around 144000 calls to HIGHLIGHT per hour.
I try running this with $ gvim -u NONE -S bug.vim and it seems to run without errors. Sorry for the flickering, not sure why this is happening. Have not tried running this for an hour yet.
I will let you know if I can make the 'bug' more reproducable(? spelling?)
Thanks a lot, guys!!
Pablo.
--
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
My eyes! My eyes!
I tried you script and it works fine here (nvidia card).
$ gvim bug.vim
:so %<cr>
I ran the script twice, once with a maximized gvim (slow), and another
with a smaller sized gvim (faster).
Both works fine.
nazri.
Also fine here, using Gvim 7.3.14 under Gentoo Linux, after bumping the
number of iterations to 10,000.
But, running the test under Win7 showed the bug. There, under Vim 7.3e
beta, after approximately 2500 iterations, I started seeing:
E235: Unknown font: Fixedsys:h9:cDEFAULT
So, maybe some kind of font structure is getting allocated and not freed
when unused? (Possibly because there's no way to know it's unused?)
Either way, this script triggers the same error, but I'm not sure it's
the whole cause:
==> minimal.highlight.bug.vim <==
for i in range(50000)
highlight Normal guifg=#ffffff
endfor
=================================
Doesn't look nearly as dramatic. Adding the redraw at the end of the
loop is what causes the flashes.
Run via:
gvim.exe -u NONE -N +'syntax on' +'source %' /path/to/minimal.highlight.bug.vim
Or, if you want to see the message (since the GUI becomes unreadable
after the font goes missing -- though it seems to gradually return to
near-normal):
gvim.exe -u NONE -N +'syntax on' +'source %' +'redir! > ~/vim.error.msg' +'silent! messages' +'redir END' +'q!' /path/to/minimal.highlight.bug.vim
--
Best,
Ben
I see that on Windows XP with Vim 7.2.284 after approximately 20000
iterations. But what is really weird is, that the whole gui is broken
afterwards. The window is not redrawn correctly afterwards and when typing
the letters appear in the root window (e.g. it looks like I am typing
on the Desktop of Windows itsself) and all different artifacts are drawn
on the screen. Even after quitting vim, I still see some artifacts.
Very weird.
>
> So, maybe some kind of font structure is getting allocated and not freed
> when unused? (Possibly because there's no way to know it's unused?)
>
> Either way, this script triggers the same error, but I'm not sure it's
> the whole cause:
>
> ==> minimal.highlight.bug.vim <==
> for i in range(50000)
> highlight Normal guifg=#ffffff
> endfor
That triggers the same bug, but does not error the message.
> =================================
>
> Doesn't look nearly as dramatic. Adding the redraw at the end of the
> loop is what causes the flashes.
>
> Run via:
>
> gvim.exe -u NONE -N +'syntax on' +'source %'
> /path/to/minimal.highlight.bug.vim
>
> Or, if you want to see the message (since the GUI becomes unreadable
> after the font goes missing -- though it seems to gradually return to
> near-normal):
>
> gvim.exe -u NONE -N +'syntax on' +'source %' +'redir! > ~/vim.error.msg'
> +'silent! messages' +'redir END' +'q!' /path/to/minimal.highlight.bug.vim
That triggers the same but, but I don't see the error message in the
redirected file.
regards,
Christian
> I see that on Windows XP with Vim 7.2.284 after approximately 20000
> iterations. But what is really weird is, that the whole gui is broken
> afterwards. The window is not redrawn correctly afterwards and when typing
> the letters appear in the root window (e.g. it looks like I am typing
> on the Desktop of Windows itsself) and all different artifacts are drawn
> on the screen. Even after quitting vim, I still see some artifacts.
> Very weird.
It's not weird, these are symptoms of the same problem: Vim leaks GUI resources
(you can enable monitoring of GDI objects in task manager and see them
increasing until they reach 10000). Apparently Vim creates new font for each
iteration and does not destroy created fonts.
2010/10/12 Tue 15:46:39 UTC+9 Sergey Khorev:
I think I found the cause of this resource leak problem.
The leak occurs in hl_do_font() (syntax.c).
Attached patch fixes the problem. I tested it on Windows 7 and
bug.vim worked fine.
(Sorry if I posted this message twice.)
Best regards,
Ken Takata
2012/10/19 Fri 10:08:26 UTC+9 Tony Mechelynck:
> Hm... Isn't a similar addition necessary for the fontset case, before
> line 8086?
I'm not sure because the fontset case isn't used on Windows,
but it seems necessary. I have updated the patch.
Can anyone test this patch on Linux or other OS?
Best regards,
Ken Takata