vis
vis copied to clipboard
Crashes because vis->mode is NULL in vis_run()
Hello. I found vis crashes when I do the following action:
- Open vis
- Enter ":vsp" and then Tab; the Ex line expands to some file path
- Press Esc and then enter ":vsplit", then press Enter; the Ex line still expands to the same file path
- Press Enter again, it will crash. Based on the core dump file, it crashes at line 1394 of file vis.c. The reason is that vis->mode points to NULL.
Here is the output of GDB. It has something with the interaction of lua. Not sure how to further debug.
(gdb) continue Continuing. Detaching after fork from child process 1146. Detaching after fork from child process 1150.
Program received signal SIGSEGV, Segmentation fault. 0x00007f0de6d1663f in vis_index (L=0x7f0de830b5a8) at vis-lua.c:1382 1382 lua_pushunsigned(L, vis->mode->id); (gdb) bt #0 0x00007f0de6d1663f in vis_index (L=0x7f0de830b5a8) at vis-lua.c:1382 #1 0x00007f0de6d25241 in luaD_precall () #2 0x00007f0de6d25503 in luaD_call () #3 0x00007f0de6d2e02c in luaT_callTM () #4 0x00007f0de6d307b0 in luaV_execute () #5 0x00007f0de6d2550f in luaD_call () #6 0x00007f0de6d25561 in luaD_callnoyield () #7 0x00007f0de6d249af in luaD_rawrunprotected () #8 0x00007f0de6d2584d in luaD_pcall () #9 0x00007f0de6d22d4e in lua_pcallk () #10 0x00007f0de6d136f4 in pcall (vis=0x7f0de82d1a00, L=0x7f0de830b5a8, nargs=1, nresults=0) at vis-lua.c:259 #11 0x00007f0de6d1a460 in vis_lua_win_status (vis=0x7f0de82d1a00, win=0x7f0de8558920) at vis-lua.c:2986 #12 0x00007f0de6d0b564 in vis_event_emit (vis=0x7f0de82d1a00, id=VIS_EVENT_WIN_STATUS) at vis.c:93 #13 0x00007f0de6d0cb8f in vis_window_draw (win=0x7f0de8558920) at vis.c:445 #14 0x00007f0de6d046aa in ui_window_draw (w=0x7f0de853abb0) at ui-terminal.c:247 #15 0x00007f0de6d04f45 in ui_draw (ui=0x7f0de82d1500) at ui-terminal.c:353 #16 0x00007f0de6d0d3de in vis_update (vis=0x7f0de82d1a00) at vis.c:563 #17 0x00007f0de6d1092b in vis_run (vis=0x7f0de82d1a00) at vis.c:1369 #18 0x00007f0de6cef9ff in main (argc=1, argv=0x7ffffa700608) at main.c:2453
This is a good change to fix a stability issue. It would be great if the change could be merged. Thanks a lot.