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

Re: Fwd: coverity problems in reftable code

From
Jeff King <peff@peff.net>
Date
Dec 8, 2021, 19:12 UTC
Message-ID
<YbEDnfZgeQZp6JJj@coredump.intra.peff.net>
In-Reply-To
<CAFQ2z_NUCj00981oQiswaYTK6iJ=HuPjNGP46tLL-RGL2xHbEw@mail.gmail.com>
On Wed, Dec 08, 2021 at 11:50:16AM +0100, Han-Wen Nienhuys wrote:
Show 5 quoted lines
> > Summary is below, but I'm not sure it's that useful without the whole
> > code flow. The unreachable-code one seems just wrong. We can get there
> > via the "goto done" in the BLOCK_TYPE_LOG conditional, it looks like.
> 
> they're all valid. There is a shadowed variable in the unreachable code one.
Ah, good catch. Yes, that is definitely the problem.
Show 7 quoted lines
> > The first FORWARD_NULL doesn't look obvious to me from the code. But it
> > triggers a segfault running "test-tool reftable". (It didn't immediately
> > for me on Linux, but Windows CI shows it, and compiling with ASan on
> > Linux does too).
> 
> yeah, that must be the problem on windows too. The 3rd test case
> passes NULL into memcmp() with a 0 length.

Ah, makes sense. I didn't look closely, but that would explain perfectly why it fails on some platforms but not others.

> I've folded in your patch and fixed the issues.
Thanks!
-Peff
Previous: Han-Wen Nienhuys
Message 7 of 7 in “coverity problems in reftable code”
  1. Jeff KingDec 4, 2021
  2. Fwd: coverity problems in reftable codeHan-Wen Nienhuys, Dec 7, 2021
  3. Ævar Arnfjörð BjarmasonDec 7, 2021
  4. Jeff KingDec 8, 2021
  5. Jeff KingDec 8, 2021
  6. Han-Wen NienhuysDec 8, 2021
  7. Jeff KingDec 8, 2021

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.