[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-06-08 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

Martin Liška  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #19 from Martin Liška  ---
Fixed.

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-06-08 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #18 from Martin Liška  ---
Author: marxin
Date: Thu Jun  8 07:51:07 2017
New Revision: 249006

URL: https://gcc.gnu.org/viewcvs?rev=249006&root=gcc&view=rev
Log:
gcov: Add block_info::block_info (PR gcov-profile/80911).

2017-06-08  Martin Liska  

PR gcov-profile/80911
* gcov.c (block_info::block_info): New constructor.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/gcov.c

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-30 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #17 from Tom de Vries  ---
(In reply to Martin Liška from comment #2)
> Can't confirm that, running trunk@248556 works fine for me.
> Utilizing valgrind also does not help.

I also had problems reproducing the problem, so I decided to dig a little
further.

The problem occurred for me with g++ 4.4.3.

With a more recent g++ (5.4.0), we generate at gimplify:
...
  D.67316 = {};
  block_info::block_info (&D.67316);
  try
{
  D.74239 = gcov_read_unsigned ();
  D.74240 = (long unsigned int) D.74239;
  D.74241 = &fn->blocks;
  std::vector::resize (D.74241, D.74240, &D.67316);
}
  finally
{
  block_info::~block_info (&D.67316);
  D.67316 = {CLOBBER};
}
...
In other words, before calling the default constructor block_info::block_info
on the implicit resize argument D.67316, we initialize it to zero using
'D.67316 = {}'.

With 4.4.3, we generate:
...
  __comp_ctor  (&D.67200);
  try
{
  D.67371 = gcov_read_unsigned ();
  D.67372 = (long unsigned int) D.67371;
  D.67373 = &fn->blocks;
  resize (D.67373, D.67372, &D.67200);
}
  finally
{
  __comp_dtor  (&D.67200);
}
...
and we don't initialize all of D.67200 to zero.

So, when compiling with a more recent compiler, the initialization is done
regardless of how the default constructor is implemented, so there's no problem
to detect with valgrind.

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #16 from Martin Liška  ---
(In reply to Tom de Vries from comment #15)
> (In reply to Tom de Vries from comment #13)
> > (In reply to Martin Liška from comment #12)
> > > Created attachment 41436 [details]
> > > Candidate patch
> > > 
> > > Please test the patch.
> > 
> > Currently testing.
> 
> Did non-bootstrap and reg-test. All the gcov fails mentioned in comment 1
> dissappeared.

Thanks for help with that! I'll send patch to ML.

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #15 from Tom de Vries  ---
(In reply to Tom de Vries from comment #13)
> (In reply to Martin Liška from comment #12)
> > Created attachment 41436 [details]
> > Candidate patch
> > 
> > Please test the patch.
> 
> Currently testing.

Did non-bootstrap and reg-test. All the gcov fails mentioned in comment 1
dissappeared.

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #14 from Tom de Vries  ---
(In reply to Martin Liška from comment #11)
> Ok, I'm probably starting to know what's wrong. Can you please following
> patch and provide me output:
> 

I have not yet been able to reproduce the problem in a standalone build and
test (and I need to keep the build I encountered this in undisturbed). So it's
not easy for me to try this out atm.


OTOH, I think I managed to pin-point the problem with valgrind when running
gcov:
...
==23606== Conditional jump or move depends on uninitialised value(s)
==23606==at 0x405E70: read_graph_file() (gcov.c:1391)
==23606==by 0x404BD5: process_file(char const*) (gcov.c:914)
==23606==by 0x40454C: main (gcov.c:666)
==23606== 
gcov-1.gcno:corrupted
gcov-1.gcda:profile mismatch for 'main'
...

gcov.c:1391:
...
  1388unsigned mark_catches = 0;
  1389struct arc_info *arc;
  1390  
  1391if (src >= fn->blocks.size () || fn->blocks[src].succ)
  1392  goto corrupt;
  1393  
  1394while (num_dests--)
...

So, AFAIU, the immediate problem is that the corruption test reads
uninitialized memory (which I think confirms your analysis).

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #13 from Tom de Vries  ---
(In reply to Martin Liška from comment #12)
> Created attachment 41436 [details]
> Candidate patch
> 
> Please test the patch.

Currently testing.

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

Martin Liška  changed:

   What|Removed |Added

 Status|WAITING |NEW
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #12 from Martin Liška  ---
Created attachment 41436
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41436&action=edit
Candidate patch

Please test the patch.

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #11 from Martin Liška  ---
Ok, I'm probably starting to know what's wrong. Can you please following patch
and provide me output:

diff --git a/gcc/gcov.c b/gcc/gcov.c
index a5aa4aadcac..b0417165642 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -1382,12 +1382,15 @@ read_graph_file (void)
   else if (fn && tag == GCOV_TAG_ARCS)
{
  unsigned src = gcov_read_unsigned ();
+ fprintf (stderr, "arc: %d\n", src);
  fn->blocks[src].id = src;
  unsigned num_dests = GCOV_TAG_ARCS_NUM (length);
  block_t *src_blk = &fn->blocks[src];
  unsigned mark_catches = 0;
  struct arc_info *arc;

+ fprintf (stderr, "fn->blocks.size(): %d, succ: %p\n",
+  fn->blocks.size (), fn->blocks[src].succ);
  if (src >= fn->blocks.size () || fn->blocks[src].succ)
goto corrupt;

@@ -1395,6 +1398,8 @@ read_graph_file (void)
{
  unsigned dest = gcov_read_unsigned ();
  unsigned flags = gcov_read_unsigned ();
+ fprintf (stderr, "dest: %d\n", dest);
+ fprintf (stderr, "flags: %d\n", flags);

  if (dest >= fn->blocks.size ())
goto corrupt;

As block_t does not have a default ctor, blocks.resize() adds new elements that
are not cleared. I'm going to prepare a patch.

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #10 from Tom de Vries  ---
(In reply to Martin Liška from comment #6)
> That said can you please verify gcov --version and gcov-dump --version.

$ ./install/bin/gcov --version
gcov (GCC) 8.0.0 20170524 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.

$ ./install/bin/gcov-dump --version
gcov-dump (GCC) 8.0.0 20170524 (experimental)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #9 from Tom de Vries  ---
(In reply to Tom de Vries from comment #3)
> When run from command line:
> ...
> nobootstrap/build/gcc/gcov gcov-1.c
> gcov-1.gcno:corrupted
> gcov-1.gcda:profile mismatch for 'main'
> Segmentation fault
> ...

The corruption is detected while reading the arcs:
...
(gdb) n
914   fns = read_graph_file ();
(gdb) s
read_graph_file () at
/home/vries/gcc_versions/data/ref-master-17-05-24/src/gcc/gcov.c:1304
1304  unsigned current_tag = 0;
(gdb) n
1305  function_t *fn = NULL;
(gdb) 
1306  function_t *fns = NULL;
(gdb) 
1307  function_t **fns_end = &fns;
(gdb) 
1310  if (!gcov_open (bbg_file_name, 1))
(gdb) 
1315  bbg_file_time = gcov_time ();
(gdb) 
1316  if (!gcov_magic (gcov_read_unsigned (), GCOV_NOTE_MAGIC))
(gdb) 
1323  version = gcov_read_unsigned ();
(gdb) 
1324  if (version != GCOV_VERSION)
(gdb) 
1334  bbg_stamp = gcov_read_unsigned ();
(gdb) 
1336  while ((tag = gcov_read_unsigned ()))
(gdb) 
1338  unsigned length = gcov_read_unsigned ();
(gdb) 
1339  gcov_position_t base = gcov_position ();
(gdb) 
1341  if (tag == GCOV_TAG_FUNCTION)
(gdb) 
1347  ident = gcov_read_unsigned ();
(gdb) 
1348  lineno_checksum = gcov_read_unsigned ();
(gdb) 
1349  cfg_checksum = gcov_read_unsigned ();
(gdb) 
1350  function_name = xstrdup (gcov_read_string ());
(gdb) 
1351  unsigned src_idx = find_source (gcov_read_string ());
(gdb) 
1352  lineno = gcov_read_unsigned ();
(gdb) 
1354  fn = new function_t;
(gdb) 
1355  fn->name = function_name;
(gdb) 
1356  if (flag_demangled_names)
(gdb) 
1362  fn->ident = ident;
(gdb) 
1363  fn->lineno_checksum = lineno_checksum;
(gdb) 
1364  fn->cfg_checksum = cfg_checksum;
(gdb) 
1365  fn->src = src_idx;
(gdb) 
1366  fn->line = lineno;
(gdb) 
1368  fn->next_file_fn = NULL;
(gdb) 
1369  fn->next = NULL;
(gdb) 
1370  *fns_end = fn;
(gdb) 
1371  fns_end = &fn->next;
(gdb) 
1372  current_tag = tag;
(gdb) 
1487  gcov_sync (base, length);
(gdb) 
1488  if (gcov_is_error ())
(gdb) 
1336  while ((tag = gcov_read_unsigned ()))
(gdb) 
1338  unsigned length = gcov_read_unsigned ();
(gdb) 
1339  gcov_position_t base = gcov_position ();
(gdb) 
1341  if (tag == GCOV_TAG_FUNCTION)
(gdb) 
1374  else if (fn && tag == GCOV_TAG_BLOCKS)
(gdb) 
1376  if (!fn->blocks.empty ())
(gdb) 
1380fn->blocks.resize (gcov_read_unsigned ());
(gdb) 
1374  else if (fn && tag == GCOV_TAG_BLOCKS)
(gdb) 
1487  gcov_sync (base, length);
(gdb) 
1488  if (gcov_is_error ())
(gdb) 
1336  while ((tag = gcov_read_unsigned ()))
(gdb) 
1338  unsigned length = gcov_read_unsigned ();
(gdb) 
1339  gcov_position_t base = gcov_position ();
(gdb) 
1341  if (tag == GCOV_TAG_FUNCTION)
(gdb) 
1374  else if (fn && tag == GCOV_TAG_BLOCKS)
(gdb) 
1382  else if (fn && tag == GCOV_TAG_ARCS)
(gdb) 
1384  unsigned src = gcov_read_unsigned ();
(gdb) 
1385  fn->blocks[src].id = src;
(gdb) 
1386  unsigned num_dests = GCOV_TAG_ARCS_NUM (length);
(gdb) 
1387  block_t *src_blk = &fn->blocks[src];
(gdb) 
1388  unsigned mark_catches = 0;
(gdb) 
1391  if (src >= fn->blocks.size () || fn->blocks[src].succ)
(gdb) 
1392goto corrupt;
(gdb) 
1491  fnotice (stderr, "%s:corrupted\n", bbg_file_name);
(gdb) 
gcov-1.gcno:corrupted
1492  break;
(gdb) 
1495  gcov_close ();
(gdb) 
1497  if (!fns)
(gdb) 
1500  return fns;
(gdb) 
1501}
...

When we try to free the function_info, we run into problem with those arcs:
...
Program received signal SIGSEGV, Segmentation fault.
0x77338ee0 in free () from /lib/libc.so.6
(gdb) bt
#0  0x77338ee0 in free () from /lib/libc.so.6
#1  0x00403aa1 in function_info::~function_info (this=0x6d7560,
__in_chrg=)
at src/gcc/gcov.c:454
#2  0x00404e8d in process_file (file_name=0x7fffe6ba "gcov-1.c")
at src/gcc/gcov.c:974
#3  0x0040454d in main (argc=2, argv=0x7fffe438)
at src/gcc/gcov.c:666
(gdb) up
#1  0x00403aa1 in function_info::~function_info (this=0x6d7560,
__in_chrg=)
at src/gcc/gcov.c:454
454   free (arc);
(gdb) l
449   arc_t *arc, *arc_n;
450
451   for (arc = blocks[i].succ; arc; arc = arc_n)
452 {
453   arc_n = arc->succ_next;
454   free (arc);
455 }
456 }
457   free (counts);
458   if (flag_demangled_names && demangled_name != name)
...

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #8 from Martin Liška  ---
For the files you provided:

$ gcov gcov-1.c && cat gcov-1.c.gcov 
/home/vries/gcc_versions/data/ref-master-17-05-24/src/gcc/testsuite/gcc.misc-tests/gcov-1.c:source
file is newer than notes file 'gcov-1.gcno'
(the message is displayed only once per source file)
File
'/home/vries/gcc_versions/data/ref-master-17-05-24/src/gcc/testsuite/gcc.misc-tests/gcov-1.c'
Lines executed:100.00% of 6
Creating 'gcov-1.c.gcov'

-:   
0:Source:/home/vries/gcc_versions/data/ref-master-17-05-24/src/gcc/testsuite/gcc.misc-tests/gcov-1.c
-:0:Graph:gcov-1.gcno
-:0:Data:gcov-1.gcda
-:0:Runs:2
-:0:Programs:1
-:0:Source is newer than graph
-:1:/* Test Gcov basics.  */
-:2:
-:3:/* { dg-options "-fprofile-arcs -ftest-coverage" } */
-:4:/* { dg-do run { target native } } */
-:5:
   20:6:void noop ()
-:7:{
   20:8:}
-:9:
2:   10:int main ()
-:   11:{
-:   12:  int i;
-:   13:
   22:   14:  for (i = 0; i < 10; i++)  /* count(11) */
   20:   15:noop ();/* count(10) */
-:   16:
2:   17:  return 0; /* count(1) */
-:   18:}
-:   19:
-:   20:/* { dg-final { run-gcov gcov-1.c } } */

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #7 from Martin Liška  ---
Sorry, the previous comment is not correct as I see changes paths in the file.
Investigating more...

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #6 from Martin Liška  ---
> 
> $ ./nobootstrap/install/bin/gcov-dump gcov-1.gcno 
> gcov-1.gcno:note:magic `gcno':version `A80e'
> gcov-1.gcno:stamp 1402604930
> gcov-1.gcno:  0100:  19:FUNCTION ident=108032747,
> lineno_checksum=0x086adbf6, cfg_checksum=0x93d19550, `main'
> src/gcc/testsuite/gcc.misc-tests/gcov-1.c:10
> gcov-1.gcno:0141:   1:BLOCKS 8 blocks
> gcov-1.gcno:0143:   3:ARCS 1 arcs
> gcov-1.gcno:0143:   3:ARCS 1 arcs
> gcov-1.gcno:0143:   5:ARCS 2 arcs
> gcov-1.gcno:0143:   3:ARCS 1 arcs
> gcov-1.gcno:0143:   5:ARCS 2 arcs
> gcov-1.gcno:0143:   3:ARCS 1 arcs
> gcov-1.gcno:0143:   3:ARCS 1 arcs
> gcov-1.gcno:0145:  18:LINES
> gcov-1.gcno:0145:  17:LINES
> gcov-1.gcno:0145:  17:LINES
> gcov-1.gcno:0145:  17:LINES
> gcov-1.gcno:0145:  17:LINES
> gcov-1.gcno:  0100:  19:FUNCTION ident=528394847,
> lineno_checksum=0xb7ad0113, cfg_checksum=0xa43083b8, `noop'
> src/gcc/testsuite/gcc.misc-tests/gcov-1.c:6
> gcov-1.gcno:0141:   1:BLOCKS 3 blocks
> gcov-1.gcno:0143:   3:ARCS 1 arcs
> gcov-1.gcno:0143:   3:ARCS 1 arcs
> gcov-1.gcno:0145:  18:LINES

There's the problem, for the file you sent me, I don't see the same:

$ ./gcov-dump /home/marxin/Programming/testcases/pr80911/gcov-1.gcno
/home/marxin/Programming/testcases/pr80911/gcov-1.gcno:note:magic
`gcno':version `A80e'
/home/marxin/Programming/testcases/pr80911/gcov-1.gcno:stamp 1402042784
/home/marxin/Programming/testcases/pr80911/gcov-1.gcno:  0100:  31:FUNCTION
ident=108032747, lineno_checksum=0xe78607ea, cfg_checksum=0x93d19550, `main'
/tmp/gcov-1.c:196608

while for my gcno file created I see the same what you can see:

$ ./gcov-dump gcov-1.gcno
gcov-1.gcno:note:magic `gcno':version `A80e'
gcov-1.gcno:stamp 1402876241
gcov-1.gcno:  0100:  25:FUNCTION ident=108032747,
lineno_checksum=0x3e291e10, cfg_checksum=0x93d19550, `main'
/home/marxin/Programming/gcc/gcc/testsuite/gcc.misc-tests/gcov-1.c:10
gcov-1.gcno:0141:   1:BLOCKS 8 blocks
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   5:ARCS 2 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   5:ARCS 2 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0145:  24:LINES
gcov-1.gcno:0145:  23:LINES
gcov-1.gcno:0145:  23:LINES
gcov-1.gcno:0145:  23:LINES
gcov-1.gcno:0145:  23:LINES
gcov-1.gcno:  0100:  25:FUNCTION ident=528394847,
lineno_checksum=0xdcf7a446, cfg_checksum=0xa43083b8, `noop'
/home/marxin/Programming/gcc/gcc/testsuite/gcc.misc-tests/gcov-1.c:6
gcov-1.gcno:0141:   1:BLOCKS 3 blocks
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0145:  24:LINES

You file is also much smaller:
marxin@marxinbox:~/Programming/gcc/objdir/gcc> l
/home/marxin/Programming/testcases/pr80911/gcov-1.gcno
-rw-r--r-- 1 marxin users 335 May 29 11:57
/home/marxin/Programming/testcases/pr80911/gcov-1.gcno
marxin@marxinbox:~/Programming/gcc/objdir/gcc> l gcov-1.gcno
-rw-r--r-- 1 marxin users 1056 May 29 11:51 gcov-1.gcno

That said can you please verify gcov --version and gcov-dump --version.
The gcno file should be flushed and closed in gcov_close function. Can you
please take a look?

Thanks,
Martin

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #5 from Tom de Vries  ---
(In reply to Martin Liška from comment #2)
> Can't confirm that, running trunk@248556 works fine for me.
> Utilizing valgrind also does not help.
> 
> Can you please run a single test manually:
> 
> $ gcc --coverage gcov-1.c
> $ ./a.out
> $ gcov gcov-1.c
> 

$ ./nobootstrap/install/bin/gcc --coverage
src/gcc/testsuite/gcc.misc-tests/gcov-1.c 
$ ./a.out ; echo $?
0
$ ./nobootstrap/install/bin/gcov gcov-1.c
gcov-1.gcno:corrupted
gcov-1.gcda:profile mismatch for 'main'
Segmentation fault

> And you can also test:
> $ gcov-dump gcov-1.gcno

$ ./nobootstrap/install/bin/gcov-dump gcov-1.gcno 
gcov-1.gcno:note:magic `gcno':version `A80e'
gcov-1.gcno:stamp 1402604930
gcov-1.gcno:  0100:  19:FUNCTION ident=108032747,
lineno_checksum=0x086adbf6, cfg_checksum=0x93d19550, `main'
src/gcc/testsuite/gcc.misc-tests/gcov-1.c:10
gcov-1.gcno:0141:   1:BLOCKS 8 blocks
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   5:ARCS 2 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   5:ARCS 2 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0145:  18:LINES
gcov-1.gcno:0145:  17:LINES
gcov-1.gcno:0145:  17:LINES
gcov-1.gcno:0145:  17:LINES
gcov-1.gcno:0145:  17:LINES
gcov-1.gcno:  0100:  19:FUNCTION ident=528394847,
lineno_checksum=0xb7ad0113, cfg_checksum=0xa43083b8, `noop'
src/gcc/testsuite/gcc.misc-tests/gcov-1.c:6
gcov-1.gcno:0141:   1:BLOCKS 3 blocks
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0143:   3:ARCS 1 arcs
gcov-1.gcno:0145:  18:LINES

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #4 from Tom de Vries  ---
Created attachment 41434
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41434&action=edit
gcov-1.tgz

$ tar cvfz gcov-1.tgz gcov-1.* 
gcov-1.exe
gcov-1.gcda
gcov-1.gcno

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #3 from Tom de Vries  ---
When run from command line:
...
nobootstrap/build/gcc/gcov gcov-1.c
gcov-1.gcno:corrupted
gcov-1.gcda:profile mismatch for 'main'
Segmentation fault
...

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-05-29
 Ever confirmed|0   |1

--- Comment #2 from Martin Liška  ---
Can't confirm that, running trunk@248556 works fine for me.
Utilizing valgrind also does not help.

Can you please run a single test manually:

$ gcc --coverage gcov-1.c
$ ./a.out
$ gcov gcov-1.c

And you can also test:
$ gcov-dump gcov-1.gcno

[Bug gcov-profile/80911] gcov failed: gcno corrupted

2017-05-29 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80911

--- Comment #1 from Tom de Vries  ---
Configured as:
...
$ xgcc -v
Using built-in specs.
COLLECT_GCC=./nobootstrap/build/gcc/xgcc
Target: x86_64-pc-linux-gnu
Configured with: src/configure --prefix=nobootstrap/install --with-gmp=infra
--with-mpfr=infra --with-mpc=infra --with-isl=infra --with-cloog=infra
--with-ppl=infra --disable-bootstrap --enable-checking=yes,rtl
--enable-languages=c,c++,fortran,go,lto,objc,obj-c++
Thread model: posix
gcc version 8.0.0 20170524 (experimental) (GCC) 
...