The attached patch fixes an E315 error that occurs for me sometimes when I work in Athena gvim under Cygwin. The stack trace when the problem occurs is as follows:
#0 ml_get_buf (buf=0x8005b6e8, lnum=124, will_change=0) at memline.c:2435
#1 0x0049a8ad in ml_get_pos (pos=0x289cb4) at memline.c:2388
#2 0x004c92be in do_pending_operator (cap=0x289c58, old_col=0,
gui_yank=1) at normal.c:1823
#3 0x004debf5 in clip_get_selection (cbd=0x5e7b40) at ops.c:5924
#4 0x0055b8a8 in clip_x11_convert_selection_cb (w=0x80071588,
sel_atom=0x28a1ec, target=0x289ddc,
type=0x289df0, value=0x289dfc, length=0x289df8, format=0x289df4)
at ui.c:2307
#5 0x69a2170e in cygXt-6!_
XtResourceListInitialize () from /usr/bin/cygXt-6.dll
#6 0x69a21bd3 in cygXt-6!_XtResourceListInitialize () from /usr/bin/cygXt-6.dll
#7 0x69a0e8f0 in cygXt-6!XtDispatchEventToWidget () from /usr/bin/cygXt-6.dll
#8 0x69a0ecc1 in cygXt-6!_XtOnGrabList () from /usr/bin/cygXt-6.dll
#9 0x69a0f0d6 in cygXt-6!XtDispatchEvent () from /usr/bin/cygXt-6.dll
#10 0x69a1973d in cygXt-6!XtAppProcessEvent () from /usr/bin/cygXt-6.dll
#11 0x00578bfb in gui_mch_update () at gui_x11.c:2828
#12 0x00558e8b in ui_breakcheck () at ui.c:364
#13 0x004b53a9 in fast_breakcheck () at misc1.c:9187
#14 0x00502532 in regmatch (scan=0x8005cf2f "\005") at regexp.c:4077
#15 0x005022c6 in regtry (prog=0x8005cf08, col=1) at regexp.c:3945
#16 0x005020d8 in vim_regexec_both (line=0x80194a96 "#include
<speex/speex_jitter.h>", col=1, tm=0x0)
at regexp.c:3834
#17 0x00501be5 in vim_regexec_multi (rmp=0x28a4c0, win=0x8029c220,
buf=0x8005b6e8, lnum=5, col=0,
tm=0x0) at regexp.c:3643
#18 0x00542f33 in syn_regexec (rmp=0x28a4c0, lnum=5, col=0) at syntax.c:3238
#19 0x005411ea in syn_current_attr (syncing=0, displaying=1,
can_spell=0x0, keep_state=0)
at syntax.c:2071
#20 0x00540bf6 in get_syntax_attr (col=0, can_spell=0x0, keep_state=0)
at syntax.c:1830
#21 0x0050dee8 in win_line (wp=0x8029c220, lnum=5, startrow=4,
endrow=64, nochange=1) at screen.c:4090
#22 0x0050a075 in win_update (wp=0x8029c220) at screen.c:1861
#23 0x00507fa8 in update_screen (type=40) at screen.c:536
#24 0x00507ac6 in update_curbuf (type=20) at screen.c:314
#25 0x0058e30a in main_loop (cmdwin=0, noexmode=0) at main.c:1209
#26 0x0058df72 in main (argc=3, argv=0x28ac60) at main.c:1014
What happens is while the screen is being updated, vim_regexec_multi()
temporarily replaces the value of curbuf and proceeds with a call to
vim_regexec_both(). Since regmatch() can take a long time to complete,
it can be interrupted by pressing Ctrl-C. For this to be possible, Vim
handles pending UI events. Among these events is a request to get the
current selection. This is where the contents of curbuf are accessed
with coordinates taken from curwin. Since vim_regexec_multi() replaced
the value of curbuf, the data pointed to by curbuf is inconsistent
with the data pointed to by curwin. This can cause the E315 error.
Cheers,
Lech
--
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
ml_get_buf-failure
Description: Binary data
