Threads regression tests (was: Re: ACE Proactor and libkse)

David Xu davidxu at freebsd.org
Wed Jul 16 01:42:52 PDT 2003


----- Original Message ----- 
From: "Daniel Eischen" <eischen at vigrid.com>
To: "David Schultz" <das at freebsd.org>
Cc: "Craig Rodrigues" <rodrigc at crodrigues.org>; "David Xu" <davidxu at freebsd.org>; <freebsd-threads at freebsd.org>
Sent: Wednesday, July 16, 2003 4:22 PM
Subject: Re: Threads regression tests (was: Re: ACE Proactor and libkse)


> That's why lib{c_r|pthread|thr}/test/ exists.
> 
> > #include <err.h>
> > #include <signal.h>
> > #include <stdlib.h>
> > 
> > int main() {
> > 
> > sigset_t mask;
> > int sig;
> > 
> > sigemptyset(&mask);
> > sigaddset(&mask, SIGALRM);
> > if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0)
> > err(1, "sigprocmask");
> > 
> > if (raise(SIGALRM) < 0)
> > err(1, "raise");
> > 
> > if (sigwait(&mask, &sig) < 0)
> > err(1, "sigwait");
> >         
> > return (0);
> > }
> 
> This seems to be kernel bug (if it is a bug).  If you build
> it without linking any of the threads libraries it still
> exits the program without sigwait receiving the signal.
> 

Yes, kern_sig.c's kern_sigtimedwait has bug, it shouldn't
terminate process. However libkse current relies on this bug,
unless I extend kse_thr_interrupt, fixing this bug would break
libkse. I have already worked out a patch for kse_thr_interrupt,
so when UTS receives a signal and finds that signal action is
SIG_DFL, it would call kse_thr_interrupt to terminate process
with signal, and possible core dumps itself.
Coming commit will fix libkse to not rely on this bug.

> -- 
> Dan Eischen
> 
> _______________________________________________
> freebsd-threads at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
> To unsubscribe, send any mail to "freebsd-threads-unsubscribe at freebsd.org"
> 


More information about the freebsd-threads mailing list