Bug 1607938 - documentation of WCOREDUMP() vs. setrlimit()
Summary: documentation of WCOREDUMP() vs. setrlimit()
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: man-pages
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Nikola Forró
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-24 15:02 UTC by Eric Blake
Modified: 2021-02-15 07:40 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-15 07:40:53 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Sourceware 23449 0 None None None 2019-08-07 13:00:33 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.