From owner-freebsd-threads@FreeBSD.ORG Fri Sep 10 10:31:36 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD82E16A4CE; Fri, 10 Sep 2004 10:31:36 +0000 (GMT) Received: from tts.orel.ru (tts.orel.ru [213.59.64.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 844E843D1F; Fri, 10 Sep 2004 10:31:35 +0000 (GMT) (envelope-from bel@orel.ru) Received: from orel.ru (lg.orel.ru [62.33.11.59]) by tts.orel.ru (8.12.10/8.12.10/bel) with ESMTP id i8AAVReT021917; Fri, 10 Sep 2004 14:31:28 +0400 Message-ID: <4141827F.5000002@orel.ru> Date: Fri, 10 Sep 2004 14:31:27 +0400 From: Andrew Belashov Organization: ORIS User-Agent: Mozilla/5.0 (X11; U; FreeBSD sparc64; en-US; rv:1.6) Gecko/20040407 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: freebsd-gnats-submit@FreeBSD.org, freebsd-threads@FreeBSD.org X-Enigmail-Version: 0.83.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------000002020101060604040907" X-Zombi-Check: on netra2.orel.ru Subject: [PATCH] Re: bin/32295: pthread dont dequeue signals X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2004 10:31:36 -0000 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--