This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v5 0/3] posix: Execute file function fixes
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Wed, 2 Mar 2016 15:47:17 -0300
- Subject: Re: [PATCH v5 0/3] posix: Execute file function fixes
- Authentication-results: sourceware.org; auth=none
- References: <1456770820-21341-1-git-send-email-adhemerval dot zanella at linaro dot org>
I believe with latest comments from Paul Eggert I see these patchset is ok
for master. So I would like to commit it shortly if no one opposes it.
On 29-02-2016 15:33, Adhemerval Zanella wrote:
> This is an update from my previous patchset with fixes based on previous
> comments. The differences from previous version are:
>
> * Small fixes on argument handling in exec{l,p} functions.
>
> * Change argument handling from using int to ptrdiff_t.
>
> * Fix argument allocation for script execution.
>
> * Fix empty argument vector for script execution on execvpe and
> compatibility code on posix_spawn{p}.
>
> * Some internal execvpe fixes.
>
> * Various comment typos and wordings.
>
> * Assume pipe2 is always available.
>
> --
>
> This patchset add some cleanup and fixes for the exec{l,le,lp,vpe}
> general function implementation and fixes long standing bugs for
> posix_spawn{p} on Linux. It is basically my previous 2 patchset
> for execvpe and posix_spawn{p} along with the execl{e,p} fixes.
>
> For exe{l,le,lp,vpe} function main difference is using stack allocation
> instead of dynamic one for argument handling. The main difference from
> previous patch iteration is it does not add any memory stack allocation
> constraints due:
>
> 1. Current GLIBC logic to limit stack allocation through __MAX_ALLOCA_CUTOFF
> is arbitrary and does no impose any limit (it does not consider current
> stack size neither stack size limit).
>
> 2. Memory allocation constraints associated with the functions make
> stack allocation the only sane option. All exec function family are
> defined to be async-safe, where they can be called either through a
> signal handler or in vfork child, and they can not really on dynamic
> memory allocation (either through malloc or directly by mmap).
>
> The posix_spawn{p} is a new implementation for Linux which aims to
> fix some long-standing bug regarding signal handling. It also
> tries to avoid dynamic memory allocation by either relying on the
> exec{l,vpe} functions with a dynamic mmap memory region allocate
> to use along with direct created child (using clone syscall).
>
> Adhemerval Zanella (3):
> posix: Remove dynamic memory allocation from execl{e,p}
> posix: execvpe cleanup
> posix: New Linux posix_spawn{p} implementation
>
> ChangeLog | 54 +++
> include/sched.h | 2 +
> include/unistd.h | 1 +
> posix/Makefile | 5 +-
> posix/execl.c | 68 ++--
> posix/execle.c | 70 ++--
> posix/execlp.c | 66 ++--
> posix/execvpe.c | 253 ++++++--------
> posix/tst-execvp1.c | 6 +-
> posix/tst-execvp2.c | 5 +-
> posix/tst-execvp3.c | 5 +-
> posix/tst-execvp4.c | 6 +-
> posix/tst-execvpe1.c | 20 ++
> posix/tst-execvpe2.c | 20 ++
> posix/tst-execvpe3.c | 20 ++
> posix/tst-execvpe4.c | 20 ++
> posix/tst-execvpe5.c | 157 +++++++++
> posix/tst-execvpe6.c | 150 ++++++++
> posix/tst-spawn2.c | 73 ++++
> sysdeps/posix/dup.c | 2 +-
> sysdeps/unix/sysv/linux/aarch64/clone.S | 1 +
> sysdeps/unix/sysv/linux/alpha/clone.S | 1 +
> sysdeps/unix/sysv/linux/arm/clone.S | 1 +
> sysdeps/unix/sysv/linux/hppa/clone.S | 1 +
> sysdeps/unix/sysv/linux/i386/clone.S | 1 +
> sysdeps/unix/sysv/linux/ia64/clone2.S | 2 +
> sysdeps/unix/sysv/linux/m68k/clone.S | 1 +
> sysdeps/unix/sysv/linux/microblaze/clone.S | 1 +
> sysdeps/unix/sysv/linux/mips/clone.S | 1 +
> sysdeps/unix/sysv/linux/nios2/clone.S | 1 +
> sysdeps/unix/sysv/linux/nptl-signals.h | 10 +
> sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S | 1 +
> sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S | 1 +
> sysdeps/unix/sysv/linux/s390/s390-32/clone.S | 2 +
> sysdeps/unix/sysv/linux/s390/s390-64/clone.S | 2 +
> sysdeps/unix/sysv/linux/sh/clone.S | 1 +
> sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 1 +
> sysdeps/unix/sysv/linux/sparc/sparc64/clone.S | 1 +
> sysdeps/unix/sysv/linux/spawni.c | 401 ++++++++++++++++++++++
> sysdeps/unix/sysv/linux/tile/clone.S | 1 +
> sysdeps/unix/sysv/linux/x86_64/clone.S | 1 +
> 41 files changed, 1158 insertions(+), 278 deletions(-)
> create mode 100644 posix/tst-execvpe1.c
> create mode 100644 posix/tst-execvpe2.c
> create mode 100644 posix/tst-execvpe3.c
> create mode 100644 posix/tst-execvpe4.c
> create mode 100644 posix/tst-execvpe5.c
> create mode 100644 posix/tst-execvpe6.c
> create mode 100644 posix/tst-spawn2.c
> create mode 100644 sysdeps/unix/sysv/linux/spawni.c
>