Bug 1372404

Summary: systemd-coredump writes empty core dump files
Product: [Fedora] Fedora Reporter: Michal Schmidt <mschmidt>
Component: systemdAssignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: johannbg, jsynacek, j, lnykryn, msekleta, muadda, ssahani, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-02 05:11:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Michal Schmidt 2016-09-01 15:29:31 UTC
systemd-229-13.fc24.x86_64

The F24-specific patch 0045-coredump-ignore-RLIMIT_CORE.patch removes the initialization of the 'rlimit' variable in save_external_coredump(). This uninitialized value enters into the calculation of 'max_size':

 max_size = MIN(rlimit, MAX(arg_process_size_max, arg_external_size_max));

In #systemd Jason Tibbitts reported getting zero-length core files on F24.
The above mistake should explain it.

Comment 1 Michal Schmidt 2016-09-01 15:32:10 UTC
A relevant compiler warning can be seen in Koji build.log
https://kojipkgs.fedoraproject.org//packages/systemd/229/13.fc24/data/logs/x86_64/build.log:

src/coredump/coredump.c: In function 'save_external_coredump':
src/coredump/coredump.c:323:20: warning: 'rlimit' may be used uninitialized in this function [-Wmaybe-uninitialized]
         max_size = MIN(rlimit, MAX(arg_process_size_max, arg_external_size_max));
                    ^
src/coredump/coredump.c:307:18: note: 'rlimit' was declared here
         uint64_t rlimit, max_size;

Comment 2 Jan Synacek 2016-09-02 05:11:05 UTC

*** This bug has been marked as a duplicate of bug 1371709 ***