[llvm-bugs] [Bug 38180] New: For programs which fork, some lines are wrongly considered as hit twice

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 16 07:49:18 PDT 2018


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

            Bug ID: 38180
           Summary: For programs which fork, some lines are wrongly
                    considered as hit twice
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: profile
          Assignee: unassignedbugs at nondot.org
          Reporter: mcastelluccio at mozilla.com
                CC: llvm-bugs at lists.llvm.org

For example:
        -:    0:Source:main.c
        -:    0:Graph:main.gcno
        -:    0:Data:main.gcda
        -:    0:Runs:2
        -:    0:Programs:1
        -:    1:#include <unistd.h>
        -:    2:
function main called 2 returned 100% blocks executed 100%
        -:    3:int main(void) {
        2:    4:  int j = 22;
        -:    5:
        2:    6:  fork();
        -:    7:
        2:    8:  int i = 7;
        -:    9:
        2:   10:  return 0;
        -:   11:}

With GCC:
        -:    0:Source:main.c
        -:    0:Graph:main.gcno
        -:    0:Data:main.gcda
        -:    0:Runs:1
        -:    0:Programs:1
        -:    1:#include <unistd.h>
        -:    2:
        1:    3:int main(void) {
        1:    4:  int j = 22;
        -:    5:
        1:    6:  fork();
        -:    7:
        2:    8:  int i = 7;
        -:    9:
        2:   10:  return 0;
        -:   11:}

The difference is probably due to the fact that GCC injects a __gcov_flush call
before the actual fork (similarly for execl, execlp, ...).

-- 
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/20180716/2ee2aa4d/attachment.html>


More information about the llvm-bugs mailing list