[LLVMbugs] [Bug 16893] New: __gcov_flush does not flush dynamically loaded libraries
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Aug 14 17:38:22 PDT 2013
http://llvm.org/bugs/show_bug.cgi?id=16893
Bug ID: 16893
Summary: __gcov_flush does not flush dynamically loaded
libraries
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Miscellaneous Instrumentation passes
Assignee: unassignedbugs at nondot.org
Reporter: ash.gti at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 11037
--> http://llvm.org/bugs/attachment.cgi?id=11037&action=edit
A simple example that shows the problem, use `make cov`
Calling __gcov_flush() does not flush coverage in dynamically loaded libraries.
Even if the bundle calls __gcov_flush() from a function inside the loaded
bundle it does not flush the coverage of the bundle.
I have a simple example I can attach but to summarize:
cat bundledobject.m
…
@implementation MyBundledObject
- (void)doSomething {
NSLog(@"Someone called [- MyBundledObject doSomething]");
__gcov_flush();
}
@end
…
cat main.m
…
int main() {
…
Class exampleClass = [bundle classNamed:@"MyBundledObject"];
id newInstance = [[exampleClass alloc] init];
[newInstance doSomething];
__gcov_flush();
int *i = 0;
*i = 2; // Causes a seg fault to prevent normal __gcov_flush's from happening
…
The resulting gcda files will have no data for any object loaded from the
bundle.
If this is not the correct way to flush the coverage buffers in loaded
libraries, please let me know.
--
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/20130815/e1729d1e/attachment.html>
More information about the llvm-bugs
mailing list