public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/99443] New: [GCOV] No coverage with "Aborted(core dumped)"
@ 2021-03-07 8:34 njuwy at smail dot nju.edu.cn
2021-03-07 9:09 ` [Bug gcov-profile/99443] " pinskia at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2021-03-07 8:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99443
Bug ID: 99443
Summary: [GCOV] No coverage with "Aborted(core dumped)"
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: gcov-profile
Assignee: unassigned at gcc dot gnu.org
Reporter: njuwy at smail dot nju.edu.cn
CC: marxin at gcc dot gnu.org
Target Milestone: ---
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure -enable-checking=release -enable-languages=c,c++
-disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)
$ cat test.c
#include <x86intrin.h>
#include <stdio.h>
extern void abort(void);
#ifdef __x86_64__
#define EFLAGS_TYPE unsigned long long int
#else
#define EFLAGS_TYPE unsigned int
#endif
int main() {
printf("1\n");
EFLAGS_TYPE flags = 0xD7; /* 111010111b */
__writeeflags(flags);
flags = __readeflags();
printf("2\n");
if ((flags & 0xFF) != 0xD7)
abort();
printf("3\n");
#ifdef DEBUG
printf("PASSED\n");
#endif
}
$ gcc -O0 --coverage test.c;./a.out;gcov test;cat test.c.gcov
1
2
Aborted (core dumped)
test.gcda:cannot open data file, assuming not executed
File 'test.c'
Lines executed:0.00% of 8
Creating 'test.c.gcov'
File '/usr/local/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/ia32intrin.h'
Lines executed:0.00% of 3
Creating 'ia32intrin.h.gcov'
-: 0:Source:test.c
-: 0:Graph:test.gcno
-: 0:Data:-
-: 0:Runs:0
-: 1:#include <x86intrin.h>
-: 2:#include <stdio.h>
-: 3:
-: 4:extern void abort(void);
-: 5:
-: 6:#ifdef __x86_64__
-: 7:#define EFLAGS_TYPE unsigned long long int
-: 8:#else
-: 9:#define EFLAGS_TYPE unsigned int
-: 10:#endif
-: 11:
#####: 12:int main() {
#####: 13: printf("1\n");
#####: 14: EFLAGS_TYPE flags = 0xD7; /* 111010111b */
-: 15: __writeeflags(flags);
#####: 16: flags = __readeflags();
#####: 17: printf("2\n");
#####: 18: if ((flags & 0xFF) != 0xD7)
#####: 19: abort();
#####: 20: printf("3\n");
-: 21:#ifdef DEBUG
-: 22: printf("PASSED\n");
-: 23:#endif
-: 24:}
We can see that line #13,#14 were executed,which means that main function
executed too. However, no coverage generated.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gcov-profile/99443] [GCOV] No coverage with "Aborted(core dumped)"
2021-03-07 8:34 [Bug gcov-profile/99443] New: [GCOV] No coverage with "Aborted(core dumped)" njuwy at smail dot nju.edu.cn
@ 2021-03-07 9:09 ` pinskia at gcc dot gnu.org
2021-03-07 9:09 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-03-07 9:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99443
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this is expected behavior. Aborting should not dump the coverage file
at all as it should be used for an really bad unexitable situation only.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gcov-profile/99443] [GCOV] No coverage with "Aborted(core dumped)"
2021-03-07 8:34 [Bug gcov-profile/99443] New: [GCOV] No coverage with "Aborted(core dumped)" njuwy at smail dot nju.edu.cn
2021-03-07 9:09 ` [Bug gcov-profile/99443] " pinskia at gcc dot gnu.org
@ 2021-03-07 9:09 ` pinskia at gcc dot gnu.org
2021-03-07 12:51 ` njuwy at smail dot nju.edu.cn
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-03-07 9:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99443
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This behavior might even be documented but I have not looked yet.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gcov-profile/99443] [GCOV] No coverage with "Aborted(core dumped)"
2021-03-07 8:34 [Bug gcov-profile/99443] New: [GCOV] No coverage with "Aborted(core dumped)" njuwy at smail dot nju.edu.cn
2021-03-07 9:09 ` [Bug gcov-profile/99443] " pinskia at gcc dot gnu.org
2021-03-07 9:09 ` pinskia at gcc dot gnu.org
@ 2021-03-07 12:51 ` njuwy at smail dot nju.edu.cn
2021-03-07 20:58 ` pinskia at gcc dot gnu.org
2021-03-08 9:11 ` marxin at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2021-03-07 12:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99443
--- Comment #3 from Yang Wang <njuwy at smail dot nju.edu.cn> ---
(In reply to Andrew Pinski from comment #2)
> This behavior might even be documented but I have not looked yet.
Thanks for your reply! So, this is expected (as well as bug 99442) rather than
a bug?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gcov-profile/99443] [GCOV] No coverage with "Aborted(core dumped)"
2021-03-07 8:34 [Bug gcov-profile/99443] New: [GCOV] No coverage with "Aborted(core dumped)" njuwy at smail dot nju.edu.cn
` (2 preceding siblings ...)
2021-03-07 12:51 ` njuwy at smail dot nju.edu.cn
@ 2021-03-07 20:58 ` pinskia at gcc dot gnu.org
2021-03-08 9:11 ` marxin at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-03-07 20:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99443
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It is not well documented though.
https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Gcov-and-Optimization.html#Gcov-and-Optimization
Long-running applications can use the __gcov_reset and __gcov_dump facilities
to restrict profile collection to the program region of interest. Calling
__gcov_reset(void) will clear all profile counters to zero, and calling
__gcov_dump(void) will cause the profile information collected at that point to
be dumped to .gcda output files. ** 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. If an executable loads a dynamic shared object
via dlopen functionality, -Wl,--dynamic-list-data is needed to dump all profile
data.
----- CUT ----
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gcov-profile/99443] [GCOV] No coverage with "Aborted(core dumped)"
2021-03-07 8:34 [Bug gcov-profile/99443] New: [GCOV] No coverage with "Aborted(core dumped)" njuwy at smail dot nju.edu.cn
` (3 preceding siblings ...)
2021-03-07 20:58 ` pinskia at gcc dot gnu.org
@ 2021-03-08 9:11 ` marxin at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-08 9:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99443
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Invalid then.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-03-08 9:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07 8:34 [Bug gcov-profile/99443] New: [GCOV] No coverage with "Aborted(core dumped)" njuwy at smail dot nju.edu.cn
2021-03-07 9:09 ` [Bug gcov-profile/99443] " pinskia at gcc dot gnu.org
2021-03-07 9:09 ` pinskia at gcc dot gnu.org
2021-03-07 12:51 ` njuwy at smail dot nju.edu.cn
2021-03-07 20:58 ` pinskia at gcc dot gnu.org
2021-03-08 9:11 ` marxin at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).