[llvm-bugs] [Bug 25497] New: Using `__builtin_frame_address(-1)` causes infinite loop.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 11 14:47:08 PST 2015


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

            Bug ID: 25497
           Summary: Using `__builtin_frame_address(-1)` causes infinite
                    loop.
           Product: clang
           Version: 3.7
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richardross at fb.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15268
  --> https://llvm.org/bugs/attachment.cgi?id=15268&action=edit
clang-backtrace

This simple snippet of code:

    int main() {
       void *x = __builtin_frame_address(-1);
    }

Will cause the compiler to run infinitely, or at least until the systems'
memory limit is reached.

Obviously, __builtin_frame_address(-1) is an invalid operation and undefined
behavior, but there should probably be a better reporting mechanism than to
cause the compiler to hang.

Attached is a stack trace as provided by OSX's activity monitor sampler. Also
tested with latest trunk 3.7, unfortunately the precompiled version has no
symbol information.

-- 
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/20151111/3a5159ca/attachment-0001.html>


More information about the llvm-bugs mailing list