[cfe-users] marking gtest runs as failed when errors by sanitizers are found

Alexey Samsonov vonosmas at gmail.com
Thu Apr 30 10:52:26 PDT 2015


Hi,

You can try either of the following:
a) compile your code with -fno-sanitize-recover=all. Then all UBSan errors
should be fatal.
b) run your executable with setting up the environment variable
UBSAN_OPTIONS=halt_on_error=1
(like this: UBSAN_OPTIONS=halt_on_error=1 ./path/to/your/executable,
setenv() in program will not work).

Let me know if it helps.

On Thu, Apr 30, 2015 at 12:57 AM, Stepniak, Artur (Nokia - PL/Wroclaw) <
artur.stepniak at nokia.com> wrote:

>  hi,
>
> the problem I'm getting that doesn't cause any of the desired effects you
> described is this:
>
> runtime error: unsigned integer overflow: 1 - 32 cannot be represented in
> type 'unsigned int'
> SUMMARY: AddressSanitizer: undefined-behavior
>
> Maybe it's the only issue that doesn't crash the process
>  ------------------------------
> *Od:* ext Alexey Samsonov [vonosmas at gmail.com]
> *Wysłano:* 29 kwietnia 2015 20:27
> *Do:* Stepniak, Artur (Nokia - PL/Wroclaw)
> *DW:* cfe-users at cs.uiuc.edu
> *Temat:* Re: [cfe-users] marking gtest runs as failed when errors by
> sanitizers are found
>
>   Hi!
>
>  What specific sanitizer do you refer to? They behave differently - e.g.
> ASan and MSan by default crash the process after the fist bug is found.
> TSan prints all the error reports, and tries to crash the process with
> non-zero exitcode at the end, if at least one issue was found. UBSan by
> default doesn't crash the process, but can be instructed to do so by adding
> -fno-sanitize-recover=all to your compile flags.
>
>
>
> On Wed, Apr 29, 2015 at 12:19 AM, Stepniak, Artur (Nokia - PL/Wroclaw) <
> artur.stepniak at nokia.com> wrote:
>
>>  Hi,
>>
>> as in the topic. Currently when errors by clang sanitizers are found the
>> tests is still marked as passed which complicates our CI because we'd need
>> to implement parsing of console output. Is there a way to make gtest fail
>> in such situation?
>>
>> Regards,
>> Artur
>>
>> _______________________________________________
>> cfe-users mailing list
>> cfe-users at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users
>>
>>
>
>
>  --
>  Alexey Samsonov
> vonosmas at gmail.com
>



-- 
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20150430/dbcac8a0/attachment.html>


More information about the cfe-users mailing list