Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Segfault upon interrupt of completion - opinions?
- X-seq: zsh-workers 53355
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Segfault upon interrupt of completion - opinions?
- Date: Sat, 8 Feb 2025 13:08:44 -0800
- Archived-at: <https://zsh.org/workers/53355>
- List-id: <zsh-workers.zsh.org>
Looking into the report from Tomasz Pala, valgrind reveals a memory
access error here:
==91356== Invalid read of size 8
==91356== at 0x246CCB: domenuselect (complist.c:2487)
==91356== by 0x194267: runhookdef (module.c:1001)
==91356== by 0x22737D: after_complete (compcore.c:518)
==91356== by 0x1942D8: runhookdef (module.c:1007)
==91356== by 0x27B0F2: docomplete (zle_tricky.c:878)
The question is where is the right place to address this.
Option 1: zle_tricky.c:878 should not run the after-hooks on interrupt.
Option 2: runhookdef() should not run any hooks if there's been an
interrupt. This probably has wide-reaching side effects, so doesn't
seem viable?
Option 3: Every hook function has to make its own decision about
interrupts. We can fix this specific case in after_complete().
The segmentation fault doesn't always happen (in fact it's pretty
difficult to make it happen without mucking with zle in an INT trap),
but because entry into menu selection is implemented as an after-hook,
failing to check for interrupts here influences the other behaviors
Tomasz has noted in other threads. (I'm not confident that checking
this interrupt would result in the behavior that Tomasz wants, but I
think it would at least improve consistency.)
Thoughts?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author