Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Segfault upon interrupt of completion - opinions?



On Tue, Feb 11, 2025 at 10:02 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> > Option 4: domenuselect() can be a no-op following interrupt.
>
> As long as I'm soliciting advice -- what other ZLE state could/should
> be checked here?  Possibly "resetneeded"?  Anything else?

Having dug a bit further, I think the below will probably solve the
crash -- domenuselect() needs an existing completion list from which
to build the display.

diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 5619160a9..a84f34572 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -2391,6 +2391,9 @@ domenuselect(Hookdef dummy, Chdata dat)
     char *s;
     char status[MAX_STATUS], *modeline = NULL;

+    if (! hasoldlist)
+       return 2;
+
     msearchstack = NULL;
     msearchstr = "";
     msearchstate = MS_OK;




Messages sorted by: Reverse Date, Date, Thread, Author