On 09/26/16 11:22, Martin Liška wrote:
Hi.
So the I found reason of inconsistencies, running multiple times -fselftest is
enough to
find that memory allocation related functions can be executed different times.
Small example:
thanks for checking.
@@ -598,6 +598,10 @@ facilities to restrict profile collection to the program
region of
interest. Calling @code{__gcov_reset(void)} will clear all profile counters
to zero, and calling @code{__gcov_dump(void)} will cause the profile
information
collected at that point to be dumped to @file{.gcda} output files.
+By default, every instrumented application calls __gcov_dump function
+via a static destructor with priority equal to 99. That would guarantee
+that all user defined destructors, as well as function handlers registered
+by atexit, would be executed before gcov dump function is executed.
'by default' This suggests there's a non-default behaviour, but I can't see it
nor how to enable it. Perhaps:
"Instrumented applications use a static destructor with priority 99 to invoke
the __gcov_dump function. Thus __gcov_dump is executed after all
user defined static destructors, as well as handlers registered with atexit."
?
nathan