git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Noam Postavsky <npostavs@users.sourceforge.net>, git@vger.kernel.org
Subject: Re: [BUG] A part of an edge from an octopus merge gets colored, even with --color=never
Date: Tue, 17 May 2016 17:57:49 -0400	[thread overview]
Message-ID: <20160517215749.GB16905@sigill.intra.peff.net> (raw)
In-Reply-To: <573B78CE.1080200@kdbg.org>

On Tue, May 17, 2016 at 10:02:22PM +0200, Johannes Sixt wrote:

> > Interesting. It replicates out of the box for me.
> 
> "Out of the box" are the magic words. I usually compile with -O0, which
> doesn't trigger the valgrind report.

Heh, I meant that Noam's test worked out of the box. I also build with
-O0. I was able to replicate with different optimization levels.

I think the interesting thing here is actually the libc (and therefore
possibly your valgrind version). I tried compiling with ASAN and get a
color value of "48830". But no ASAN warning!

I think what is happening is that we over-allocate the new_columns array
based on a power of 2, but only initialize up to num_new_columns. So the
off-by-one accesses heap memory that is allocated but which we have
never written to.

> When I compile with a 3.x based gcc on Windows, I see these warnings:
> 
>     CC color.o
> color.c: In function 'color_parse_mem':
> color.c:203: warning: 'c.value' may be used uninitialized in this function
> color.c:203: warning: 'c.blue' may be used uninitialized in this function
> color.c:203: warning: 'c.green' may be used uninitialized in this function
> color.c:203: warning: 'c.red' may be used uninitialized in this function
> 
> (which triggered my curiosity in this bug report). But they seem to be
> unrelated and are most likely false positives.

Yeah, I think that's unrelated. I'd be highly distrustful of
-Wuninitialized in gcc 3.x. We had to mark quite a few false positives
back then, that were later corrected in the 4.x series.

-Peff

      reply	other threads:[~2016-05-17 21:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-15 13:05 [BUG] A part of an edge from an octopus merge gets colored, even with --color=never Noam Postavsky
2016-05-17 19:07 ` Johannes Sixt
2016-05-17 19:45   ` Jeff King
2016-05-17 19:51     ` Jeff King
2016-05-17 19:55       ` Jeff King
2016-05-20 22:12         ` Noam Postavsky
2018-06-23 21:45           ` Noam Postavsky
2018-06-25 16:23             ` Jeff King
2018-06-30 12:47               ` Noam Postavsky
2018-08-06 18:34                 ` Noam Postavsky
2018-08-06 21:28                   ` Jeff King
2018-08-06 21:26                 ` Jeff King
2018-09-02  0:34                   ` Noam Postavsky
2018-09-08 16:13                     ` Jeff King
2018-09-25  0:27                       ` Noam Postavsky
2018-10-03  0:09                         ` Noam Postavsky
2018-10-03  4:24                         ` Jeff King
2018-10-03 22:32                           ` Noam Postavsky
2018-10-09  4:51                             ` Jeff King
2018-10-10  0:42                               ` Noam Postavsky
2016-05-17 20:02     ` Johannes Sixt
2016-05-17 21:57       ` Jeff King [this message]

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=20160517215749.GB16905@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=npostavs@users.sourceforge.net \
    /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).