Bug 1227819

Summary: [abrt] ccache: exit(): ccache killed by SIGSEGV
Product: [Fedora] Fedora Reporter: Dawid Zamirski <dzrudy>
Component: ccacheAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: joel, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/aa4ea7237c0e62e986f4e4cd8799884f9c7f0162
Whiteboard: abrt_hash:c9a522f6eb0d71f251cc776a1e2c809ca20b09e6
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 10:04:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: core_backtrace
none
File: dso_list
none
File: environ
none
File: limits
none
File: maps
none
File: mountinfo
none
File: namespaces
none
File: open_fds
none
File: proc_pid_status none

Description Dawid Zamirski 2015-06-03 14:45:18 UTC
Description of problem:
Tried to generate YouCompleteMe config file using a generator from:
https://github.com/rdnetto/YCM-Generator

as a VIM plugin. The file generated successfully, though this crash report popped up.

Version-Release number of selected component:
ccache-3.2.2-1.fc22

Additional info:
reporter:       libreport-2.5.1
backtrace_rating: 4
cmdline:        /usr/lib64/ccache/clang --version
crash_function: exit
executable:     /usr/bin/ccache
global_pid:     24221
kernel:         4.0.4-301.fc22.x86_64
runlevel:       N 5
type:           CCpp
uid:            1000
var_log_messages: [System Logs]:\n-- Logs begin at Sat 2015-04-11 03:48:15 EDT, end at Wed 2015-06-03 10:36:10 EDT. --

Truncated backtrace:
Thread no. 1 (10 frames)
 #3 exit at exit.c:104
 #4 fatal at util.c:201
 #5 create_tmp_fd at util.c:1200
 #6 create_tmp_file at util.c:1219
 #7 stats_write at stats.c:135
 #8 stats_flush at stats.c:228
 #9 call_nullary_exit_function at exitfn.c:37
 #10 exitfn_call at exitfn.c:88
 #11 failed at ccache.c:276
 #12 calculate_common_hash at ccache.c:1244

Comment 1 Dawid Zamirski 2015-06-03 14:45:20 UTC
Created attachment 1034366 [details]
File: backtrace

Comment 2 Dawid Zamirski 2015-06-03 14:45:21 UTC
Created attachment 1034367 [details]
File: cgroup

Comment 3 Dawid Zamirski 2015-06-03 14:45:21 UTC
Created attachment 1034368 [details]
File: core_backtrace

Comment 4 Dawid Zamirski 2015-06-03 14:45:22 UTC
Created attachment 1034369 [details]
File: dso_list

Comment 5 Dawid Zamirski 2015-06-03 14:45:23 UTC
Created attachment 1034370 [details]
File: environ

Comment 6 Dawid Zamirski 2015-06-03 14:45:23 UTC
Created attachment 1034371 [details]
File: limits

Comment 7 Dawid Zamirski 2015-06-03 14:45:24 UTC
Created attachment 1034372 [details]
File: maps

Comment 8 Dawid Zamirski 2015-06-03 14:45:25 UTC
Created attachment 1034373 [details]
File: mountinfo

Comment 9 Dawid Zamirski 2015-06-03 14:45:25 UTC
Created attachment 1034374 [details]
File: namespaces

Comment 10 Dawid Zamirski 2015-06-03 14:45:26 UTC
Created attachment 1034375 [details]
File: open_fds

Comment 11 Dawid Zamirski 2015-06-03 14:45:27 UTC
Created attachment 1034376 [details]
File: proc_pid_status

Comment 12 Ville Skyttä 2015-06-03 17:21:47 UTC
Something wrong with error handling? From the backtrace:

#4  0x0000000000408d19 in fatal (format=format@entry=0x413462 "Failed to create file %s: %s") at util.c:201
[...]
        msg = "Failed to create file /home/dzamirski/.ccache/3/stats.tmp.dawid-fedora.24221.BTyN3P: Too many open files[...]
#5  0x0000000000409ca7 in create_tmp_fd (fname=fname@entry=0x7ffc6749be80) at util.c:1200

Comment 13 Joel Rosdahl 2015-06-03 19:18:58 UTC
The problem seems to be that exit() is called inside an exit handler. This does not lead to a recursive call to the exit handler function (or a crash) on my system, but apparently it does in your case, and it's indeed not portable to assume that it works.

Proposed fix: https://git.samba.org/?p=ccache.git;a=patch;h=94085e8a219c0015acc27fff99df16ee8ebe60c3;hp=0220de9c8ebfb18caae2ac1aa163d060e98ceade

Comment 14 Ville Skyttä 2015-06-03 20:15:21 UTC
I tried to provoke the crash with unmodified ccache 3.2.2 on Fedora 22 x86_64 by clearing my ~/.ccache, then making it read only, then trying to build something but did not get any crashes, just the expected "ccache: error: Failed to create file [...]: Permission denied" error messages. Can you suggest a better recipe to try out?

Comment 15 Fedora Update System 2015-08-17 06:41:03 UTC
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 16 Fedora Update System 2015-08-17 07:11:26 UTC
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 17 Fedora Update System 2015-08-19 08:10:44 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:
https://admin.fedoraproject.org/updates/FEDORA-2015-13702/ccache-3.2.3-1.fc22
then log in and leave karma (feedback).

Comment 18 Fedora Update System 2015-09-03 10:04:28 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 19 Fedora Update System 2015-11-10 00:24:24 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.