public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation
@ 2021-10-14 14:44 chipitsine at gmail dot com
  2021-10-14 15:12 ` [Bug gcov-profile/102746] " marxin at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: chipitsine at gmail dot com @ 2021-10-14 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102746
           Summary: gcov returns 0 un erroneuos incovation
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chipitsine at gmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

repro steps:

several source files (for example, two)

main.c:

void hello(void);

void main(void){
 hello();
}

hello.c:

#include <stdio.h>

void hello(void) {
   printf("hello"); 
}


..................

build with coverage (using master branch gcc)

gcc --coverage -o hello main.c hello.c

....................

execute

./hello



executing "gcov" in erroneous way 

gcov "hello-hello.gcda  hello-main.gcda"
hello-hello.gcda  hello-main.gcno:cannot open notes file
hello-hello.gcda  hello-main.gcda:cannot open data file, assuming not executed
No executable lines

however, exit status is "0"

$ echo $?
0
$



it is hard to identify error situation when exit status is "0". I beleive it
should be "1" under such circumstances

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
@ 2021-10-14 15:12 ` marxin at gcc dot gnu.org
  2021-10-14 15:17 ` chipitsine at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-14 15:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-10-14
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I've got your point.
The question is if we should return 1 if we can't open .gcda (or .gcno) file
for one input file, or for all of them?

Note one can execute gcov file multiple filenames as arguments.

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
  2021-10-14 15:12 ` [Bug gcov-profile/102746] " marxin at gcc dot gnu.org
@ 2021-10-14 15:17 ` chipitsine at gmail dot com
  2021-10-15  6:32 ` chipitsine at gmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: chipitsine at gmail dot com @ 2021-10-14 15:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Илья Шипицин <chipitsine at gmail dot com> ---
I came to this situation using wrong powershell approach. I found all "gcda"
and merged them into single string. Powershell executed "gcov" and passed 1
(!!) argument as concatenated string.

Actually, if gcov cannot find some required file, it should return "1" (or
other non zero).

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
  2021-10-14 15:12 ` [Bug gcov-profile/102746] " marxin at gcc dot gnu.org
  2021-10-14 15:17 ` chipitsine at gmail dot com
@ 2021-10-15  6:32 ` chipitsine at gmail dot com
  2021-10-15  8:20 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: chipitsine at gmail dot com @ 2021-10-15  6:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Илья Шипицин <chipitsine at gmail dot com> ---
> The question is if we should return 1 if we can't open .gcda (or .gcno) file for one input file, or for all of them?

any input file.

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
                   ` (2 preceding siblings ...)
  2021-10-15  6:32 ` chipitsine at gmail dot com
@ 2021-10-15  8:20 ` marxin at gcc dot gnu.org
  2021-10-15  8:20 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-15  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
All right, let me prepare a patch for it.

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
                   ` (3 preceding siblings ...)
  2021-10-15  8:20 ` marxin at gcc dot gnu.org
@ 2021-10-15  8:20 ` marxin at gcc dot gnu.org
  2021-10-18 11:13 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-15  8:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
                   ` (4 preceding siblings ...)
  2021-10-15  8:20 ` marxin at gcc dot gnu.org
@ 2021-10-18 11:13 ` cvs-commit at gcc dot gnu.org
  2021-10-18 11:14 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-18 11:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:815f15d3384edbdd73cc54536f30947e15183151

commit r12-4474-g815f15d3384edbdd73cc54536f30947e15183151
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Oct 18 11:30:55 2021 +0200

    gcov: return proper exit code when error happens

            PR gcov-profile/102746
            PR gcov-profile/102747

    gcc/ChangeLog:

            * gcov.c (main): Return return_code.
            (output_gcov_file): Mark return_code when error happens.
            (generate_results): Likewise.
            (read_graph_file): Likewise.
            (read_count_file): Likewise.

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
                   ` (5 preceding siblings ...)
  2021-10-18 11:13 ` cvs-commit at gcc dot gnu.org
@ 2021-10-18 11:14 ` marxin at gcc dot gnu.org
  2021-10-18 12:11 ` chipitsine at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-18 11:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master.

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
                   ` (6 preceding siblings ...)
  2021-10-18 11:14 ` marxin at gcc dot gnu.org
@ 2021-10-18 12:11 ` chipitsine at gmail dot com
  2021-10-18 12:17 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: chipitsine at gmail dot com @ 2021-10-18 12:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Илья Шипицин <chipitsine at gmail dot com> ---
wow. thanks for that.

btw, will it be "gcc-12 only" or it is going to be backported (I'm interested
in gcc-8) ?

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
                   ` (7 preceding siblings ...)
  2021-10-18 12:11 ` chipitsine at gmail dot com
@ 2021-10-18 12:17 ` marxin at gcc dot gnu.org
  2021-10-18 12:30 ` chipitsine at gmail dot com
  2021-10-19 12:56 ` marxin at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-18 12:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Илья Шипицин from comment #7)
> wow. thanks for that.
> 
> btw, will it be "gcc-12 only" or it is going to be backported (I'm
> interested in gcc-8) ?

No, I'm not planning backporting that as it's quite a change in functionality.

Note gcc-8 is out of support:
https://gcc.gnu.org/

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
                   ` (8 preceding siblings ...)
  2021-10-18 12:17 ` marxin at gcc dot gnu.org
@ 2021-10-18 12:30 ` chipitsine at gmail dot com
  2021-10-19 12:56 ` marxin at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: chipitsine at gmail dot com @ 2021-10-18 12:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Илья Шипицин <chipitsine at gmail dot com> ---
ok, so we'll migrate to gcc-12 :)

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

* [Bug gcov-profile/102746] gcov returns 0 un erroneuos incovation
  2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
                   ` (9 preceding siblings ...)
  2021-10-18 12:30 ` chipitsine at gmail dot com
@ 2021-10-19 12:56 ` marxin at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-10-19 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Илья Шипицин from comment #9)
> ok, so we'll migrate to gcc-12 :)

Yes, but please wait for the release of 12.1 that will happen at the end of
April 2022.

In the meantime, you can port to GCC 11.2 and cherry-pick the patch.

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

end of thread, other threads:[~2021-10-19 12:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 14:44 [Bug gcov-profile/102746] New: gcov returns 0 un erroneuos incovation chipitsine at gmail dot com
2021-10-14 15:12 ` [Bug gcov-profile/102746] " marxin at gcc dot gnu.org
2021-10-14 15:17 ` chipitsine at gmail dot com
2021-10-15  6:32 ` chipitsine at gmail dot com
2021-10-15  8:20 ` marxin at gcc dot gnu.org
2021-10-15  8:20 ` marxin at gcc dot gnu.org
2021-10-18 11:13 ` cvs-commit at gcc dot gnu.org
2021-10-18 11:14 ` marxin at gcc dot gnu.org
2021-10-18 12:11 ` chipitsine at gmail dot com
2021-10-18 12:17 ` marxin at gcc dot gnu.org
2021-10-18 12:30 ` chipitsine at gmail dot com
2021-10-19 12:56 ` 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).