Bug 1247493 - ccache prevents interrupt from killing compilation
ccache prevents interrupt from killing compilation
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: ccache (Show other bugs)
23
All All
unspecified Severity high
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-28 03:23 EDT by Nadav Har'El
Modified: 2015-11-09 19:24 EST (History)
2 users (show)

See Also:
Fixed In Version: 3.2.3-1.fc23 ccache-3.2.3-1.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-03 06:04:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nadav Har'El 2015-07-28 03:23:59 EDT
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:
https://lists.samba.org/archive/ccache/2015q3/001311.html

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
slower):

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 13:58:09 EDT
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 16:31:02 EDT
Hi,

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 02:41:05 EDT
ccache-3.2.3-1.fc23 has been submitted as an update for Fedora 23.
https://admin.fedoraproject.org/updates/ccache-3.2.3-1.fc23
Comment 4 Fedora Update System 2015-08-17 03:11:27 EDT
ccache-3.2.3-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/ccache-3.2.3-1.fc22
Comment 5 Fedora Update System 2015-08-19 04:10:45 EDT
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:
https://admin.fedoraproject.org/updates/FEDORA-2015-13702/ccache-3.2.3-1.fc22
then log in and leave karma (feedback).
Comment 6 Fedora Update System 2015-09-03 06:04:27 EDT
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-09 19:24:27 EST
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.