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

Re: [PATCH 2/5] test-lib: turn on ASan abort_on_error by default

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 10, 2017, 17:18 UTC
Message-ID
<xmqqinj06wil.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170710132438.euiamhjgqzkzkefg@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> By default, ASan will exit with code 1 when it sees an
> error. This means we'll notice a problem when we expected
> git to succeed, but not in a test_must_fail block.
>
> Let's ask it to actually raise SIGABRT instead. That will
> give us a signal death that test_must_fail will notice. As a
> bonus, it may also leave a coredump, which can be handy for
> digging into a failure.
Well thought-out.  Thanks.
Show 18 quoted lines
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  t/test-lib.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 961194a50..1b6e53f78 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -41,7 +41,7 @@ GIT_BUILD_DIR="$TEST_DIRECTORY"/..
>  # the noise level. This needs to happen at the start of the script,
>  # before we even do our "did we build git yet" check (since we don't
>  # want that one to complain to stderr).
> -: ${ASAN_OPTIONS=detect_leaks=0}
> +: ${ASAN_OPTIONS=detect_leaks=0:abort_on_error=1}
>  export ASAN_OPTIONS
>  
>  ################################################################
Previous: Jeff KingNext: Jeff King
Message 10 of 18 in “building git with clang/gcc address sanitizer”
  1. 0/5 building git with clang/gcc address sanitizerJeff King, Jul 10, 2017
  2. 1/5 test-lib: set ASAN_OPTIONS variable before we run gitJeff King, Jul 10, 2017
  3. 3/5 Makefile: add helper for compiling with -fsanitizeJeff King, Jul 10, 2017
  4. Junio C HamanoJul 10, 2017
  5. Jeff KingJul 10, 2017
  6. Junio C HamanoJul 10, 2017
  7. Ramsay JonesJul 10, 2017
  8. Jeff KingJul 11, 2017
  9. 2/5 test-lib: turn on ASan abort_on_error by defaultJeff King, Jul 10, 2017
  10. Junio C HamanoJul 10, 2017
  11. 5/5 Makefile: disable unaligned loads with UBSanJeff King, Jul 10, 2017
  12. René ScharfeJul 15, 2017
  13. Jeff KingJul 16, 2017
  14. René ScharfeJul 16, 2017
  15. 4/5 Makefile: turn off -fomit-frame-pointer with sanitizersJeff King, Jul 10, 2017
  16. Jeff KingJul 10, 2017
  17. Lars SchneiderJul 10, 2017
  18. Jeff KingJul 10, 2017

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.