Date: Sun, 12 Aug 2001 10:29:53 -0400 (EDT) From: Daniel Eischen <eischen@vigrid.com> To: Michael Robinson <robinson@netrinsics.com> Cc: hackers@freebsd.org, current@freebsd.org Subject: Re: _sigprocmask in malloc.c causes full file table? Message-ID: <Pine.SUN.3.91.1010812101250.25909A-100000@pcnet1.pcnet.com> In-Reply-To: <20010812214608.A2701@elephant.netrinsics.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 12 Aug 2001, Michael Robinson wrote: > Doesn't *anybody* RTFPR? This is the fifth respondent in a row to have > comprehensively missed the point. > > On Sun, Aug 12, 2001 at 08:52:20AM -0400, Daniel Eischen wrote: > > On Sun, 12 Aug 2001, Michael Robinson wrote: > > > Thank you for that very helpful bit of information, but I already knew that. > > > > > > What I do not know is how it is possible for a null _sigprocmask call > > > (a SIG_BLOCK call with no mask bits set) in libc/stdlib/malloc.c to cause a > > > kernel error, "file: table is full", in libc_r/uthread/uthread_init.c. > > > > This is the first time that I saw libc_r was involved. Actually, POSIX > > (1003.1, 1996) says this about sigprocmask: > > > > "The use of the sigprocmask() function is unspecified in a > > multithreaded process." > > > > FreeBSD behaviour of sigprocmask() is the same as Solaris. sigprocmask() > > changes the mask of the calling thread, not the process. In other words, > > it is identical to pthread_sigmask(). > > > > If it is being used to block signals for threads other than the calling > > thread, it won't work. > > Allow me to quote: > > "a null _sigprocmask call (a SIG_BLOCK call with no mask bits set)" > > We can demonstrate that this is documented to have the same effect on all > threads. I.e., none whatsoever. > > The point is that not only does this putative no-op have an op, the op is > in fact an entirely unrelated error in an entirely unrelated location: > pipe creation fails with a system "file: table is full" error. sigprocmask() behaves the same as pthread_sigmask(). pthread_sigmask() needs to obtain the current thread. In obtaining the current thread, the threads library must be initialized. In initializing the threads library malloc() is called. Wash, rinse, repeat. Don't put _sigprocmask() in malloc. -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.1010812101250.25909A-100000>