https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90380
Bug ID: 90380
Summary: gcov issue: gets stuck (infinite loop?) while
analyzing coverage on Fortran project
Product: gcc
Version: 8.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: gcov-profile
Assignee: unassigned at gcc dot gnu.org
Reporter: vsande at cimne dot upc.edu
CC: marxin at gcc dot gnu.org
Target Milestone: ---
Dear GCC/Gcov team,
we are developing Fempar, a Fortran200X project with some mixed C code, that
takes advantage of CPP preprocessor.
We have recently updated our CI environment from GCC 5.4.1 to 8.3.0. Coverage
with GCC 8.3.0 fails because it gets stuck in a infinite loop while analyzing
some files in our software project
We did not determine the exact version of GCC in which this issue appears. The
latest version that was working correctly for us was 6.2.0. This issue can be
reproduced, at least, with GCC 8.X.X and 9.X.X.
We have reproduced the issue environment by means of Docker containers. In
particular, to reproduce the issue please run the following commands:
```
$ # Launch the docker container
$ docker run --rm -ti fempar/fempar:gnu-8.3.0_gcov-issue gcov
$ # Run the following command inside the docker container
$ gcov -l -o
"/data/fempar/Sources/Lib/CMakeFiles/FEMPAR.dir/Geometry/Triangulation"
"/data/fempar/Sources/Lib/CMakeFiles/FEMPAR.dir/Geometry/Triangulation/p4est_triangulation.f90.gcda"
```
After running these commands, gcov output is shown in the following lines:
```
File
'/tmp/fempar-experimental/Sources/Lib/Geometry/Triangulation/sbm_p4est_base_triangulation.i90'
Lines executed:81.37% of 1653
Creating 'p4est_triangulation.f90.gcda##sbm_p4est_base_triangulation.i90.gcov'
```
At this point gcov gets stuck and, it seems, that never ends.
The code has been compiled with the following flags:
-fdefault-real-8 -ffree-line-length-0 -cpp -Wimplicit-interface -g -fbacktrace
-fbounds-check -fprofile-arcs -ftest-coverage -Wimplicit-interface
Is this a known bug?
Is there any possible workaround?
Let me know if you need any other further information.
Thanks in advance,
VĂctor.