Bug 1247493 - ccache prevents interrupt from killing compilation
Summary: ccache prevents interrupt from killing compilation
Alias: None
Product: Fedora
Classification: Fedora
Component: ccache
Version: 23
Hardware: All
OS: All
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2015-07-28 07:23 UTC by Nadav Har'El
Modified: 2015-11-10 00:24 UTC (History)
2 users (show)

Fixed In Version: 3.2.3-1.fc23 ccache-3.2.3-1.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-09-03 10:04:33 UTC

Attachments (Terms of Use)

Description Nadav Har'El 2015-07-28 07:23:59 UTC
Description of problem:

When trying to interrupt a long compilation using ccache with control-C, it doesn't work correctly. The first interrupt appears to be ignore but what it really does is to restart (!) the compilation. The second interrupt works as expected.

While this might look like a minor annoyance (just press control-C again to kill it...), it causes more serious problems when the compiler is used from a make system like "make" or especially "ninja-build", and causes control-C to not stop the build until all compilation processes are done.

Also, this problem is especially annoying because merely installing the "ccache" package replaces all your compilers with ccache, so a user might be using ccache without even noticing, so every place ccache deviates from normal compiler behavior is really unwelcome.

I reported this bug, and a 4-line patch for it, to upstream, but so far they've ignored it:

Version-Release number of selected component (if applicable):

Ccache 3.2.2

How reproducible:

Consider the following C++ program from hell that takes 13 seconds to
compile on my machine (change "27" to a higher number to make it even

template <int TreePos, int N> struct FibSlow_t {
    enum { value = FibSlow_t<TreePos, N - 1>::value +
            FibSlow_t<TreePos + (1 << N), N - 2>::value, };
template <int TreePos> struct FibSlow_t<TreePos, 2> { enum { value = 1 }; };
template <int TreePos> struct FibSlow_t<TreePos, 1> { enum { value = 1 }; };
static int s_value = FibSlow_t<0, 27>::value;

Compile this with: "CCACHE_RECACHE=1 ccache g++ -c example.cc"

Expected results:
  pressing control-C stops the compilation immediately.

Actual results:
  * The first control-C is seemingly ignored and compilation continues to the end. But if you check what really happened, the compilation *was* killed (the SIGINT was sent to it as well), but ccache decided to restart it!
  * If you press control-C for a second time, it works (stops compilation immediately).

Comment 1 Ville Skyttä 2015-07-28 17:58:09 UTC
Ccing upstream here as well. It's been only a few days since your post, I'm sure they'll take a look at it time permitting.

Comment 2 Joel Rosdahl 2015-08-09 20:31:02 UTC

Thanks for the bug report. This will be fixed in ccache 3.2.3.

> I reported this bug, and a 4-line patch for it, to upstream, but so far
> they've ignored it

Using the word "ignored" to say "have not yet had time to answer" is technically correct but it certainly doesn't make me more motivated to fix it in my free time.

Comment 3 Fedora Update System 2015-08-17 06:41:05 UTC
ccache-3.2.3-1.fc23 has been submitted as an update for Fedora 23.

Comment 4 Fedora Update System 2015-08-17 07:11:27 UTC
ccache-3.2.3-1.fc22 has been submitted as an update for Fedora 22.

Comment 5 Fedora Update System 2015-08-19 08:10:45 UTC
Package ccache-3.2.3-1.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing ccache-3.2.3-1.fc22'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2015-09-03 10:04:27 UTC
ccache-3.2.3-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2015-11-10 00:24:27 UTC
ccache-3.2.3-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.