public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Add UBSan to the build
@ 2018-08-27 14:57 Tom Tromey
  2018-08-27 14:57 ` [PATCH 3/9] Avoid undefined behavior in extract_integer Tom Tromey
                   ` (9 more replies)
  0 siblings, 10 replies; 27+ messages in thread
From: Tom Tromey @ 2018-08-27 14:57 UTC (permalink / raw)
  To: gdb-patches

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.

Tom

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2018-08-30 19:06 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27 14:57 [PATCH 0/9] Add UBSan to the build Tom Tromey
2018-08-27 14:57 ` [PATCH 3/9] Avoid undefined behavior in extract_integer Tom Tromey
2018-08-28 18:39   ` Pedro Alves
2018-08-29  0:11     ` Tom Tromey
2018-08-27 14:57 ` [PATCH 6/9] Avoid undefined behavior in read_signed_leb128 Tom Tromey
2018-08-27 14:57 ` [PATCH 7/9] Avoid undefined behavior in ada_operator_length Tom Tromey
2018-08-27 14:57 ` [PATCH 1/9] Do not pass NULL to memcpy Tom Tromey
2018-08-27 19:12   ` Simon Marchi
2018-08-28 22:40     ` Tom Tromey
2018-08-27 14:57 ` [PATCH 5/9] Avoid undefined behavior in parse_number Tom Tromey
2018-08-27 14:57 ` [PATCH 2/9] Use unsigned as base type for some enums Tom Tromey
2018-08-27 19:22   ` Simon Marchi
2018-08-27 20:22     ` Tom Tromey
2018-08-27 21:26       ` Simon Marchi
2018-08-28 18:54         ` Pedro Alves
2018-08-28 22:42         ` Tom Tromey
2018-08-29  0:01           ` Tom Tromey
2018-08-27 14:59 ` [PATCH 9/9] Add --enable-ubsan Tom Tromey
2018-08-27 14:59 ` [PATCH 4/9] Avoid undefined behavior in read_subrange_type Tom Tromey
2018-08-27 14:59 ` [PATCH 8/9] Avoid undefined behavior in expression dumping Tom Tromey
2018-08-28 18:49   ` Pedro Alves
2018-08-29  0:27     ` Tom Tromey
2018-08-28 19:03 ` [PATCH 0/9] Add UBSan to the build Pedro Alves
2018-08-29  0:45   ` Tom Tromey
2018-08-30 18:41     ` Pedro Alves
2018-08-30 18:56       ` Tom Tromey
2018-08-30 19:06         ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).