This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/9] Add UBSan to the build
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Tue, 28 Aug 2018 20:03:19 +0100
- Subject: Re: [PATCH 0/9] Add UBSan to the build
- References: <20180827145620.11055-1-tom@tromey.com>
On 08/27/2018 03:56 PM, Tom Tromey wrote:
> This series adds undefined behavior checking to the build and fixes
> all the cases of UB that are found by the test suite. See the final
> patch for details, but basically UBsan is enabled by default only in
> development mode.
>
> None of the current cases of UB seem to cause any bugs; but of course
> compilers have a history of exploiting UB for optimizations, so it's
> possible that UB will result in bugs in the future.
>
> This series could be improved in a couple of ways.
>
> First, it does not check for UB in any of the libraries used by gdb.
>
> Second, most of the builders do not have the ubsan runtime library
> installed. (I don't know why this isn't just a dependency of gcc; it
> seems strange to ship a non-working -fsanitize=undefined by default.)
> It's possible that installing this library on the builders will result
> in new failures.
>
> Finally, I think it would be good -- in fact, even more useful -- to
> treat the address sanitizer in a similar way. I have some patches
> toward this goal, but I haven't submitted them yet because there is
> one ASan failure that I haven't fixed.
>
> Let me know what you think.
I think this is a good idea. On enabling this by default on devel
builds, do you have a sense of CPU/memory overhead this introduces?
Thanks,
Pedro Alves