neovim/runtime/doc
Justin M. Keyes f6e19e7334
fix(logging): skip recursion, fix crash #18764
Problem:
1. The main log routine does not protect itself against recursion.
   log_lock() doesn't guard against recursion, it would deadlock...
2. 22b52dd462 (#11501) regressed 6f27f5ef91 (#10172), because
   set_init_1..process_spawn tries to log (see backtrace below), but the
   mutex isn't initialized yet. Even if the mutex were valid, we don't
   want early logging to fallback to stderr because that can break
   embedders when stdio is used for RPC.

    frame 1: 0x00000001001d54f4 nvim`open_log_file at log.c:205:7
    frame 2: 0x00000001001d5390 nvim`logmsg(log_level=1, context="UI: ", func_name=0x0000000000000000, line_num=-1, eol=true, fmt="win_viewport") at log.c:150:20
    frame : 0x000000010039aea2 nvim`ui_call_win_viewport(grid=2, win=1000, topline=0, botline=1, curline=0, curcol=0, line_count=1) at ui_events_call.generated.h:321:3
    frame 4: 0x00000001003dfefc nvim`ui_ext_win_viewport(wp=0x0000000101816400) at window.c:939:5
    frame 5: 0x00000001003ec5b4 nvim`win_ui_flush at window.c:7303:7
    frame 6: 0x00000001003a04c0 nvim`ui_flush at ui.c:508:3
    frame 7: 0x00000001002966ba nvim`do_os_system(argv=0x0000600000c0c000, input=0x0000000000000000, len=0, output=0x0000000000000000, nread=0x00007ff7bfefe830, silent=false, forward_output=false) at shell.c:894:3
    frame 8: 0x0000000100295f68 nvim`os_call_shell(cmd="unset nonomatch; vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >/var/folders/gk/3tttv_md06987tlwpyp62jrw0000gn/T/nvimwwvwfD/0 ~foo", opts=kShellOptExpand | kShellOptSilent | kShellOptHideMess, extra_args=0x0000000000000000) at shell.c:663:18
    frame 9: 0x0000000100295845 nvim`call_shell(cmd="unset nonomatch; vimglob() { while [ $# -ge 1 ]; do echo \"$1\"; shift; done }; vimglob >/var/folders/gk/3tttv_md06987tlwpyp62jrw0000gn/T/nvimwwvwfD/0 ~foo", opts=kShellOptExpand | kShellOptSilent | kShellOptHideMess, extra_shell_arg=0x0000000000000000) at shell.c:712:14
    frame 10: 0x0000000100294c6f nvim`os_expand_wildcards(num_pat=1, pat=0x00007ff7bfefeb20, num_file=0x00007ff7bfefee58, file=0x00007ff7bfefee60, flags=43) at shell.c:328:7
    ...
    frame 23: 0x000000010028ccef nvim`expand_env_esc(srcp=",~foo", dst="~foo", dstlen=4094, esc=false, one=false, prefix=0x0000000000000000) at env.c:673:17
    frame 24: 0x000000010026fdd5 nvim`option_expand(opt_idx=29, val=",~foo") at option.c:1950:3
    frame 25: 0x000000010026f129 nvim`set_init_1(clean_arg=false) at option.c:558:19
    frame 26: 0x00000001001ea25e nvim`early_init(paramp=0x00007ff7bfeff5f0) at main.c:198:3
    frame 27: 0x00000001001ea6bf nvim`main(argc=1, argv=0x00007ff7bfeff848) at main.c:255:3

Solution:
1. Check for recursion, show "internal error" message.
    - FUTURE: when "remote TUI" is merged, can we remove log_lock()?
2. Skip logging if log_init wasn't called yet.
2022-05-30 13:07:33 -07:00
..
api.txt feat(nvim_create_user_command): pass structured modifiers to commands 2022-05-29 10:52:30 +06:00
arabic.txt feat: add support for global statusline 2022-03-18 00:21:41 +06:00
autocmd.txt vim-patch:75ab590f8504 (#18170) 2022-04-19 15:14:17 +02:00
builtin.txt vim-patch:partial 2d8ed0203aed (#18675) 2022-05-23 23:49:38 +02:00
change.txt vim-patch:8.2.4907: some users do not want a line comment always inserted (#18463) 2022-05-07 16:49:36 +02:00
channel.txt vim-patch:partial 1588bc8ebee2 (#17657) 2022-03-09 08:44:28 +01:00
cmdline.txt refactor!: delete insertmode (#18547) 2022-05-22 21:20:18 -06:00
debug.txt
deprecated.txt feat(lsp): add filter to vim.lsp.get_active_clients() 2022-05-18 11:21:00 -06:00
dev_style.txt build(clint): remove redundant checks #18698 2022-05-22 10:59:56 -07:00
develop.txt docs: update dev-api to include "create" 2022-04-10 20:45:17 -06:00
diagnostic.txt build(lua2dox): add parenthesis around parameter types in documentation (#18532) 2022-05-12 08:02:46 -06:00
diff.txt vim-patch:c51cf0329809 (#17530) 2022-02-27 11:56:30 +01:00
digraph.txt vim-patch:8.2.3226: new digraph functions use old naming scheme 2022-04-12 21:26:46 +08:00
editing.txt vim-patch:75ab590f8504 (#18170) 2022-04-19 15:14:17 +02:00
eval.txt refactor!: delete insertmode (#18547) 2022-05-22 21:20:18 -06:00
filetype.txt vim-patch:ce001a337e28 (#18287) 2022-04-27 17:48:35 +02:00
fold.txt vim-patch:c51cf0329809 (#17530) 2022-02-27 11:56:30 +01:00
ft_ada.txt vim-patch:47c532e2bc55 (#17780) 2022-03-20 10:48:10 +01:00
ft_ps1.txt vim-patch:4d8f476176ea (#15612) 2021-09-10 08:48:27 +02:00
ft_raku.txt vim-patch:c51cf0329809 (#17530) 2022-02-27 11:56:30 +01:00
ft_rust.txt vim-patch:c51cf0329809 (#17530) 2022-02-27 11:56:30 +01:00
ft_sql.txt vim-patch:partial:cbaff5e06ec5 (#18044) 2022-04-08 22:40:56 +02:00
gui.txt refactor!: delete insertmode (#18547) 2022-05-22 21:20:18 -06:00
hebrew.txt
help.txt vim-patch:8.2.3917: the eval.txt help file is way too big 2022-01-29 15:19:29 -05:00
helphelp.txt docs(helphelp): remove extra backtick interference (#17201) 2022-01-27 14:56:18 +01:00
if_cscop.txt vim-patch:2f0936cb9a2e (#17007) 2022-01-11 14:14:17 +01:00
if_perl.txt vim-patch:8.1.0735: cannot handle binary data 2021-09-15 21:19:22 +01:00
if_pyth.txt vim-patch:c51cf0329809 (#17530) 2022-02-27 11:56:30 +01:00
if_ruby.txt doc: remove mentions of compile-time flags #14935 2021-07-07 18:51:40 -07:00
indent.txt vim-patch:8.2.4702: C++ scope labels are hard-coded 2022-04-09 15:39:46 +02:00
index.txt refactor!: delete insertmode (#18547) 2022-05-22 21:20:18 -06:00
insert.txt refactor!: delete insertmode (#18547) 2022-05-22 21:20:18 -06:00
intro.txt refactor!: delete insertmode (#18547) 2022-05-22 21:20:18 -06:00
job_control.txt fix(doc): various fixes #15604 2021-09-09 00:37:59 -07:00
lsp-extension.txt chore: fix typos (#16816) 2022-01-04 11:07:40 -07:00
lsp.txt feat(lsp): turn rename filter into a predicate (#18745) 2022-05-26 12:28:50 +02:00
lua.txt feat(lua): allow some viml functions to run in fast 2022-05-17 10:29:33 +01:00
Makefile
makehtml.awk
maketags.awk
map.txt refactor!: remove 'remap' option 2022-05-19 00:15:36 +02:00
mbyte.txt vim-patch:2f0936cb9a2e (#17007) 2022-01-11 14:14:17 +01:00
message.txt chore: fix typos (#17755) 2022-03-25 19:57:59 +01:00
mlang.txt Merge pull request #14403 from seandewar/vim-8.2.1933 2021-05-09 17:08:21 -04:00
motion.txt vim-patch:75ab590f8504 (#18170) 2022-04-19 15:14:17 +02:00
nvim_terminal_emulator.txt vim-patch:8.2.5010: the terminal debugger uses various global variables 2022-05-26 07:47:00 +08:00
nvim.txt
options.txt docs(options): move all removed options to vim_diff.txt (#18770) 2022-05-28 16:42:56 +08:00
pattern.txt feat(defaults): search selection by * and # in visual mode (#18538) 2022-05-13 08:28:10 +08:00
pi_gzip.txt
pi_health.txt fix(checkhealth): mitigate issues with duplicate healthchecks #15919 2021-10-05 15:37:39 -07:00
pi_msgpack.txt chore: typo fixes (#16921) 2022-01-29 23:15:22 +00:00
pi_netrw.txt vim-patch:partial:cbaff5e06ec5 (#18044) 2022-04-08 22:40:56 +02:00
pi_paren.txt
pi_spec.txt
pi_tar.txt
pi_tutor.txt
pi_zip.txt vim-patch:519cc559b08b (#16340) 2021-11-17 10:02:59 +01:00
print.txt vim-patch:c51cf0329809 (#17530) 2022-02-27 11:56:30 +01:00
provider.txt feat(provider)!: remove support for python2 and python3.[3-5] 2022-01-29 19:49:37 +01:00
quickfix.txt vim-patch:8.1.1015: quickfix buffer shows up in list, can't get buffer number 2022-03-13 13:17:28 +08:00
quickref.txt refactor!: delete insertmode (#18547) 2022-05-22 21:20:18 -06:00
recover.txt refactor: remove cpo-& behavior (#17745) 2022-03-23 19:52:50 +08:00
remote_plugin.txt
remote.txt chore: fix typos (#17670) 2022-03-17 13:21:24 +08:00
repeat.txt feat(test): use nvim_exec in helpers.source() #16064 2022-03-27 10:25:55 -07:00
rileft.txt vim-patch:4d8f476176ea (#15612) 2021-09-10 08:48:27 +02:00
russian.txt doc: remove mentions of compile-time flags #14935 2021-07-07 18:51:40 -07:00
scroll.txt
sign.txt vim-patch:c51cf0329809 (#17530) 2022-02-27 11:56:30 +01:00
spell.txt vim-patch:c51cf0329809 (#17530) 2022-02-27 11:56:30 +01:00
starting.txt fix(logging): skip recursion, fix crash #18764 2022-05-30 13:07:33 -07:00
syntax.txt vim-patch:partial 2d8ed0203aed (#18675) 2022-05-23 23:49:38 +02:00
tabpage.txt vim-patch:8.2.1401: cannot jump to the last used tabpage 2022-03-14 13:10:57 +00:00
tagsrch.txt vim-patch:47c532e2bc55 (#17780) 2022-03-20 10:48:10 +01:00
term.txt feat(tui): query terminal for CSI u support (#18181) 2022-04-25 20:49:45 -06:00
testing.txt chore: typo fixes (#16921) 2022-01-29 23:15:22 +00:00
tips.txt vim-patch:c51cf0329809 (#17530) 2022-02-27 11:56:30 +01:00
treesitter.txt fix(treesitter): offset directive associates range with capture (#18276) 2022-05-28 19:22:18 +02:00
uganda.txt vim-patch:partial 1588bc8ebee2 (#17657) 2022-03-09 08:44:28 +01:00
ui.txt feat(api/ui): win_extmarks 2022-05-03 22:26:02 +08:00
undo.txt feat: add undo! 2022-04-20 00:10:02 +06:00
usr_01.txt
usr_02.txt vim-patch:4c295027a426 2021-05-02 13:00:38 -04:00
usr_03.txt vim-patch:82be4849eed0 2021-05-01 23:19:57 -04:00
usr_04.txt docs: update explanation of Y to reflect new defaults 2022-02-24 18:13:44 +08:00
usr_05.txt docs: syntax is enabled by default (#17637) 2022-05-01 13:31:49 +02:00
usr_06.txt docs: syntax is enabled by default (#17637) 2022-05-01 13:31:49 +02:00
usr_07.txt docs: update explanation of Y to reflect new defaults 2022-02-24 18:13:44 +08:00
usr_08.txt feat: add support for global statusline 2022-03-18 00:21:41 +06:00
usr_09.txt vim-patch:d2ea7cf10a4d #15571 2021-09-08 07:24:12 -07:00
usr_10.txt docs: update explanation of Y to reflect new defaults 2022-02-24 18:13:44 +08:00
usr_11.txt vim-patch:cb80aa2d53e5 2021-05-01 22:29:02 -04:00
usr_12.txt vim-patch:11e3c5ba8203 2021-05-02 12:53:49 -04:00
usr_20.txt vim-patch:88a4205f1cfb (#16399) 2021-11-22 10:53:57 +01:00
usr_21.txt feat(defaults): session data in $XDG_STATE_HOME #15583 2022-05-12 07:13:45 -07:00
usr_22.txt vim-patch:8.1.1291: not easy to change directory and restore 2021-10-17 22:04:53 +08:00
usr_23.txt vim-patch:4072ba571bab 2021-05-01 22:29:03 -04:00
usr_24.txt
usr_25.txt
usr_26.txt
usr_27.txt
usr_28.txt
usr_29.txt vim-patch:47c532e2bc55 (#17780) 2022-03-20 10:48:10 +01:00
usr_30.txt vim-patch:e7b1ea0276cc 2021-04-29 20:42:16 -04:00
usr_31.txt vim-patch:e7b1ea0276cc 2021-04-29 20:42:16 -04:00
usr_32.txt
usr_40.txt vim-patch:e7b1ea0276cc 2021-04-29 20:42:16 -04:00
usr_41.txt feat: cmdline funcs (#18284) 2022-05-09 12:52:31 +08:00
usr_42.txt docs: fix some remanining cases of gender pronoun for "the user" 2021-05-18 22:47:17 +02:00
usr_43.txt
usr_44.txt
usr_45.txt doc: remove mentions of compile-time flags #14935 2021-07-07 18:51:40 -07:00
usr_toc.txt docs(usr_05): fix section numbers (#16886) 2022-01-03 14:52:01 +01:00
various.txt refactor!: delete insertmode (#18547) 2022-05-22 21:20:18 -06:00
vi_diff.txt vim-patch:98a29d00a48e 2021-05-01 23:19:57 -04:00
vim_diff.txt docs(options): move all removed options to vim_diff.txt (#18770) 2022-05-28 16:42:56 +08:00
visual.txt vim-patch:8.2.4881: "P" in Visual mode still changes some registers (#18445) 2022-05-06 19:26:28 +08:00
windows.txt vim-patch:partial:3f32a5f1601a (#18555) 2022-05-13 15:20:58 +02:00