public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/60275] New: [UBSAN] Add -f[no-]sanitize-recover/-fsanitize-undefined-trap-on-error to make UBSAN's runtime errors fatal
@ 2014-02-19 14:04 burnus at gcc dot gnu.org
  2014-02-19 14:08 ` [Bug sanitizer/60275] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-02-19 14:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60275

            Bug ID: 60275
           Summary: [UBSAN] Add
                    -f[no-]sanitize-recover/-fsanitize-undefined-trap-on-e
                    rror to make UBSAN's runtime errors fatal
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org,
                    mpolacek at gcc dot gnu.org

While I personally would like to see more fine tuning via UBSAN_FLAGS - similar
to ASAN, LSAN and TSAN, adding CLANG's -fsanitize-recover/-fno-sanitize-recover
and  -fsanitize-undefined-trap-on-error would be useful as additional feature.

>From CLANG:

   Extra features of UndefinedBehaviorSanitizer:

   -  ``-fno-sanitize-recover``: By default, after a sanitizer diagnoses
      an issue, it will attempt to continue executing the program if there
      is a reasonable behavior it can give to the faulting operation. This
      option causes the program to abort instead.
   -  ``-fsanitize-undefined-trap-on-error``: Causes traps to be emitted
      rather than calls to runtime libraries when a problem is detected.
      This option is intended for use in cases where the sanitizer runtime
      cannot be used (for instance, when building libc or a kernel module).
      This is only compatible with the sanitizers in the ``undefined-trap``
      group.

That would be BUILT_IN_UNREACHABLE and BUILT_IN_TRAP. (But unreachable
shouldn't be dressed by SANITIZE_UNREACHABLE ;-)

See also LLVM's
* tools/clang/docs/UsersManual.rst
* tools/clang/lib/CodeGen/CGExpr.cpp (search for SanitizeUndefinedTrapOnError
and SanitizeRecover)


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

end of thread, other threads:[~2014-04-23  8:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-19 14:04 [Bug sanitizer/60275] New: [UBSAN] Add -f[no-]sanitize-recover/-fsanitize-undefined-trap-on-error to make UBSAN's runtime errors fatal burnus at gcc dot gnu.org
2014-02-19 14:08 ` [Bug sanitizer/60275] " mpolacek at gcc dot gnu.org
2014-03-28 15:57 ` burnus at gcc dot gnu.org
2014-03-28 16:31 ` jakub at gcc dot gnu.org
2014-03-28 16:48 ` burnus at gcc dot gnu.org
2014-04-14 18:34 ` jakub at gcc dot gnu.org
2014-04-23  8:20 ` jakub at gcc dot gnu.org
2014-04-23  8:46 ` jakub at gcc dot gnu.org

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).