zsh-workers
 help / color / mirror / code / Atom feed
From: Kamil Dudka <kdudka@redhat.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: PATCH Re: deadlock in free() called from a signal handler
Date: Mon, 23 Feb 2015 15:15:22 +0100	[thread overview]
Message-ID: <2067297.ZNlDuaAVYz@kdudka.brq.redhat.com> (raw)
In-Reply-To: <150220182812.ZM11805@torch.brasslantern.com>

On Friday 20 February 2015 18:28:12 Bart Schaefer wrote:
> On Feb 19,  9:23am, Bart Schaefer wrote:
> }
> } In every case I can remember so far, when this happens it means that we
> } ought to be using the signal queuing macros at a scope outside the call
> } to the malloc library.
> }  [...]
> } So ... per my very first remark above, it's probably worth examining the
> } context in execcmd() to see if signal queuing is appropriate there, or
> } if we just need it in setunderscore().  But it may also make sense to
> } replace that one last malloc() and put queuing in zfree()/zsfree() too.
> 
> (Above edited for silly typo.)
> 
> There doesn't appear to be an appropriate scope for queuing signals in
> execcmd().  However, setunderscore() and all of the functions in text.c
> manipulate global state, so they should be considered non-reentrant.
> 
> The following patch does not yet put signal queuing into zfree(), but
> does wrap it around setunderscore() and the three non-static functions
> in text.c, as well as replace that one remaining malloc() with zalloc().
> Hopefully this doesn't slow down execution noticeably.

Thank you for the patch!  We will give it a try.

Kamil


      reply	other threads:[~2015-02-23 14:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-19 11:06 Kamil Dudka
2015-02-19 17:23 ` Bart Schaefer
2015-02-21  2:28   ` PATCH " Bart Schaefer
2015-02-23 14:15     ` Kamil Dudka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2067297.ZNlDuaAVYz@kdudka.brq.redhat.com \
    --to=kdudka@redhat.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).