public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/99442] New: [GCOV] No coverage with "Segmentation fault (core dumped)"
@ 2021-03-07  8:30 njuwy at smail dot nju.edu.cn
  2021-03-07  9:11 ` [Bug gcov-profile/99442] " pinskia at gcc dot gnu.org
  2021-03-08  9:08 ` marxin at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: njuwy at smail dot nju.edu.cn @ 2021-03-07  8:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99442

            Bug ID: 99442
           Summary: [GCOV] No coverage with "Segmentation fault (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 <stdio.h>
char fixed_regs[0x00080000];

int main() { 
printf("PASSED\n");
return fixed_regs[0x000ff000]; 
}

$ gcc -O0 --coverage test.c;./a.out;gcov test;cat test.c.gcov
PASSED
Segmentation fault (core dumped)
test.gcda:cannot open data file, assuming not executed
File 'test.c'
Lines executed:0.00% of 3
Creating 'test.c.gcov'

        -:    0:Source:test.c
        -:    0:Graph:test.gcno
        -:    0:Data:-
        -:    0:Runs:0
        -:    1:#include <stdio.h>
        -:    2:char fixed_regs[0x00080000];
        -:    3:
    #####:    4:int main() { 
    #####:    5:printf("PASSED\n");
    #####:    6:return fixed_regs[0x000ff000]; 
        -:    7:}


Obviously, main function has been executed. However, no coverage information
generated.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug gcov-profile/99442] [GCOV] No coverage with "Segmentation fault (core dumped)"
  2021-03-07  8:30 [Bug gcov-profile/99442] New: [GCOV] No coverage with "Segmentation fault (core dumped)" njuwy at smail dot nju.edu.cn
@ 2021-03-07  9:11 ` pinskia at gcc dot gnu.org
  2021-03-08  9:08 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-03-07  9:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99442

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There is no way really to recover from a segfault in a manner that is suitable
for all programs. The developer could set a sigv handler if they want to do any
recovery from it. The library should not do it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug gcov-profile/99442] [GCOV] No coverage with "Segmentation fault (core dumped)"
  2021-03-07  8:30 [Bug gcov-profile/99442] New: [GCOV] No coverage with "Segmentation fault (core dumped)" njuwy at smail dot nju.edu.cn
  2021-03-07  9:11 ` [Bug gcov-profile/99442] " pinskia at gcc dot gnu.org
@ 2021-03-08  9:08 ` marxin at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-08  9:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99442

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
As Andrew explained, it's invalid. You can call __gcov_dump right before the
statement that causes Segmentation fault.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-08  9:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07  8:30 [Bug gcov-profile/99442] New: [GCOV] No coverage with "Segmentation fault (core dumped)" njuwy at smail dot nju.edu.cn
2021-03-07  9:11 ` [Bug gcov-profile/99442] " pinskia at gcc dot gnu.org
2021-03-08  9:08 ` 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).