Christian Brabandt wrote:

> On Di, 24 Jan 2017, Christian Brabandt wrote:
>
>> On Di, 24 Jan 2017, Dominique Pellé wrote:
>> > How about an address sanitizer build in Travis to catch
>> > this kind of bugs earlier in CI?
>
> Here is a patch.
>
> Sample logfiles here:
> https://travis-ci.org/chrisbra/vim/builds/194982196
> This was with patch 8.0.225 which did abort on the mentioned test:
> https://s3.amazonaws.com/archive.travis-ci.org/jobs/194982204/log.txt
>
> Best,
> Christian


Nice. Thank you!

Some remarks:

1) regarding asan, we could use -O1 instead of -O0 to
speed up the Jenkins job. This is the advice from the
asan documentation:

=== BEGIN QUOTE https://github.com/google/sanitizers/wiki/AddressSanitizer

In order to use AddressSanitizer you will need to
compile and link your program using clang with
the -fsanitize=address switch. To get a reasonable
performance add -O1 or higher. To get nicer stack
traces in error messages add -fno-omit-frame-pointer.
=== END QUOTE

2)  I see that patch also adds a ubsan build.
Unlike asan which crashes in case of error, ubsan does
not crash and only prints a message on the terminal.
So I suppose that CI build will be green in case of
ubsan error. In fact, running vim tests normally gives
at least one ubsan error when dividing by 0.0 in
eval.c:4092:

 4090     /* We rely on the floating point library to handle divide
 4091      * by zero to result in "inf" and not a crash. */
 4092     f1 = f1 / f2;

If you search for "runtime error:", you can see those
ubsan errors reported in the  log, despite the build
being green:

https://s3.amazonaws.com/archive.travis-ci.org/jobs/194982205/log.txt

3) We can also make ubsan report the stack of the error if we do
export UBSAN_OTIONS=print_stacktrace=1. See:

https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#stack-traces-and-report-symbolization

But I'm not sure that this option is available in old versions
of clang. I see that Travis uses clang-3.4 which is quite old.

Regards
Dominique

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui