From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/5] Makefile: add helper for compiling with -fsanitize
Date: Mon, 10 Jul 2017 13:44:54 -0400 [thread overview]
Message-ID: <20170710174454.jbkednmzwts7yr7z@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqefto6vqb.fsf@gitster.mtv.corp.google.com>
On Mon, Jul 10, 2017 at 10:35:24AM -0700, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > You can already build and test with ASan by doing:
> >
> > make CFLAGS=-fsanitize=address test
> >
> > but there are a few slight annoyances:
> >
> > 1. It's a little long to type.
> >
> > 2. It override your CFLAGS completely. You'd probably
> > still want -O2, for instance.
> >
> > 3. It's a good idea to also turn off "recovery", which
> > lets the program keep running after a problem is
> > detected (with the intention of finding as many bugs as
> > possible in a given run). Since Git's test suite should
> > generally run without triggering any problems, it's
> > better to abort immediately and fail the test when we
> > do find an issue.
>
> Unfortunately I do not think Comparing between versions in
> https://gcc.gnu.org/onlinedocs, it appears that -fsanitize-recover
> is not configurable for folks still with GCC 4.x series, and this
> patch is not very useful unless you disable the recovery for the
> purpose of running our tests as you said X-<.
I didn't actually dig into the history of gcc support at all. Back in
the 4.x time-frame I tried using ASan and couldn't get it to work at
all. I ended up just always building with clang (which from my
mostly-ignorant view seems to to be the primary platform for ASan
development).
Since this is an optional build that doesn't need to be available
everywhere, I'd actually be fine with saying "just use clang". But as
far as I can tell, gcc seems to work fine these days. I consider this
mostly a best-effort tool.
I'm also not sure of the behavior without -fno-sanitize-recover. I think
ASan may barf either way. The commit message for my config.mak from a
year or two ago claims that the problem was actually with UBSan. It
would be useful in the long run for that to work, too.
-Peff
next prev parent reply other threads:[~2017-07-10 17:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 13:24 [PATCH 0/5] building git with clang/gcc address sanitizer Jeff King
2017-07-10 13:24 ` [PATCH 1/5] test-lib: set ASAN_OPTIONS variable before we run git Jeff King
2017-07-10 13:24 ` [PATCH 2/5] test-lib: turn on ASan abort_on_error by default Jeff King
2017-07-10 17:18 ` Junio C Hamano
2017-07-10 13:24 ` [PATCH 3/5] Makefile: add helper for compiling with -fsanitize Jeff King
2017-07-10 17:35 ` Junio C Hamano
2017-07-10 17:44 ` Jeff King [this message]
2017-07-10 18:07 ` Junio C Hamano
2017-07-10 20:02 ` Ramsay Jones
2017-07-11 4:44 ` Jeff King
2017-07-10 13:24 ` [PATCH 4/5] Makefile: turn off -fomit-frame-pointer with sanitizers Jeff King
2017-07-10 13:24 ` [PATCH 5/5] Makefile: disable unaligned loads with UBSan Jeff King
2017-07-15 17:18 ` René Scharfe
2017-07-16 10:17 ` Jeff King
2017-07-16 11:02 ` René Scharfe
2017-07-10 13:30 ` [PATCH 0/5] building git with clang/gcc address sanitizer Jeff King
2017-07-10 14:40 ` Lars Schneider
2017-07-10 15:58 ` Jeff King
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170710174454.jbkednmzwts7yr7z@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).