git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What's cooking in git.git (Sep 2015, #02; Wed, 9)

From
Jeff King <peff@peff.net>
Date
Sep 10, 2015, 09:29 UTC
Message-ID
<20150910092922.GB6633@sigill.intra.peff.net>
In-Reply-To
<xmqqpp1r5n2d.fsf@gitster.mtv.corp.google.com>
On Wed, Sep 09, 2015 at 01:56:26PM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> * 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 3 in “What's cooking in git.git (Sep 2015, #02; Wed, 9)”
  1. Junio C HamanoSep 9, 2015
  2. Jeff KingSep 10, 2015
  3. Junio C HamanoSep 10, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.