[llvm-bugs] [Bug 42789] New: Documentation UBSan not clear

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 27 03:27:34 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42789

            Bug ID: 42789
           Summary: Documentation UBSan not clear
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jvapen at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

The documentation at
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html is interesting,
however, when one starts to use it seems to be lacking some relevant
information that might be obvious if you already know how things work. Possibly
the implementation doesn't support certain behavior, which one could implicitly
assume as a reasonable behavior.


Windowing applications
----------------------
As I'm on windows, with a windowing application, I can't see any of the
standard output that gets created. If I run with a console application, I
nicely see the output in the terminal.
=> Are windowing applications not supported? If they are supported, where does
the output go to? Can it be written in a file?

Trap on UB
----------
The page itself mentions -fno-sanitize-recover=... which is really nice,
however, it doesn't link to
https://clang.llvm.org/docs/UsersManual.html#controlling-code-generation for
where the actual details are about this.
I first had to find this second page before realizing that UBSan only reports
and doesn't trap when it encounters an issue.

Custom Trap
-----------
I've also looked into -ftrap-function, which ain't even mentioned on the page.
However, it was not immediately clear that this function needs to be a
C-linkage void(void) function. (Most documentation about this was found at
https://clang.llvm.org/docs/UsersManual.html#cmdoption-ftrap-function)

Nor was is obvious from the description of -fsanitize-trap that this trap
function doesn't get a 'const char *' with the actual reason.
(It does make sense after one has the complete puzzle) It mentions you don't
need the runtime. Which I assumed was for the extra callstack support.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190727/2dafd00d/attachment.html>


More information about the llvm-bugs mailing list