Repository: neovim
Issue: crash in msgmore .. ui_comp_raw_line
Labels: bug,ui,needs:repro,has:backtrace,bug-crash,messages

### Problem

- Crash sometimes happens when closing a fugitive `:G` status window.
- Has been an issue for ~1 year, not related to recent changes.

```
Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	    0x7ff81cdf100e __pthread_kill + 10
1   libsystem_pthread.dylib       	    0x7ff81ce271ff pthread_kill + 263
2   libsystem_c.dylib             	    0x7ff81cd72d24 abort + 123
3   libsystem_c.dylib             	    0x7ff81cd720cb __assert_rtn + 314
4   nvim                          	       0x10eb8eb24 ui_comp_raw_line + 692
5   nvim                          	       0x10eb8a621 ui_line + 161
6   nvim                          	       0x10ea1f8fd msg_scroll_flush + 477
7   nvim                          	       0x10eb8a9c7 ui_flush + 359
8   nvim                          	       0x10e998f4c inchar + 684
9   nvim                          	       0x10e99e7f4 vgetorpeek + 8020
10  nvim                          	       0x10ea1bc8a msgmore + 106
11  nvim                          	       0x10ea5341c op_delete + 4428
12  nvim                          	       0x10e95fc68 ex_operators + 312
13  nvim                          	       0x10e9598fd execute_cmd0 + 221
14  nvim                          	       0x10e954470 do_one_cmd + 9056
15  nvim                          	       0x10e9510f1 do_cmdline + 4001
16  nvim                          	       0x10e928461 call_func + 6465
17  nvim                          	       0x10e9269da get_func_tv + 538
18  nvim                          	       0x10e92ed22 ex_call + 978
19  nvim                          	       0x10e9598fd execute_cmd0 + 221
20  nvim                          	       0x10e954470 do_one_cmd + 9056
21  nvim                          	       0x10e9510f1 do_cmdline + 4001
22  nvim                          	       0x10e928461 call_func + 6465
23  nvim                          	       0x10e9269da get_func_tv + 538
24  nvim                          	       0x10e8ef606 eval_func + 614
25  nvim                          	       0x10e8ed80a eval7 + 2026
26  nvim                          	       0x10e8ecc52 eval6 + 50
27  nvim                          	       0x10e8ec604 eval5 + 52
28  nvim                          	       0x10e8ec27d eval4 + 45
29  nvim                          	       0x10e8ec021 eval3 + 49
30  nvim                          	       0x10e8de3f1 eval2 + 49
31  nvim                          	       0x10e8db92d eval1 + 45
32  nvim                          	       0x10e8e88b0 ex_execute + 160
33  nvim                          	       0x10e9598fd execute_cmd0 + 221
34  nvim                          	       0x10e954470 do_one_cmd + 9056
35  nvim                          	       0x10e9510f1 do_cmdline + 4001
36  nvim                          	       0x10e928461 call_func + 6465
37  nvim                          	       0x10e9269da get_func_tv + 538
38  nvim                          	       0x10e92ed22 ex_call + 978
39  nvim                          	       0x10e9598fd execute_cmd0 + 221
40  nvim                          	       0x10e954470 do_one_cmd + 9056
41  nvim                          	       0x10e9510f1 do_cmdline + 4001
42  nvim                          	       0x10e928461 call_func + 6465
43  nvim                          	       0x10e9269da get_func_tv + 538
44  nvim                          	       0x10e92ed22 ex_call + 978
45  nvim                          	       0x10e9598fd execute_cmd0 + 221
46  nvim                          	       0x10e954470 do_one_cmd + 9056
47  nvim                          	       0x10e9510f1 do_cmdline + 4001
48  nvim                          	       0x10e928461 call_func + 6465
49  nvim                          	       0x10e9269da get_func_tv + 538
50  nvim                          	       0x10e92ed22 ex_call + 978
51  nvim                          	       0x10e9598fd execute_cmd0 + 221
52  nvim                          	       0x10e954470 do_one_cmd + 9056
53  nvim                          	       0x10e9510f1 do_cmdline + 4001
54  nvim                          	       0x10e928461 call_func + 6465
55  nvim                          	       0x10e9294ab func_call + 347
56  nvim                          	       0x10e9020c5 f_call + 213
57  nvim                          	       0x10e927a7e call_func + 3934
58  nvim                          	       0x10e9269da get_func_tv + 538
59  nvim                          	       0x10e92ed22 ex_call + 978
60  nvim                          	       0x10e9598fd execute_cmd0 + 221
61  nvim                          	       0x10e954470 do_one_cmd + 9056
62  nvim                          	       0x10e9510f1 do_cmdline + 4001
63  nvim                          	       0x10e928461 call_func + 6465
64  nvim                          	       0x10e9269da get_func_tv + 538
65  nvim                          	       0x10e92ed22 ex_call + 978
66  nvim                          	       0x10e9598fd execute_cmd0 + 221
67  nvim                          	       0x10e954470 do_one_cmd + 9056
68  nvim                          	       0x10e9510f1 do_cmdline + 4001
69  nvim                          	       0x10e8e8b9b ex_execute + 907
70  nvim                          	       0x10e9598fd execute_cmd0 + 221
71  nvim                          	       0x10e954470 do_one_cmd + 9056
72  nvim                          	       0x10e9510f1 do_cmdline + 4001
73  nvim                          	       0x10eb9bc9b do_ucmd + 3307
74  nvim                          	       0x10e959997 execute_cmd0 + 375
75  nvim                          	       0x10e954470 do_one_cmd + 9056
76  nvim                          	       0x10e9510f1 do_cmdline + 4001
77  nvim                          	       0x10ea4104d nv_colon + 669
78  nvim                          	       0x10ea3d0fd normal_execute + 9373
79  nvim                          	       0x10eb45ad9 state_enter + 121
80  nvim                          	       0x10e81104b main + 17675
81  dyld                          	       0x10f8a652e start + 462
``` 

### Steps to reproduce

1. have some windows open
2. have `:G` status window open from https://github.com/tpope/vim-fugitive
3. `ZQ` to close the window the fugitive status window

I don't have more precise steps because the crash is inconsistent.

Always happens with `ZQ` on the fugitive status window, never other windows. Possibly an autocmd? Though looks related to `msgmore` trying to show something...

### Expected behavior

no crash

### Neovim version (nvim -v)

NVIM v0.9.0-dev-1216+g 673d2b52fa43

### Vim (not Nvim) behaves the same?

no

### Operating system/version

macos

### Terminal name/version

Terminal.app

### $TERM environment variable

screen-256color

### Installation

source