Bug 10869 - git version: make test fails: SUITE: "base", TEST: "profile-use" - Expected "files in cache" to be 4, got 3
Summary: git version: make test fails: SUITE: "base", TEST: "profile-use" - Expected "...
Status: CLOSED FIXED
Alias: None
Product: ccache
Classification: Unclassified
Component: ccache (show other bugs)
Version: dev
Hardware: All All
: P5 normal
Target Milestone: 3.2
Assignee: Joel Rosdahl
QA Contact: Joel Rosdahl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-11 15:24 UTC by ishikawa
Modified: 2014-11-17 19:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ishikawa 2014-10-11 15:24:43 UTC
Repeat-by:

$ git clone git://git.samba.org/ccache.git
$ cd ccache
$ ./autogen.sh
$ ./configure
$ make test
 ...
 ... fails with ...

SUITE: "base", TEST: "profile-use" - Expected "files in cache" to be 4, got 3


Noticed while I was trying to synchronize my local patch to support
-gsplit-dwarf with the dev git repository.

tIA
Comment 1 ishikawa 2014-10-14 03:38:29 UTC
I notice an anomaly.
The original report was done on 64-bit version 
of Jessie (experimental, and to be the next major version when released) version 
Debian GNU/Linux.
And testing was done on 64-bit version.

Today, I checked the operation with the same procedure
on a 32-bit version of the current release, Wheezy, of Debian GNU/Linux.

Then the test succeeded!

Something is funny.
I will report back the exact GCC version
used on 64-bit Jessie release where |make test|  failed.

On 32-bit Debian GNU/Linux Wheezy, the ccache was compiled by
gcc (Debian 4.8.2-16) 4.8.2, and test succeeded.


TIA

PS: Synchronization of the locally hacked version of ccache that 
handles -gsplit-dwarf flag is going along rather well.
It runs |make test| successfully on 32-bit Debian GNU/Linux, wheezy, and
so hopefully it does not introduce new bugs for compilation 
(without -gsplit-dwarf), and
it seems to work for compiling mozilla thunderbird
with -gsplit-dwarf well so far.)
Comment 2 ishikawa 2014-10-14 06:26:33 UTC
I think I found the reason.

Compiler version issues.

I compiled ccache with gcc-4.9 on Debian GNU/Linux, Wheezy, 32-bit (where
ccache passed |make test| with gcc-4.8).
Now this time |make test| failed with the following error, the same error
as in the original posting.

So I think this is a compiler version issue:

|make test| failure with gcc-4.9

gcc-4.9 -g -O2 -Wall -W -Werror -o test/main ccache.o mdfour.o hash.o execute.o util.o args.o stats.o version.o cleanup.o snprintf.o unify.o manifest.o hashtable.o hashtable_itr.o murmurhashneutral2.o hashutil.o getopt_long.o exitfn.o lockfile.o counters.o language.o compopt.o conf.o test/main.o test/framework.o test/util.o ./test/test_args.o ./test/test_argument_processing.o ./test/test_compopt.o ./test/test_conf.o ./test/test_counters.o ./test/test_hash.o ./test/test_hashutil.o ./test/test_lockfile.o ./test/test_stats.o ./test/test_util.o -lz   -lm 
test/main
PASSED: 441 assertions, 86 tests, 10 suites
CC='gcc-4.9' ./test.sh
compiler: /usr/bin/gcc-4.9
version: gcc-4.9 (Debian 4.9.0-6) 4.9.0 Copyright (C) 2014 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.
test dir: testdir.11169
starting testsuite base
SUITE: "base", TEST: "profile-use" - Expected "files in cache" to be 4, got 3
cache directory                     /home/ishikawa/repos/ccache/testdir.11169/.ccache
primary config                      /home/ishikawa/repos/ccache/testdir.11169/.ccache/ccache.conf
secondary config      (readonly)    /usr/local/etc/ccache.conf
cache hit (direct)                     0
cache hit (preprocessed)               2
cache miss                             3
files in cache                         3
cache size                          12.3 kB
max cache size                       5.0 GB
TEST FAILED
Test data and log file have been left in testdir.11169
Makefile:81: recipe for target 'test' failed
make: *** [test] Error 1
ishikawa@debian-vbox-ci:/home/ishikawa/repos/ccache$ 

   Incidentally, the cache under testdir.11169 has these files.

