From owner-freebsd-threads@FreeBSD.ORG Fri Sep 10 10:40:31 2004 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3DD8D16A4CE for ; Fri, 10 Sep 2004 10:40:31 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15FF543D1F for ; Fri, 10 Sep 2004 10:40:31 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i8AAeUUt051037 for ; Fri, 10 Sep 2004 10:40:30 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8AAeUUg051036; Fri, 10 Sep 2004 10:40:30 GMT (envelope-from gnats) Date: Fri, 10 Sep 2004 10:40:30 GMT Message-Id: <200409101040.i8AAeUUg051036@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Andrew Belashov Subject: [PATCH] Re: bin/32295: pthread dont dequeue signals X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Andrew Belashov List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2004 10:40:31 -0000 The following reply was made to PR bin/32295; it has been noted by GNATS. From: Andrew Belashov To: freebsd-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org Cc: Subject: [PATCH] Re: bin/32295: pthread dont dequeue signals Date: Fri, 10 Sep 2004 14:31:27 +0400 This is a multi-part message in MIME format. --------------000002020101060604040907 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello, All! About one year I use my patch for open PR bin/32295. No problem detected on high load mysql server. Also, this patch tested with mozilla and firefox. Patch in attachment. Alternate location: Problem description: In function _thread_sig_handler() received signal queued (by writing into pipe). =============================================================================== if (_queue_signals != 0) { __sys_write(_thread_kern_pipe[1], &c, 1); DBG_MSG("Got signal %d, queueing to kernel pipe\n", sig); } =============================================================================== But flag _sigq_check_reqd (Check of queue of signals is required) is not touched if signal should be ignored: =============================================================================== if (_thread_sigq[sig - 1].blocked == 0) { [.........] /* Indicate that there are queued signals: */ _thread_sigq[sig - 1].pending = 1; _sigq_check_reqd = 1; } /* These signals need special handling: */ else if (sig == SIGCHLD || sig == SIGTSTP || sig == SIGTTIN || sig == SIGTTOU) { _thread_sigq[sig - 1].pending = 1; _thread_sigq[sig - 1].signo = sig; _sigq_check_reqd = 1; } else { DBG_MSG("Got signal %d, ignored.\n", sig); } =============================================================================== In this situation, dequeue signal handler is not executed and signal does not dequeued from pipe... This is bug and patch should be commited. -- With best regards, Andrew Belashov. --------------000002020101060604040907 Content-Type: text/plain; name="uthread_sig.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="uthread_sig.c.diff" --- lib/libc_r/uthread/uthread_sig.c.orig Wed Dec 3 09:54:40 2003 +++ lib/libc_r/uthread/uthread_sig.c Fri Sep 10 10:50:32 2004 @@ -160,8 +160,10 @@ _thread_sigq[sig - 1].signo = sig; _sigq_check_reqd = 1; } - else + else { DBG_MSG("Got signal %d, ignored.\n", sig); + _sigq_check_reqd = 1; + } } /* * The signal handlers should have been installed so that they --------------000002020101060604040907--