kernel: ignore errors on awake_gc_proc

Calling resrcwait in awake_gc_proc (that is called from pexit and thus
from sys_exits) means that we have to ignore errors that could cause
the syscall to return.

The funny part here was that one single test for newlib showed the
issue by faulting in a note handler AFTER completing with success:

	/arch/amd64/qa/lib/newlib/sigchld/213-sigqueue

The fact was that in the executable, the function notifier() was
located just after the exits() function, whose last line was a call
to _exits().

Thus, when the _exits returned, the notifier() code was executed.
This commit is contained in:
Giacomo Tesio 2017-10-10 00:14:49 +02:00
parent 7c017f5059
commit 430df16543
1 changed files with 4 additions and 1 deletions

View File

@ -336,8 +336,11 @@ awake_gc_proc(Proc *p)
assert(p->wakeups[0].count == 0);
assert(p->wakeups[1].count == 0);
while(p->nwakeups > 0)
while(p->nwakeups > 0){
while(waserror())
;
resrcwait(nil, nil);
}
}
static long