Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

打开一个py文件文件后, 同时打开.vimrc后进行编辑,多次保存w后, vim容易出现:vim: caught deadly signal segv死机。 #430

Closed
hawkinchina opened this issue Dec 18, 2019 · 4 comments

Comments

@hawkinchina
Copy link
Contributor

hawkinchina commented Dec 18, 2019

打开一个py文件文件后, 同时打开.vimrc后进行编辑,多次进行保存w后,
vim容易出现:vim: caught deadly signal segv死机。

the detail debug information:
~/.vimrc" 1667L, 55220C [w]Process 28119 stopped

thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x4610)
frame #0: 0x00007fff7ef14232 libsystem_c.dylibstrlen + 18 libsystem_c.dylibstrlen:
-> 0x7fff7ef14232 <+18>: pcmpeqb (%rdi), %xmm0
0x7fff7ef14236 <+22>: pmovmskb %xmm0, %esi
0x7fff7ef1423a <+26>: andq $0xf, %rcx
0x7fff7ef1423e <+30>: orq $-0x1, %rax
Target 0: (vim) stopped.
(lldb)
(lldb) bt

thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x4610)
frame #0: 0x00007fff7ef14232 libsystem_c.dylibstrlen + 18 frame #1: 0x00000001000b72b9 vimvim_strsave + 18
frame #2: 0x000000010004f3a1 vimset_vim_var_string + 86 frame #3: 0x00000001001cb197 vimemsg_core + 239
frame #4: 0x0000000100062faa vimdo_cmdline + 11646 frame #5: 0x000000010017d2ab vimcall_func + 4122
frame #6: 0x000000010017c1dc vimget_func_tv + 422 frame #7: 0x00000001001806a4 vimex_call + 720
frame #8: 0x0000000100062a19 vimdo_cmdline + 10221 frame #9: 0x0000000100008dda vimapply_autocmds_group + 1423
frame #10: 0x0000000100009654 vimapply_autocmds_exarg + 29 frame #11: 0x0000000100192b02 vimbuf_write + 12812
frame #12: 0x0000000100057788 vimdo_write + 869 frame #13: 0x0000000100068849 vimex_exit + 145
frame #14: 0x0000000100062a19 vimdo_cmdline + 10221 frame #15: 0x00000001000c9494 vimnv_colon + 120
frame #16: 0x00000001000c5769 vimnormal_cmd + 3885 frame #17: 0x00000001001c81e1 vimmain_loop + 1527
frame #18: 0x00000001001c7913 vimvim_main2 + 3291 frame #19: 0x00000001001c6745 vimmain + 5937
frame #20: 0x00007fff7eec4015 libdyld.dylib`start + 1
(lldb)

经过查明; 确认是leaderf的自动命令导致此问题。
image

@Yggdroot
Copy link
Owner

打开一个py文件文件后, 同时打开.vimrc后进行编辑,保存退出wq后

编辑的是.vimrc还是py文件,wq还是wqa?只退出当前的还是退出vim?

我现在没有环境复现,能否帮忙调试一下。缩小范围看看是mru的autocmd还是gtags的autocmd。

如果是gtags的,有没有启用g:Lf_GtagsAutoGenerate?
或者说对应的目录($HOME/.LfCache/gtags/%PATH%OF%YOUR%PROJECT/)下有没有生成gtags数据库?

@hawkinchina
Copy link
Contributor Author

hawkinchina commented Dec 18, 2019

LeaderF/autoload/leaderf/python/leaderf/gtagsExpl.py :
lines: 458 - 461请直接注释(注释后, 下面的return语句注意对齐,左移一下); 在Python线程里访问vim的变量了,导致cash.

      if not filename.startswith(root):
    #     if self._has_nvim:
    #         vim.async_call(lfCmd, "let g:Lf_Debug_Gtags = '%s'" % escQuote(str((filename, root))))
    #     else:
    #         lfCmd("let g:Lf_Debug_Gtags = '%s'" % escQuote(str((filename, root))))
          return

image

@Yggdroot
Copy link
Owner

LeaderF/autoload/leaderf/python/leaderf/gtagsExpl.py :
lines: 457 - 462请直接注释; 在Python线程里访问vim的变量了,导致cash.

    # if not filename.startswith(root):
    #     if self._has_nvim:
    #         vim.async_call(lfCmd, "let g:Lf_Debug_Gtags = '%s'" % escQuote(str((filename, root))))
    #     else:
    #         lfCmd("let g:Lf_Debug_Gtags = '%s'" % escQuote(str((filename, root))))
    #     return

注释多了,

if not filename.startswith(root):
    return

还是需要的

@hawkinchina hawkinchina changed the title 打开一个py文件文件后, 同时打开.vimrc后进行编辑,保存退出wq后, vim容易出现:vim: caught deadly signal segv死机。 打开一个py文件文件后, 同时打开.vimrc后进行编辑,多次保存w后, vim容易出现:vim: caught deadly signal segv死机。 Dec 18, 2019
@hawkinchina
Copy link
Contributor Author

hawkinchina commented Dec 18, 2019

the code is already merged into master branch. close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants