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 1330661 - Add some error codes to clone manpage
Summary: Add some error codes to clone manpage
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: man-pages-overrides
Version: 7.3
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: 7.3
Assignee: Nikola Forró
QA Contact: Iveta Wiedermann
URL:
Whiteboard:
Depends On:
Blocks: 1274917 1330663 1349850 1364088
TreeView+ depends on / blocked
 
Reported: 2016-04-26 16:46 UTC by Ben Woodard
Modified: 2016-11-04 07:31 UTC (History)
4 users (show)

Fixed In Version: man-pages-overrides-7.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1330663 (view as bug list)
Environment:
Last Closed: 2016-11-04 07:31:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2485 0 normal SHIPPED_LIVE man-pages-overrides bug fix and enhancement update 2016-11-03 14:09:10 UTC

Description Ben Woodard 2016-04-26 16:46:56 UTC
Description of problem:
the clone syscall can return with some error codes that are not documented in the man page. In particular:

  ERESTARTSYS = 512 (To be restarted if SA_RESTART is set)
    Most common type of signal-interrupted syscall exit code.  The
    system call will be restarted with the same arguments if
    SA_RESTART is set; otherwise, it will fail with EINTR.

  ERESTARTNOINTR = 513 (To be restarted)
    Rare. For example, fork() returns this if interrupted.
    SA_RESTART is ignored (assumed set): the restart is
    unconditional.

  ERESTARTNOHAND = 514  (To be restarted if no handler)
    pause(), rt_sigsuspend() etc use this code.  SA_RESTART is
    ignored (assumed not set): syscall won't restart (will return
    EINTR instead) even after signal with SA_RESTART set. However,
    after SIG_IGN or SIG_DFL signal it will restart (thus the name
    "restart only if has no handler").

  ERESTART_RESTARTBLOCK = 516 (Interrupted by signal)
    Syscalls like nanosleep(), poll() which can't be restarted with
    their original arguments use this code. Kernel will execute
    restart_syscall() instead, which changes arguments before
    restarting syscall.  SA_RESTART is ignored (assumed not set)
    similarly to ERESTARTNOHAND. (Kernel can't honor SA_RESTART
    since restart data is saved in "restart block" in task struct,
    and if signal handler uses a syscall which in turn saves
    another such restart block, old data is lost and restart
    becomes impossible)


Version-Release number of selected component (if applicable):
This is true for all man pages right up until the latest version in Fedora.

Comment 2 Nikola Forró 2016-04-27 09:59:48 UTC
Hello Ben,

are you sure that clone syscall can return these error codes?

Quoting include/linux/errno.h [1]:

These should never be seen by user programs.  To return one of ERESTART*
codes, signal_pending() MUST be set.  Note that ptrace can observe these
at syscall exit tracing, but they will never be left for the debugged user
process to see.

So if you are seeing these error codes in strace output, it doesn't mean that they can actually be seen from userspace application.

Regards,
Nikola

[1] https://github.com/torvalds/linux/blob/master/include/linux/errno.h

Comment 4 Nikola Forró 2016-05-03 11:59:21 UTC
OK, since from these ERESTART* error codes clone syscall can return only ERESTARTNOINTR, I think something like this could be added to the man page:

ERESTARTNOINTR (since Linux 2.6.17)
    System call was interrupted by a signal and will be restarted.
    (This can be seen only during a trace.)


The same should be probably added to the fork(2) man page.
What do you think, Ben?

Comment 5 Ben Woodard 2016-05-03 17:39:54 UTC
I just conferred with the customer and they have not seen any of the other error codes in practice and so we think that your suggested addition would be sufficient.

Comment 6 Nikola Forró 2016-05-10 09:10:01 UTC
Upstream patch:
http://www.spinics.net/lists/linux-man/msg10249.html

Comment 15 errata-xmlrpc 2016-11-04 07:31:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2485.html


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