kevinhwang91 / rnvimr

Make Ranger running in a floating window to communicate with Neovim via RPC
BSD 3-Clause "New" or "Revised" License
800 stars 17 forks source link

Neovim always cores when i delete the opened file #124

Closed JohanChane closed 2 years ago

JohanChane commented 2 years ago

nvim --version:

NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

uname -a

Linux ArchLinux 5.18.16-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 03 Aug 2022 11:25:04 +0000 x86_64 GNU/Linux

nvim +'checkhealth rnvimr':


rnvimr: health#rnvimr#check
========================================================================
## OS
  - OK: Name: Linux

## Ranger
  - OK: Version: ranger 1.9.3

## Python
  - OK: Version: 3.10.5 (main, Aug  1 2022, 07:53:20) [GCC 12.1.0]

## Pynvim
  - OK: Version: 0.4.3

## Ueberzug (optional)
  - OK: Ueberzug is ready

## RPC
  - OK: RPC echo: Neovim send "Give me five!" and receive "Give me five!"

MYVIMRC:

" Make Ranger replace Netrw and be the file explorer
let g:rnvimr_enable_ex = 1

" Make Ranger to be hidden after picking a file
let g:rnvimr_enable_picker = 1

" Replace `$EDITOR` candidate with this command to open the selected file
"let g:rnvimr_edit_cmd = 'drop'

" Disable a border for floating window
let g:rnvimr_draw_border = 0

" Hide the files included in gitignore
let g:rnvimr_hide_gitignore = 1

" Change the border's color
let g:rnvimr_border_attr = {'fg': 14, 'bg': -1}

" Make Neovim wipe the buffers corresponding to the files deleted by Ranger
let g:rnvimr_enable_bw = 1

" Add a shadow window, value is equal to 100 will disable shadow
let g:rnvimr_shadow_winblend = 70

" Draw border with both
let g:rnvimr_ranger_cmd = ['ranger', '--cmd=set draw_borders both']

" Link CursorLine into RnvimrNormal highlight in the Floating window
highlight link RnvimrNormal CursorLine

nnoremap <silent> <M-r> :RnvimrToggle<CR>
tnoremap <silent> <M-r> <C-\><C-n>:RnvimrToggle<CR>

" Resize floating window by all preset layouts
"tnoremap <silent> <M-i> <C-\><C-n>:RnvimrResize<CR>

" Resize floating window by special preset layouts
"tnoremap <silent> <M-l> <C-\><C-n>:RnvimrResize 1,8,9,11,5<CR>

" Resize floating window by single preset layout
"tnoremap <silent> <M-y> <C-\><C-n>:RnvimrResize 6<CR>

" Map Rnvimr action
let g:rnvimr_action = {
            \ '<C-t>': 'NvimEdit tabedit',
            \ '<C-x>': 'NvimEdit split',
            \ '<C-v>': 'NvimEdit vsplit',
            \ 'gw': 'JumpNvimCwd',
            \ 'yw': 'EmitRangerCwd'
            \ }

" Add views for Ranger to adapt the size of floating window
let g:rnvimr_ranger_views = [
            \ {'ratio': [1,1]},
            \ ]

" Fullscreen for initial layout
let g:rnvimr_layout = {
           \ 'relative': 'editor',
           \ 'width': &columns - 9,
           \ 'height': &lines - 7,
           \ 'col': 7,
           \ 'row': 3,
           \ 'style': 'minimal'
           \ }

" Only use initial preset layout
let g:rnvimr_presets = [{}]

coredumpctl:

>>> bt
#0  0x0000558a960cfcca in winframe_remove ()
#1  0x0000558a960d09c9 in ?? ()
#2  0x0000558a960d0c02 in win_close_othertab ()
#3  0x0000558a960d3e85 in close_windows ()
#4  0x0000558a95e54582 in do_buffer ()
#5  0x0000558a95e54c78 in do_bufdel ()
#6  0x0000558a95efe769 in ?? ()
#7  0x0000558a95ef2380 in ?? ()
#8  0x0000558a95ef4815 in do_cmdline ()
#9  0x0000558a960e9485 in ?? ()
#10 0x0000558a95ea8514 in call_internal_func ()
#11 0x0000558a95ed1f34 in call_func ()
#12 0x0000558a95ed22c6 in get_func_tv ()
#13 0x0000558a95e8b82e in ?? ()
#14 0x0000558a95e8c52b in ?? ()
#15 0x0000558a95e8c960 in ?? ()
#16 0x0000558a95e8ccd3 in ?? ()
#17 0x0000558a95e8d2bb in ?? ()
#18 0x0000558a95e8d631 in ?? ()
#19 0x0000558a95e8d7f5 in eval1 ()
#20 0x0000558a95ed0ad3 in call_user_func ()
#21 0x0000558a95ed1eab in call_func ()
#22 0x0000558a95e9a099 in callback_call ()
#23 0x0000558a95e9a236 in timer_due_cb ()
#24 0x0000558a9607e878 in state_handle_k_event ()
#25 0x0000558a9609ec7a in ?? ()
#26 0x0000558a9607e6f5 in state_enter ()
#27 0x0000558a9609e62f in terminal_enter ()
#28 0x0000558a95e75656 in edit ()
#29 0x0000558a95fa9e1e in ?? ()
#30 0x0000558a9607e73f in state_enter ()
#31 0x0000558a95fa71a9 in normal_enter ()
#32 0x0000558a95dfd690 in main ()

