Daniel Hahler
unread,Nov 19, 2014, 6:40:06 PM11/19/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim...@googlegroups.com
When using `yss<p` (from vim-surround, used to surround the current line) on a
long line (~450 chars), Vim segfaults:
#0 0x00007f7067041ea7 in kill () at ../sysdeps/unix/syscall-template.S:81
#1 0x0000000000563a98 in may_core_dump () at os_unix.c:3376
#2 0x0000000000563a3c in mch_exit (r=1) at os_unix.c:3342
#3 0x000000000064bacd in getout (exitval=1) at main.c:1521
#4 0x000000000051ebe1 in preserve_exit () at misc1.c:9405
#5 0x0000000000561a01 in deathtrap (sigarg=11) at os_unix.c:1121
#6 <signal handler called>
#7 __strncpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:296
#8 0x00000000005227b4 in vim_strnsave (string=0x0, len=1732028256) at misc2.c:1268
#9 0x00000000004816cf in find_some_match (argvars=0x7fff7bd98bd0, rettv=0x7fff7bd99250, type=2) at eval.c:14349
#10 0x0000000000481c42 in f_matchstr (argvars=0x7fff7bd98bd0, rettv=0x7fff7bd99250) at eval.c:14549
#11 0x0000000000478eac in call_func (funcname=0x262ea21 "matchstr(keeper,'\\_s\\@<!\\s*$')", len=8, rettv=0x7fff7bd99250, argcount=2, argvars=0x7fff7bd98bd0,
firstline=255, lastline=255, doesrange=0x7fff7bd98d64, evaluate=1, selfdict=0x0) at eval.c:8626
#12 0x00000000004788e4 in get_func_tv (name=0x262ea21 "matchstr(keeper,'\\_s\\@<!\\s*$')", len=8, rettv=0x7fff7bd99250, arg=0x7fff7bd991f8, firstline=255,
lastline=255, doesrange=0x7fff7bd98d64, evaluate=1, selfdict=0x0) at eval.c:8433
#13 0x0000000000474082 in eval7 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1, want_string=0) at eval.c:5210
#14 0x0000000000473932 in eval6 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1, want_string=0) at eval.c:4861
#15 0x0000000000473466 in eval5 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4677
#16 0x000000000047277a in eval4 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4370
#17 0x00000000004725bd in eval3 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4282
#18 0x000000000047243c in eval2 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4211
#19 0x000000000047227b in eval1 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4136
#20 0x00000000004721da in eval0 (arg=0x262ea21 "matchstr(keeper,'\\_s\\@<!\\s*$')", rettv=0x7fff7bd99250, nextcmd=0x7fff7bd99338, evaluate=1) at eval.c:4093
#21 0x000000000046debc in ex_let (eap=0x7fff7bd99330) at eval.c:1913
#22 0x00000000004ad3a8 in do_one_cmd (cmdlinep=0x7fff7bd99450, sourcing=1, cstack=0x7fff7bd99540, fgetline=0x49323b <get_func_line>, cookie=0x22e4040)
at ex_docmd.c:2705
#23 0x00000000004aa77e in do_cmdline (cmdline=0x0, fgetline=0x49323b <get_func_line>, cookie=0x22e4040, flags=7) at ex_docmd.c:1131
#24 0x00000000004926f7 in call_user_func (fp=0x23895a0, argcount=1, argvars=0x7fff7bd99e60, rettv=0x7fff7bd9a020, firstline=255, lastline=255, selfdict=0x0)
at eval.c:23632
#25 0x0000000000478d64 in call_func (funcname=0x245c1f0 "\200\375R55_opfunc", len=12, rettv=0x7fff7bd9a020, argcount=1, argvars=0x7fff7bd99e60, firstline=255,
lastline=255, doesrange=0x7fff7bd99ff0, evaluate=1, selfdict=0x0) at eval.c:8597
#26 0x00000000004788e4 in get_func_tv (name=0x245c1f0 "\200\375R55_opfunc", len=12, rettv=0x7fff7bd9a020, arg=0x7fff7bd99ff8, firstline=255, lastline=255,
doesrange=0x7fff7bd99ff0, evaluate=1, selfdict=0x0) at eval.c:8433
#27 0x0000000000471174 in ex_call (eap=0x7fff7bd9a140) at eval.c:3505
#28 0x00000000004ad3a8 in do_one_cmd (cmdlinep=0x7fff7bd9a260, sourcing=0, cstack=0x7fff7bd9a350, fgetline=0x4c36d0 <getexline>, cookie=0x0) at ex_docmd.c:2705
#29 0x00000000004aa77e in do_cmdline (cmdline=0x0, fgetline=0x4c36d0 <getexline>, cookie=0x0, flags=0) at ex_docmd.c:1131
#30 0x000000000053c0d2 in nv_colon (cap=0x7fff7bd9a8d0) at normal.c:5330
#31 0x0000000000534b42 in normal_cmd (oap=0x7fff7bd9a970, toplevel=1) at normal.c:1160
#32 0x000000000064b7b0 in main_loop (cmdwin=0, noexmode=0) at main.c:1343
#33 0x000000000064b0c7 in main (argc=2, argv=0x7fff7bd9ac78) at main.c:1043
quit
:debug norm yss<p>
Entering Debug mode. Type "cont" to continue.
cmd: norm yss<p>
cmd: call <SNR>55_opfunc(v:count1)
line 1: let char = s:inputreplacement()
line 2: if char == ""
line 4: endif
line 5: let reg = '"'
line 6: let sel_save = &selection
line 7: let &selection = "inclusive"
line 8: let cb_save = &clipboard
line 9: set clipboard-=unnamed clipboard-=unnamedplus
line 10: let reg_save = getreg(reg)
line 11: let reg_type = getregtype(reg)
line 12: let type = a:type
line 13: if a:type == "char"
line 16: elseif a:type == "line"
line 19: elseif a:type ==# "v" || a:type ==# "V" || a:type ==# "\<C-V>"
line 27: elseif a:type =~ '^\d\+$'
line 28: let type = 'v'
line 29: exe 'norm! ^v'.a:type.'$h"'.reg.'y'
line 30: if mode() ==# 'v'
line 33: endif
line 34: else
line 39: let keeper = getreg(reg)
line 40: if type ==# "v" && a:type !=# "v"
line 41: let append = matchstr(keeper,'\_s\@<!\s*$')
Funny detail: when using `s` on `line 41`, instead of `n`, the crash will happen one statement later:
line 42: let keeper = substitute(keeper,'\_s\@<!\s*$','','')
A test file / input can be generated using:
:new
450i1<esc>
This is also related to patch 497, and happens with the latest patches (up to 525), too.