Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1607938

Summary: documentation of WCOREDUMP() vs. setrlimit()
Product: Red Hat Enterprise Linux 7 Reporter: Eric Blake <eblake>
Component: man-pagesAssignee: Nikola Forró <nforro>
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: ashankar, codonell, dj, eblake, fweimer, mnewsome, pfrankli
Target Milestone: rc   
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: 2021-02-15 07:40:53 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:
Embargoed:

Description Eric Blake 2018-07-24 15:02:15 UTC
Description of problem:
From an IRC conversation:
<eblake> does anyone know if waitpid()'s WCOREDUMP() macro reports core dump even when setrlimit() has disabled core dumps (aka 'ulimit -c 0')?
<ajax> eblake: yes it does. see fs/coredump.c:zap_threads() for the details, but in short WCOREDUMP() means whether the signal _would_ produce a core if possible.
<eblake> ajax: thanks. 'man waitpid' and 'man getrlimit' did not make that obvious
<eblake> nor 'man core'
<ajax> yeah, i had to read the kernel to be sure
<ajax> it's a bad habit. i should probably submit a doc patch every time i have to do that

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


How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:
no mention of getrlimit near WCOREDUMP in the man pages

Expected results:
document that WCOREDUMP is reliable for detecting if a process would have dumped core, even when no core file was created

Additional info:

Comment 2 Eric Blake 2018-07-24 15:07:33 UTC
<eblake> $ ulimit -S -c 0
<eblake> $ cat foo.c
<eblake> int main(int argc, char **argv) {
<eblake>   return *argv[1];
<eblake> }
<eblake> $ gcc -o foo -Wall foo.c
<eblake> $ ./foo 1
<eblake> $ ./foo
<eblake> Segmentation fault (core dumped)
<eblake> $ 
<eblake> looks like bash detected core dump, even with it disabled

Comment 3 Florian Weimer 2018-07-24 15:11:20 UTC
I submitted this upstream.  Note that a change to the manual pages will have to be requested through the manpages-dev package (the manual pages are completely separate).

Comment 4 Eric Blake 2018-07-24 19:30:41 UTC
(In reply to Florian Weimer from comment #3)
> I submitted this upstream.  Note that a change to the manual pages will have
> to be requested through the manpages-dev package (the manual pages are
> completely separate).

reassigning from glibc to man-pages, then

Comment 5 Eric Blake 2018-07-31 12:12:10 UTC
Hmm - according to this mail:

https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg05842.html

WCOREDUMP() may not be completely reliable on whether a core dump will occur, depending on kernel settings.  I wonder if this bug also needs to be cloned to the kernel to actually make the bit reliable regardless of 'ulimit -c 0'.

Comment 8 RHEL Program Management 2021-02-15 07:40:53 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.