Package: ccache
Version: 3.1.10-1
Severity: important
Tags: patch

ccache 3.1.10 have regression in compare with 3.1.9 and earlier versions.

Using ninja-build + ccache + some heavy cpp code which take long time to
compile.

1)run ninja
2)ninja execute several ccache processes
3)ccaches run real compiler
4)while compiler is running press CTRL-C (or run kill -TERM|-INT <ninja_pid>)
5)ninja catch termination signal and sends same signal to all child process
groups (every ccache+compiler was executed in own process group)
6)real compiler get signal and immediately exits
7)ccache get signal and just remove some own tempo files
8)ccache get SIGCHLD after childish compiler process, thinks that something
fails and continue using 'fallback' function - i.e. running compiler again
instead exiting
9)next CTRL-Cs is ignored by ninja and it is needed to manually run
kill/killall to stop build process

ccache 3.1.9 and earlier don't have this bug.
ccache 3.2.3 and newer contain fix.
3.2.3 contain very simple fix which can be easily backported(patch included)
into 3.1.10.
3.2.4 have better but more complex fix.



-- System Information:
Debian Release: 8.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-0.bpo.1-amd64 (SMP w/4 CPU cores)
Locale: LANG=ru_RU.utf8, LC_CTYPE=ru_RU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages ccache depends on:
ii  libc6   2.19-18+deb8u4
ii  zlib1g  1:1.2.8.dfsg-2+b1

ccache recommends no packages.

Versions of packages ccache suggests:
ii  distcc  3.1-6.1
>From a05980aeeefed3a5f6e68bd8c9b37124ecdb8f03 Mon Sep 17 00:00:00 2001
From: Joel Rosdahl <[email protected]>
Date: Sun, 9 Aug 2015 22:07:11 +0200
Subject: [PATCH] Exit properly from exit handler

This fixes a problem where two SIGINT (Ctrl+C) signals were needed to
terminate an ongoing compilation. (The first SIGINT terminated the
compiler which exited with non-zero status, which ccache then went on
interpreting as an ordinary failed compilation, leading to rerunning the
compiler via failed().)
---
 ccache.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ccache.c b/ccache.c
index f0dca22..de63cfe 100644
--- a/ccache.c
+++ b/ccache.c
@@ -264,6 +264,7 @@ signal_handler(int signo)
 {
 	(void)signo;
 	clean_up_pending_tmp_files();
+	_exit(1);
 }
 
 static void
-- 
2.1.4

>From a05980aeeefed3a5f6e68bd8c9b37124ecdb8f03 Mon Sep 17 00:00:00 2001
From: Joel Rosdahl <[email protected]>
Date: Sun, 9 Aug 2015 22:07:11 +0200
Subject: [PATCH] Exit properly from exit handler

This fixes a problem where two SIGINT (Ctrl+C) signals were needed to
terminate an ongoing compilation. (The first SIGINT terminated the
compiler which exited with non-zero status, which ccache then went on
interpreting as an ordinary failed compilation, leading to rerunning the
compiler via failed().)
---
 ccache.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ccache.c b/ccache.c
index f0dca22..de63cfe 100644
--- a/ccache.c
+++ b/ccache.c
@@ -264,6 +264,7 @@ signal_handler(int signo)
 {
 	(void)signo;
 	clean_up_pending_tmp_files();
+	_exit(1);
 }
 
 static void
-- 
2.1.4

Reply via email to