Subject: bug#71073: Emacs segfaults if corfu is asked to autocomplete something while the LSP server providing completions is still starting/indexing

From: Eli Zaretskii <[email-masked]>
Date: Mon, 20 May 2024 14:02:12 +0300

> Date: Sun, 19 May 2024 19:58:23 +0000
> From:  alexis purslane via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> If corfu is prompted to start autocompletion (by typing the first 3
> letters of a word in my case) while an eglot LSP server is still
> starting up, but after eglot has connected to that server, you get a
> segmentation fault.
> 
> ## Steps to reproduce
> 
> 1. Open a file with a mode associated with it that has a language server
> 2. {M-x eglot}
> 3. Before the server has finished indexing and can provide completions,
>    but after it has connected, prompt corfu to do an autocompletion
> 4. Enjoy your segfault salad
> 
> ## Debug information
> 
> Here's the backtrace from the core dump:

Thanks, but this backtrace is less useful than it could be.  If you
can run Emacs from GDB, please do that, and when it segfaults and GDB
shows its prompt, type

  (gdb) thread apply all bt

and post here everything GDB produces as result.