search for: dowait

Displaying 11 results from an estimated 11 matches for "dowait".

Did you mean: iowait
2020 Mar 28
0
[klibc:update-dash] dash: jobs: Only clear gotsigchld when waiting for everything
...19 May 2018 02:39:41 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:55 +0000 [klibc] dash: jobs: Only clear gotsigchld when waiting for everything [ dash commit 6c691b3e5099de380a9d2f97d5c72f4a978bb794 ] The gotsigchld flag is always cleared in dowait but not all callers of dowait will wait for everything. In particular, when jp is set we only wait until the set job isn't running anymore. This patch fixes this by only clearing gotsigchld if jp is unset. It also changes the waitcmd to actually set jp which corresponds to the behaviour of ba...
2019 Jan 25
0
[klibc:update-dash] jobs - Do not block when waiting on SIGCHLD
...bs.c b/usr/dash/jobs.c index 4548ae69..2b8e1afe 100644 --- a/usr/dash/jobs.c +++ b/usr/dash/jobs.c @@ -974,10 +974,17 @@ waitforjob(struct job *jp) int st; TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0)); - while ((jp && jp->state == JOBRUNNING) || gotsigchld) - dowait(DOWAIT_BLOCK, jp); - if (!jp) + if (!jp) { + int pid = gotsigchld; + + while (pid > 0) + pid = dowait(DOWAIT_NORMAL, NULL); + return exitstatus; + } + + while (jp->state == JOBRUNNING) + dowait(DOWAIT_BLOCK, jp); st = getstatus(jp); #if JOBS if (jp->jobctl) {
2020 Mar 28
0
[klibc:update-dash] dash: jobs - Do not block when waiting on SIGCHLD
...bs.c b/usr/dash/jobs.c index 3ea7e122..400628ff 100644 --- a/usr/dash/jobs.c +++ b/usr/dash/jobs.c @@ -974,10 +974,17 @@ waitforjob(struct job *jp) int st; TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0)); - while ((jp && jp->state == JOBRUNNING) || gotsigchld) - dowait(DOWAIT_BLOCK, jp); - if (!jp) + if (!jp) { + int pid = gotsigchld; + + while (pid > 0) + pid = dowait(DOWAIT_NORMAL, NULL); + return exitstatus; + } + + while (jp->state == JOBRUNNING) + dowait(DOWAIT_BLOCK, jp); st = getstatus(jp); #if JOBS if (jp->jobctl) {
2003 Aug 14
4
bin/55346: /bin/sh eats memory and CPU infinitely
Hi! It seems /bin/sh in 4.8-STABLE has problem with SIGCHLD processing. In short, it often fails to process it correctly, zombies float around, jobs are not marked as finished in jobtab[] that fills memory and takes much CPU to be processed. Run this one-liner using /bin/sh and see hundreds of zombies: #!/bin/sh while :; do : & done A kernel will halt this as soon as it reaches limits and
2019 Jan 25
0
[klibc:update-dash] eval: Reap zombies after built-in commands and functions
...972,10 +973,11 @@ waitforjob(struct job *jp) { int st; - TRACE(("waitforjob(%%%d) called\n", jobno(jp))); - while (jp->state == JOBRUNNING) { + TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0)); + while ((jp && jp->state == JOBRUNNING) || gotsigchld) dowait(DOWAIT_BLOCK, jp); - } + if (!jp) + return exitstatus; st = getstatus(jp); #if JOBS if (jp->jobctl) {
2020 Mar 28
0
[klibc:update-dash] dash: eval: Reap zombies after built-in commands and functions
...972,10 +973,11 @@ waitforjob(struct job *jp) { int st; - TRACE(("waitforjob(%%%d) called\n", jobno(jp))); - while (jp->state == JOBRUNNING) { + TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0)); + while ((jp && jp->state == JOBRUNNING) || gotsigchld) dowait(DOWAIT_BLOCK, jp); - } + if (!jp) + return exitstatus; st = getstatus(jp); #if JOBS if (jp->jobctl) {
2010 Mar 22
1
[git pull] dash, sh4, README's
...4-argument cases for test per POSIX [klibc] [BUILTIN] Made aexpr/oexpr non-recursive [klibc] [BUILTIN] Made t_lex reentrant [klibc] [INPUT] Made setinputfd static [klibc] [SHELL] Expand ENV before using it [klibc] [OPTIONS] Added support for -l [klibc] [JOBS] Fix dowait signal race [klibc] [SIGNAL] Remove EXSIG [klibc] [JOBS] Do not close stderr when /dev/tty fails to open [klibc] [PARSER] Allow newlines after var name in for statements [klibc] [PARSER] Use CHKNL to parse case statements [klibc] [REDIR] Fix incorrect savefd conversion...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add vfork support
...; + + pid = vfork(); + + if (!pid) { + forkchild(jp, n, FORK_FG); + sigclearmask(); + shellexec(argv, path, idx); + /* NOTREACHED */ + } + + vforked = 0; + sigclearmask(); + forkparent(jp, n, FORK_FG, pid); + + return jp; +} + /* * Wait for job to finish. * @@ -1105,7 +1152,7 @@ static int dowait(int block, struct job *jp) STATIC int waitproc(int block, int *status) { - sigset_t mask, oldmask; + sigset_t oldmask; int flags = block == DOWAIT_BLOCK ? 0 : WNOHANG; int err; @@ -1119,8 +1166,7 @@ waitproc(int block, int *status) if (err || (err = -!block)) break; - sigfillset(...
2010 Apr 16
0
[git pull v4] dash, sh4, ipconfig, dprintf, fstype, README's
...4-argument cases for test per POSIX [klibc] [BUILTIN] Made aexpr/oexpr non-recursive [klibc] [BUILTIN] Made t_lex reentrant [klibc] [INPUT] Made setinputfd static [klibc] [SHELL] Expand ENV before using it [klibc] [OPTIONS] Added support for -l [klibc] [JOBS] Fix dowait signal race [klibc] [SIGNAL] Remove EXSIG [klibc] [JOBS] Do not close stderr when /dev/tty fails to open [klibc] [PARSER] Allow newlines after var name in for statements [klibc] [PARSER] Use CHKNL to parse case statements [klibc] [REDIR] Fix incorrect savefd conversion...
2010 Apr 16
0
[PATCH] pull faccessat() system call
...4-argument cases for test per POSIX [klibc] [BUILTIN] Made aexpr/oexpr non-recursive [klibc] [BUILTIN] Made t_lex reentrant [klibc] [INPUT] Made setinputfd static [klibc] [SHELL] Expand ENV before using it [klibc] [OPTIONS] Added support for -l [klibc] [JOBS] Fix dowait signal race [klibc] [SIGNAL] Remove EXSIG [klibc] [JOBS] Do not close stderr when /dev/tty fails to open [klibc] [PARSER] Allow newlines after var name in for statements [klibc] [PARSER] Use CHKNL to parse case statements [klibc] [REDIR] Fix incorrect savefd conversion...
2010 Mar 28
1
[git pull v3] dash, sh4, ipconfig, dprintf, fstype, README's
...4-argument cases for test per POSIX [klibc] [BUILTIN] Made aexpr/oexpr non-recursive [klibc] [BUILTIN] Made t_lex reentrant [klibc] [INPUT] Made setinputfd static [klibc] [SHELL] Expand ENV before using it [klibc] [OPTIONS] Added support for -l [klibc] [JOBS] Fix dowait signal race [klibc] [SIGNAL] Remove EXSIG [klibc] [JOBS] Do not close stderr when /dev/tty fails to open [klibc] [PARSER] Allow newlines after var name in for statements [klibc] [PARSER] Use CHKNL to parse case statements [klibc] [REDIR] Fix incorrect savefd conversion...