ishikawa@debian-vbox-ci:/home/ishikawa/repos/ccache/testdir.11169/.ccache$ find . -type f -print
./8/stats
./a/stats
./CACHEDIR.TAG
./c/stats
./b/stats
./3/stats
./5/stats
./1/stats
./e/stats
./2/stats
./9/stats
./7/stats
./d/stats
./ccache.conf
./4/stats
./6/stats
./6/f/169e39f2bd8cfc8a250dc449cb5cb7-298.o
./0/e/c60b43c486ca54a9c6b664b44a82e9-344.o
./0/stats
./f/stats
./f/0/0dea6ac30bc85d11aad6d05e55895d-340.o
ishikawa@debian-vbox-ci:/home/ishikawa/repos/ccache/testdir.11169/.ccache$ 


===== cf.  |make test| success with gcc-4.8

gcc-4.8 -g -O2 -Wall -W -Werror -o test/main ccache.o mdfour.o hash.o execute.o util.o args.o stats.o version.o cleanup.o snprintf.o unify.o manifest.o hashtable.o hashtable_itr.o murmurhashneutral2.o hashutil.o getopt_long.o exitfn.o lockfile.o counters.o language.o compopt.o conf.o test/main.o test/framework.o test/util.o ./test/test_args.o ./test/test_argument_processing.o ./test/test_compopt.o ./test/test_conf.o ./test/test_counters.o ./test/test_hash.o ./test/test_hashutil.o ./test/test_lockfile.o ./test/test_stats.o ./test/test_util.o -lz   -lm 
test/main
PASSED: 441 assertions, 86 tests, 10 suites
CC='gcc-4.8' ./test.sh
compiler: /usr/bin/gcc-4.8
version: gcc-4.8 (Debian 4.8.2-16) 4.8.2 Copyright (C) 2013 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.
test dir: testdir.14513
starting testsuite base
starting testsuite link
starting testsuite hardlink
starting testsuite cpp2
starting testsuite nlevels4
starting testsuite nlevels1
starting testsuite basedir
starting testsuite direct
starting testsuite compression
starting testsuite readonly
starting testsuite extrafiles
starting testsuite cleanup
starting testsuite pch
starting testsuite upgrade
starting testsuite prefix
test done - OK

During |make test| using gcc-4.8, at the place, where |make test| failed with gcc-4.9,
the ccache directory contains the following (note the extra *.stderr file, and
*.stderr contains the message that is after the file listing.

Before checking files in cache part-1
/home/ishikawa/repos/ccache/testdir.16109/.ccache/8/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/8/0/3cf637d55ac793c5f3e6b3aea9ed92-323.o
/home/ishikawa/repos/ccache/testdir.16109/.ccache/a/8/f26c7524a02b1e5dcfed8bc670fe2e-281.o
/home/ishikawa/repos/ccache/testdir.16109/.ccache/a/8/f26c7524a02b1e5dcfed8bc670fe2e-281.stderr
/home/ishikawa/repos/ccache/testdir.16109/.ccache/a/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/CACHEDIR.TAG
/home/ishikawa/repos/ccache/testdir.16109/.ccache/c/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/b/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/3/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/5/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/1/2/0c5cc1222a6da44209448c54f3db49-327.o
/home/ishikawa/repos/ccache/testdir.16109/.ccache/1/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/e/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/2/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/9/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/7/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/d/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/ccache.conf
/home/ishikawa/repos/ccache/testdir.16109/.ccache/4/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/6/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/0/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache/f/stats
/home/ishikawa/repos/ccache/testdir.16109/.ccache

Content of /a/8/f26c7524a02b1e5dcfed8bc670fe2e-281.stderr:
test1.c: In function 'foo10':
test1.c:1:1: note: file /home/ishikawa/repos/ccache/testdir.16109/test1.gcda not found, execution counts assumed to be zero
 int foo10(int x) { return x; }
 ^


So it is due to the warning of the compiler what the user of ccache is using.
If gcc-4.9 is used, I think it does not produce the "execution counts assumed to be zero" warning, thus the count mismatch.


Hope this helps.
Comment 3 Joel Rosdahl 2014-11-15 14:47:51 UTC
Thanks for the analysis!

Fixed in 5b8a6e4ff8ce630cfd9357715413fd7b7fad7023 on master by removing the "number of files in cache" check.
Comment 4 Joel Rosdahl 2014-11-17 19:24:45 UTC
Included in v3.2.