[Bug gcov-profile/88994] New: [GCOV] encoding (or unicode) error with gcov/gcc9 when generating filename

moussu.robin at pm dot me gcc-bugzilla@gcc.gnu.org
Tue Jan 22 20:34:00 GMT 2019


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

            Bug ID: 88994
           Summary: [GCOV] encoding (or unicode) error with gcov/gcc9 when
                    generating filename
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: moussu.robin at pm dot me
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Hello,

I filled first a bug on gcovr bug-tracker, and they eventually redirected me
here.

https://github.com/gcovr/gcovr/issues/292

All steps to reproduce the bug (and a lot of details on the output of the
various commands I run is present on the above link.

gcov is trying to create a filename with an extremely strange name: '
pn+\x89\x7f' (with a leading space, and invalid unicode sequence).

Here is a sum-up of what I think is relevant to gcov. Fell free to ask me any
additional details.

```
➜  $ gcov --version
gcov (GCC) 9.0.0 20190107 (experimental)
➜  $ gcc --version
gcc (GCC) 9.0.0 20190107 (experimental)

➜  $ locale
LANG=fr_FR.UTF-8
LC_CTYPE=fr_FR.UTF-8
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
```

```
➜  $ gcov
/home/robin/dev/meson-sample-project/build/third_party/src/baz/6798489@@baz@sta/baz.cc.gcno
--branch-counts --branch-probabilities --preserve-paths --object-directory
/home/robin/dev/meson-sample-project/build/third_party/src/baz/6798489@@baz@sta
/home/robin/dev/meson-sample-project/build/third_party/src/baz/6798489@@baz@sta/baz.cc.gcda:
ne peut ouvrir le fichier de données, supposé non exécuté
File « ../third_party/src/baz/baz.cc »
Lignes exécutées: 0.00% sur 1
Pas de branchement
Pas d'appel
Impossible d'ouvrir le fichier de sortie «  »

File « /usr/include/c++/9.0.0/iostream »
Aucune ligne exécutable
Pas de branchement
Pas d'appel
Suppression de «  »
```

Notice the difference when I'm using `LANG=C` in the filename.

```
➜  $ LANG=C gcov
/home/robin/dev/meson-sample-project/build/third_party/src/baz/6798489@@baz@sta/baz.cc.gcno
--branch-counts --branch-probabilities --preserve-paths --object-directory
/home/robin/dev/meson-sample-project/build/third_party/src/baz/6798489@@baz@sta
/home/robin/dev/meson-sample-project/build/third_party/src/baz/6798489@@baz@sta/baz.cc.gcda:cannot
open data file, assuming not executed
File '../third_party/src/baz/baz.cc'
Lines executed:0.00% of 1
No branches
No calls
Creating '@�ٮ'
Cannot open source file ../third_party/src/baz/baz.cc

File '/usr/include/c++/9.0.0/iostream'
No executable lines
No branches
No calls
Removing '�ٮ'
```


More information about the Gcc-bugs mailing list