Re: glibc mutex deadlock in signal handler

2015-09-05 Thread Jeff King
On Fri, Sep 04, 2015 at 02:56:58PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Perhaps we should reconsider whether f4c3edc (vreportf: avoid > > intermediate buffer, 2015-08-11) is a good idea. Note that snprintf is > > not on the list of safe functions, but I imagine

Re: glibc mutex deadlock in signal handler

2015-09-04 Thread Takashi Iwai
On Fri, 04 Sep 2015 11:23:55 +0200, Jeff King wrote: > > On Fri, Sep 04, 2015 at 07:52:21AM +0200, Takashi Iwai wrote: > > > -- 8< -- > > From: Takashi Iwai > > Subject: [PATCH] pager: don't use unsafe functions in signal handlers > > > > Since the commit [a3da8821208d: pager:

Re: glibc mutex deadlock in signal handler

2015-09-04 Thread Jeff King
On Fri, Sep 04, 2015 at 07:52:21AM +0200, Takashi Iwai wrote: > -- 8< -- > From: Takashi Iwai > Subject: [PATCH] pager: don't use unsafe functions in signal handlers > > Since the commit [a3da8821208d: pager: do wait_for_pager on signal > death], we call wait_for_pager() in the

Re: glibc mutex deadlock in signal handler

2015-09-04 Thread Takashi Iwai
On Fri, 04 Sep 2015 15:04:48 +0200, Jeff King wrote: > > On Fri, Sep 04, 2015 at 11:35:57AM +0200, Takashi Iwai wrote: > > > > Hmm, is there is any reason to just pass an "in_signal" flag to > > > wait_for_pager(), to avoid duplicating the logic? > > > > Just because wait_for_pager() itself is

Re: glibc mutex deadlock in signal handler

2015-09-04 Thread Jeff King
On Fri, Sep 04, 2015 at 11:35:57AM +0200, Takashi Iwai wrote: > > Hmm, is there is any reason to just pass an "in_signal" flag to > > wait_for_pager(), to avoid duplicating the logic? > > Just because wait_for_pager() itself is an atexit hook that can't take > an argument, so we'd need to split

Re: glibc mutex deadlock in signal handler

2015-09-04 Thread Junio C Hamano
Jeff King writes: > Perhaps we should reconsider whether f4c3edc (vreportf: avoid > intermediate buffer, 2015-08-11) is a good idea. Note that snprintf is > not on the list of safe functions, but I imagine that in practice it is > fine. Though just avoiding error()/warning() in

Re: glibc mutex deadlock in signal handler

2015-09-03 Thread Junio C Hamano
Takashi Iwai writes: > we've got a bug report of git-log stall in below: > https://bugzilla.opensuse.org/show_bug.cgi?id=942297 > > In short, git-log is left unterminated sometimes when pager is > aborted. When this happens, git process can't be killed by SIGTERM, > but only by

Re: glibc mutex deadlock in signal handler

2015-09-03 Thread Takashi Iwai
On Thu, 03 Sep 2015 20:12:38 +0200, Junio C Hamano wrote: > > Takashi Iwai writes: > > > we've got a bug report of git-log stall in below: > > https://bugzilla.opensuse.org/show_bug.cgi?id=942297 > > > > In short, git-log is left unterminated sometimes when pager is > >

Re: glibc mutex deadlock in signal handler

2015-09-03 Thread Andreas Schwab
See for the complete list of functions you may safely call from a signal handler. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5

Re: glibc mutex deadlock in signal handler

2015-09-03 Thread Takashi Iwai
On Thu, 03 Sep 2015 22:55:52 +0200, Andreas Schwab wrote: > > See > > for the complete list of functions you may safely call from a signal > handler. Thanks, this looks more comprehensive. FWIW, below is the