The core behavior:

  1. open file1 (C-T)
  2. open file2 (C-T)
  3. dD file2
  4. open file1 (C-T)
kevinhwang91 commented 2 years ago

reproduced.

kevinhwang91 commented 2 years ago
#0  0x0000560b0c0509dd in frame2win (frp=0x0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/window.c:3350
#1  0x0000560b0c0502d2 in winframe_remove (win=0x560b0dd6b570, dirp=0x7ffe4ec8e55c, tp=0x560b0dbedcf0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/window.c:3143
#2  0x0000560b0c05004d in win_free_mem (win=0x560b0dd6b570, dirp=0x7ffe4ec8e55c, tp=0x560b0dbedcf0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/window.c:3058
#3  0x0000560b0c04ffca in win_close_othertab (win=0x560b0dd6b570, free_buf=0, tp=0x560b0dbedcf0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/window.c:3037
#4  0x0000560b0c04ee0d in close_windows (buf=0x560b0ded6120, keep_curwin=false) at /home/kevin/WorkSpaces/c/neovim/src/nvim/window.c:2488
#5  0x0000560b0bd66494 in do_buffer (action=4, start=1, dir=1, count=5, forceit=0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/buffer.c:1275
#6  0x0000560b0bd65add in do_bufdel (command=4, arg=0x560b0de65502 "", addr_count=1, start_bnr=1, end_bnr=5, forceit=0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/buffer.c:987
#7  0x0000560b0be1cd83 in ex_bunload (eap=0x7ffe4ec8e800) at /home/kevin/WorkSpaces/c/neovim/src/nvim/ex_docmd.c:5110
#8  0x0000560b0be14028 in execute_cmd0 (retv=0x7ffe4ec8e7b8, eap=0x7ffe4ec8e800, errormsg=0x7ffe4ec8e7d0, preview=false) at /home/kevin/WorkSpaces/c/neovim/src/nvim/ex_docmd.c:1637
#9  0x0000560b0be15e95 in do_one_cmd (cmdlinep=0x7ffe4ec8ea20, flags=10, cstack=0x7ffe4ec8eb50, fgetline=0x0, cookie=0x0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/ex_docmd.c:2286
#10 0x0000560b0be11ccc in do_cmdline (cmdline=0x560b0db47c40 "silent! bwipeout 5", fgetline=0x0, cookie=0x0, flags=10) at /home/kevin/WorkSpaces/c/neovim/src/nvim/ex_docmd.c:595
#11 0x0000560b0be11370 in do_cmdline_cmd (cmd=0x560b0db47c40 "silent! bwipeout 5") at /home/kevin/WorkSpaces/c/neovim/src/nvim/ex_docmd.c:282
#12 0x0000560b0bdcaa16 in execute_common (argvars=0x7ffe4ec8f480, rettv=0x7ffe4ec90230, fptr=0x0, arg_off=0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval/funcs.c:1929
#13 0x0000560b0bdcabc5 in f_execute (argvars=0x7ffe4ec8f480, rettv=0x7ffe4ec90230, fptr=0x0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval/funcs.c:1966
#14 0x0000560b0bdc6423 in call_internal_func (fname=0x560b0dc13150 "execute", argcount=1, argvars=0x7ffe4ec8f480, rettv=0x7ffe4ec90230) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval/funcs.c:200
#15 0x0000560b0bdee36c in call_func (funcname=0x560b0db51450 "execute", len=7, rettv=0x7ffe4ec90230, argcount_in=1, argvars_in=0x7ffe4ec8f480, funcexe=0x7ffe4ec8f640) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval/userfunc.c:1592
#16 0x0000560b0bdeb550 in get_func_tv (name=0x560b0db51450 "execute", len=7, rettv=0x7ffe4ec90230, arg=0x7ffe4ec8fb50, funcexe=0x7ffe4ec8f640) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval/userfunc.c:464
#17 0x0000560b0bda2f4a in eval_func (arg=0x7ffe4ec8fb50, name=0x560b0dd651c7 "execute('silent! bwipeout ' . join(bw_list, ' '))", name_len=7, rettv=0x7ffe4ec90230, evaluate=true, basetv=0x0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:2262
#18 0x0000560b0bda4d11 in eval7 (arg=0x7ffe4ec8fb50, rettv=0x7ffe4ec90230, evaluate=1, want_string=0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:3176
#19 0x0000560b0bda40b1 in eval6 (arg=0x7ffe4ec8fb50, rettv=0x7ffe4ec90230, evaluate=1, want_string=0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:2850
#20 0x0000560b0bda398f in eval5 (arg=0x7ffe4ec8fb50, rettv=0x7ffe4ec90230, evaluate=1) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:2675
#21 0x0000560b0bda365f in eval4 (arg=0x7ffe4ec8fb50, rettv=0x7ffe4ec90230, evaluate=1) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:2571
#22 0x0000560b0bda34af in eval3 (arg=0x7ffe4ec8fb50, rettv=0x7ffe4ec90230, evaluate=1) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:2492
#23 0x0000560b0bda3309 in eval2 (arg=0x7ffe4ec8fb50, rettv=0x7ffe4ec90230, evaluate=1) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:2423
#24 0x0000560b0bda3123 in eval1 (arg=0x7ffe4ec8fb50, rettv=0x7ffe4ec90230, evaluate=1) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:2349
#25 0x0000560b0bdecee2 in call_user_func (fp=0x560b0de112b0, argcount=1, argvars=0x7ffe4ec90240, rettv=0x7ffe4ec90230, firstline=1, lastline=1, selfdict=0x0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval/userfunc.c:1109
#26 0x0000560b0bdee2ee in call_func (funcname=0x560b0de11398 "<lambda>1", len=9, rettv=0x7ffe4ec90230, argcount_in=1, argvars_in=0x7ffe4ec90240, funcexe=0x7ffe4ec901b0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval/userfunc.c:1579
#27 0x0000560b0bdac22e in callback_call (callback=0x560b0ddac720, argcount_in=1, argvars_in=0x7ffe4ec90240, rettv=0x7ffe4ec90230) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:6000
#28 0x0000560b0bdac682 in timer_due_cb (tw=0x560b0ddac640, data=0x560b0ddac640) at /home/kevin/WorkSpaces/c/neovim/src/nvim/eval.c:6101
#29 0x0000560b0bdfde70 in time_event (argv=0x7ffe4ec902b8) at /home/kevin/WorkSpaces/c/neovim/src/nvim/event/time.c:47
#30 0x0000560b0bfe5b45 in state_handle_k_event () at /home/kevin/WorkSpaces/c/neovim/src/nvim/state.c:106
#31 0x0000560b0c000b11 in terminal_execute (state=0x7ffe4ec903b0, key=-26365) at /home/kevin/WorkSpaces/c/neovim/src/nvim/terminal.c:558
#32 0x0000560b0bfe5ad9 in state_enter (s=0x7ffe4ec903b0) at /home/kevin/WorkSpaces/c/neovim/src/nvim/state.c:88
#33 0x0000560b0c0005f5 in terminal_enter () at /home/kevin/WorkSpaces/c/neovim/src/nvim/terminal.c:449
#34 0x0000560b0bd94f3c in edit (cmdchar=105, startln=false, count=1) at /home/kevin/WorkSpaces/c/neovim/src/nvim/edit.c:1228
#35 0x0000560b0bef1749 in normal_finish_command (s=0x7ffe4ec90530) at /home/kevin/WorkSpaces/c/neovim/src/nvim/normal.c:978
#36 0x0000560b0bef1ef6 in normal_execute (state=0x7ffe4ec90530, key=58) at /home/kevin/WorkSpaces/c/neovim/src/nvim/normal.c:1170
#37 0x0000560b0bfe5ad9 in state_enter (s=0x7ffe4ec90530) at /home/kevin/WorkSpaces/c/neovim/src/nvim/state.c:88
#38 0x0000560b0bef00eb in normal_enter (cmdwin=false, noexmode=false) at /home/kevin/WorkSpaces/c/neovim/src/nvim/normal.c:466
#39 0x0000560b0be989f7 in main (argc=3, argv=0x7ffe4ec90928) at /home/kevin/WorkSpaces/c/neovim/src/nvim/main.c:581

Not interested in this upstream bug, just record the full bt.

Fix now.

JohanChane commented 2 years ago

Maybe I should new a bug issue in neovim project. Thanks!

kevinhwang91 commented 2 years ago

Maybe I should new a bug issue in neovim project. Thanks!

他们需要最小配置复现,不要勉强,你没写插件还是挺难的,别管这些费事了。

JohanChane commented 2 years ago

Neovim 打开的文件过多时,经常 core,我真的服了。core 之后原因都不同,只有这个能复现。