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

Re: Breakage (?) in configure and git_vsnprintf()

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Dec 12, 2011, 10:25 UTC
Message-ID
<4EE5D694.7040407@alum.mit.edu>
In-Reply-To
<20111212064305.GA16511@sigill.intra.peff.net>
On 12/12/2011 07:43 AM, Jeff King wrote:
Show 12 quoted lines
> On Sun, Dec 11, 2011 at 07:42:03PM +0100, Michael Haggerty wrote:
>> 2. The configure problem causes git_vsnprintf() to be wrapped around the
>> C library version.  This leads to many failures in the test suite.  I
>> suppose that git_vsnprintf() is broken in some way.
> 
> I enabled SNPRINTF_RETURNS_BOGUS manually and was able to see the test
> suite failures. Very oddly, I could get them while running the full
> suite in parallel, but when I ran individual scripts, the problem went
> away. Which makes no sense to me at all.
> 
> However, I peeked at the git_vsnprintf function, and one obvious error
> is that it calls vsnprintf multiple times on the same va_list.

Thanks for the quick response! Yes, I think you've hit the nail on the head. (Though I think Andreas is correct that va_end() needs to be called on the copies.) Either with or without va_end(), your patch fixes the test suite failures for me.

> I'll leave the issue of "-std=c89" triggering SNPRINTF_RETURNS_BOGUS to
> people who know and care about autoconf. My gut is to say "don't do
> that". Git is not actually pure c89. [...]

OK, I can live with that. Poor Junio will probably be stuck correcting my non-c89isms again, though :-(

Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Brandon CaseyNext: Jonathan Nieder
Message 9 of 10 in “Breakage (?) in configure and git_vsnprintf()”
  1. Michael HaggertyDec 11, 2011
  2. Jeff KingDec 12, 2011
  3. Johannes SixtDec 12, 2011
  4. Jeff KingDec 12, 2011
  5. Junio C HamanoDec 12, 2011
  6. Andreas SchwabDec 12, 2011
  7. Jeff KingDec 12, 2011
  8. Brandon CaseyDec 12, 2011
  9. Michael HaggertyDec 12, 2011
  10. Jonathan NiederDec 12, 2011

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.