https://llvm.org/bugs/show_bug.cgi?id=26847
Bug ID: 26847 Summary: coverage flushing unlocks and closes file in the wrong order Product: compiler-rt Version: 3.8 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: compiler-rt Assignee: unassignedb...@nondot.org Reporter: t...@cloudera.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified When using GCDA profiling, the flush process tries to flock/funlock the GCDA files to prevent multi-process races. However, the code that closes the file seems to be wrong: it calls 'unlock' on the file _after_ closing it, which results in EBADF: open("/tmp/test.gcda", O_RDWR) = -1 ENOENT (No such file or directory) open("/tmp/test.gcda", O_RDWR|O_CREAT, 0644) = 3 flock(3, LOCK_EX) = 0 fcntl(3, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE) fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2b2e397000 lseek(3, 0, SEEK_CUR) = 0 write(3, "adcg*204J\310\376B\0\0\0\1\5\0\0\0\0\0\0\0\211EN;\2\0\0\0"..., 124) = 124 close(3) = 0 munmap(0x7f2b2e397000, 4096) = 0 flock(3, LOCK_UN) = -1 EBADF (Bad file descriptor) -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs