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

Re: [BUG] malloc inside signal handler



I just found this in my spam folder.

On Sat, Jul 31, 2021 at 1:25 PM zsugabubus
<zsugabubus@national.shitposting.agency> wrote:
>
> shingetline() calls winch_unblock() and dont_queue_signals() so fgetc()
> can be interrupted at any time.

Hm.  I'm not sure what we can do about this, except to stop using
stdio, because we have to be able to react to window size changes
while blocked waiting for input (that would be the most common time
for a window to be resized).  Maybe there's something sneaky we can do
with read_poll() so that we don't call fgetc() until it's guaranteed
to return something, and then we could hold signals again around the
actual fgetc() call.

Or maybe shingetline() doesn't actually need to call winch_unblock()
when loop(0,...) is called and isatty(bshin) is false ... which means
passing the value of toplevel down from loop().  But that probably
just fixes adjustwinsize() and leaves other signal handlers
unprotected.




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