Commit Graph

6 Commits

Author SHA1 Message Date
Michael Kerrisk a721e8b25f aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-18 00:59:04 +02:00
Michael Kerrisk afa27faacf Removed trailing white space at end of lines 2017-03-13 21:17:48 +01:00
Michael Kerrisk 31a1b45ece add_key.2, execve.2, fork.2, fsync.2, getrandom.2, getrlimit.2, getxattr.2, inotify_add_watch.2, ioctl.2, ioctl_fat.2, kcmp.2, keyctl.2, link.2, listxattr.2, lseek.2, madvise.2, mincore.2, mlock.2, nanosleep.2, poll.2, posix_fadvise.2, read.2, readv.2, recv.2, request_key.2, select.2, send.2, setxattr.2, sigaction.2, stat.2, statfs.2, syscall.2, tkill.2, truncate.2, unlink.2, vfork.2, write.2, __ppc_set_ppr_med.3, aio_suspend.3, backtrace.3, bcmp.3, bcopy.3, bzero.3, exec.3, fopen.3, fts.3, ftw.3, getline.3, getmntent.3, getopt.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, memset.3, random.3, random_r.3, resolver.3, scandir.3, scanf.3, sem_post.3, sem_wait.3, setjmp.3, sleep.3, strerror.3, strverscmp.3, system.3, random.4, core.5, intro.5, resolv.conf.5, slabinfo.5, environ.7, ip.7, keyrings.7, man.7, persistent-keyring.7, pipe.7, process-keyring.7, random.7, session-keyring.7, signal-safety.7, signal.7, thread-keyring.7, unix.7, user-keyring.7, user-session-keyring.7, ld.so.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-03-13 21:14:49 +01:00
Michael Kerrisk 67557cd9d1 signal-safety.7: Note async-signal-safety problems caused by pthread_atfork()
See https://bugzilla.kernel.org/show_bug.cgi?id=25292

And there will likely be future changes as well.
Quoting http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt:

    COMMENT                          Enhancement Request Number 15
    rajani.g.k:xxxxxx               Defect in XSH 2.4.3 (rdvk#  6)
    {GKRFORK012009}                   Thu, 8 Jan 2009 07:41:10 GMT

    [...]

    As per this section, XSH P1529, L49389-49402, it is possible
    that multithreaded libraries could be used by single threaded
    applications. In which case, atfork handlers are essential for
    the libraries to protect their internal state during fork. As
    explained further P1530, L49403-49404, pthread_atfork
    functions are mainly required to acquire/release mutex locks,
    for protecting the applications/libraries from fork() calls.
    C-library needs to as well have an atfork handler which
    acquires all the required locks to protect its memory state
    across fork().

    The acquire/release mutex calls themselves are aync-signal
    unsafe operations. Use of them makes pthread_atfork handlers
    async-signal unsafe which in turn makes fork() async-signal
    unsafe when called by an application which is multi threaded,
    or which is linked to a library which is multi threaded.

    Action:

    Need clarification with respect to
    1. Is it correct to list fork as an async-signal safe
    interface, in a multi threaded scenario?

    2. Can the implementation be allowed to not call the atfor
    handlers, when fork is called from a signal handler? If the
    atfork handlers are not going to be called when fork is called
    in the signal handler, then they can not be called, even if
    fork is called in the newly created child before exec.

    3. If only async-signal safe functions are to be called from
    pthread_atfork handlers, then how will multi-threaded librarie
    protect themselves by the fork calls, made by single threaded
    applications linked to them?

Reported-by: KASAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-12 12:53:05 +01:00
Michael Kerrisk fb16ec3585 signal-safety.7: Note glibc deviations from POSIX requirements
See https://bugzilla.kernel.org/show_bug.cgi?id=25292

Reported-by: KASAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-12 12:53:05 +01:00
Michael Kerrisk d1329af1f3 signal-safety.7, signal.7: Migrate discussion of async-signal-safe functions to new page
Also:
* add more detail on changes across standards
* provide proper section cross references in function references

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-12 12:53:05 +01:00