lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] UBSAN flags [Was: Unit tests hygiene]


From: Greg Chicares
Subject: [lmi] UBSAN flags [Was: Unit tests hygiene]
Date: Fri, 3 Jun 2022 19:51:19 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 6/3/22 17:47, Vadim Zeitlin wrote:
> On Fri, 3 Jun 2022 16:29:18 +0000 Greg Chicares <gchicares@sbcglobal.net> 
> wrote:
> 
> GC> On 5/21/22 18:34, Vadim Zeitlin wrote:
> GC> > 
> GC> >  Some time ago I proposed to run lmi unit tests under UBSAN, the 
> undefined
> GC> > behaviour sanitizer, and I've finally tried doing this. I used the
> GC> > autotools build, as it was simple to do there because it's enough to 
> just
> GC> > append CXX='g++ -fsanitize=undefined' to configure command line

[...non-autotools parallel...]

> GC> -debug_flag := -ggdb
> GC> +# debug_flag := -ggdb -fsanitize=undefined -fno-sanitize-recover=all 
> --param=max-vartrack-size=60000000
> GC> +
> GC> +debug_flag := -ggdb -fsanitize=undefined -fno-sanitize-recover=all 
> -fno-var-tracking-assignments
> 
>  I don't think it's a good idea to always use UBSAN unconditionally. It
> takes somewhat longer to compile, but also makes things much slower (sorry,
> not sure by how much exactly, but it's times, not percents) during
> run-time.

Agreed. I'll make it a separate build type, to be run hebdomadally
rather than nychthemerally.

> Finally, it's incompatible with any other sanitizers you might
> want to use. So I believe it should be only used in a separate build type.

Glad you mentioned that. We can have multiple hebdomadal-only build types.

> GC> My first question is whether you ever got 'i7702.cpp' to finish
> GC> compiling. It's gone for many minutes here already, even with
> GC> the second (not '#'-commented) set of flags above.
> 
>  I didn't have any problem with this or any other file, but I didn't use
> -fno-sanitize-recover=all because by the time I learnt about it, I had
> already built everything without it and I didn't want to rebuild again.

What optimize option did you use? I used '-O3', and perhaps that's
my problem. I'll try again with '-O0' or perhaps '-Og'.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]