[llvm-bugs] [Bug 45548] New: Segmentation Fault in clang-tidy when analyzing ownership

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Apr 15 04:44:04 PDT 2020


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

            Bug ID: 45548
           Summary: Segmentation Fault in clang-tidy when analyzing
                    ownership
           Product: new-bugs
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: paul.west at nrl.navy.mil
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 23360
  --> https://bugs.llvm.org/attachment.cgi?id=23360&action=edit
crash file

$ clang-tidy-10 crash.c --
produces a segmentation fault

I have tried 7, 8 and 10 with the same results.

Please see attached, and here is the minimal code:

#include <stdio.h>

void __attribute((ownership_returns(my_malloc))) *malloc(size_t amt);
void __attribute((ownership_takes(malloc, 1))) free(void *ptr);

void __attribute((ownership_returns(my_malloc))) *my_malloc(size_t amt);

void test1() {
    int *p = my_malloc(12);
    free(p);
}

int main() {
    return 0;
}


If I comment out the following line the segmentation fault goes away:
void __attribute((ownership_takes(malloc, 1))) free(void *ptr);

-- 
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/20200415/5181bedf/attachment.html>


More information about the llvm-bugs mailing list