git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: What's cooking in git.git (Sep 2015, #02; Wed, 9)
Date: Thu, 10 Sep 2015 05:29:23 -0400	[thread overview]
Message-ID: <20150910092922.GB6633@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqpp1r5n2d.fsf@gitster.mtv.corp.google.com>

On Wed, Sep 09, 2015 at 01:56:26PM -0700, Junio C Hamano wrote:

> * ti/glibc-stdio-mutex-from-signal-handler (2015-09-04) 1 commit
>   (merged to 'next' on 2015-09-08 at c8047ba)
>  + pager: don't use unsafe functions in signal handlers
> 
>  Allocation related functions and stdio are unsafe things to call
>  inside a signal handler, and indeed killing the pager can cause
>  glibc to deadlock waiting on allocation mutex as our signal handler
>  tries to free() some data structures in wait_for_pager().  Reduce
>  these unsafe calls.
> 
>  I seem to recall Peff had other ideas?  Let's revisit this in the
>  next cycle.

Yeah, I'm hoping to do a pass soon over all of the signal handling code,
because the problem exists elsewhere, too.  I don't mind if this makes
it into v2.6.0 and I build on top, though. It seems like an obvious
strict improvement to me.

I did wonder if we needed to deal with any fallout from f4c3edc
(vreportf: avoid intermediate buffer, 2015-08-11). That _is_ new in this
release, so regressions are fair game during the -rc period.

I don't think it should matter, though. Though it does add an fflush(), it
is replacing an existing fprintf(), and both should be taking the same
lock on stderr (so it probably _is_ still a potential problem, but not a
new one).

The predecessor commit, 3b331e9, does convert a write() into an
fprintf(), but this code path is used only in a newly-forked child
process before it execs. I think that is OK, though; we are operating on
a newly created filehandle that is not used anywhere else.

-Peff

  reply	other threads:[~2015-09-10  9:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 20:56 What's cooking in git.git (Sep 2015, #02; Wed, 9) Junio C Hamano
2015-09-10  9:29 ` Jeff King [this message]
2015-09-10 15:54   ` Junio C Hamano

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=20150910092922.GB6633@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
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).