From owner-freebsd-current Sun Aug 12 7:30:47 2001 Delivered-To: freebsd-current@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 6807F37B403; Sun, 12 Aug 2001 07:30:40 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id KAA27694; Sun, 12 Aug 2001 10:29:53 -0400 (EDT) Date: Sun, 12 Aug 2001 10:29:53 -0400 (EDT) From: Daniel Eischen To: Michael Robinson Cc: hackers@freebsd.org, current@freebsd.org Subject: Re: _sigprocmask in malloc.c causes full file table? In-Reply-To: <20010812214608.A2701@elephant.netrinsics.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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-current" in the body of the message