Return-Path: Delivered-To: apmail-apr-bugs-archive@www.apache.org Received: (qmail 31809 invoked from network); 15 Nov 2007 23:32:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2007 23:32:24 -0000 Received: (qmail 53313 invoked by uid 500); 15 Nov 2007 23:32:11 -0000 Delivered-To: apmail-apr-bugs-archive@apr.apache.org Received: (qmail 53259 invoked by uid 500); 15 Nov 2007 23:32:11 -0000 Mailing-List: contact bugs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apr.apache.org Delivered-To: mailing list bugs@apr.apache.org Received: (qmail 53233 invoked by uid 99); 15 Nov 2007 23:32:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 15:32:11 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 23:32:09 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 2AB6771422B; Thu, 15 Nov 2007 15:32:02 -0800 (PST) From: bugzilla@apache.org To: bugs@apr.apache.org Subject: DO NOT REPLY [Bug 43876] New: - Thread pooling has thread safety/race condition errors Message-ID: X-Bugzilla-Reason: AssignedTo Date: Thu, 15 Nov 2007 15:32:02 -0800 (PST) X-Virus-Checked: Checked by ClamAV on apache.org DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=43876 Summary: Thread pooling has thread safety/race condition errors Product: APR Version: HEAD Platform: Other OS/Version: other Status: NEW Severity: normal Priority: P2 Component: APR-util AssignedTo: bugs@apr.apache.org ReportedBy: Joe.Mudd@sas.com CC: henryjen@ztune.net BugsThisDependsOn: 42889 The thread pooling code (trunk misc/apr_thread_pool.c) has the following thread safety/race condition issues: 1) When a busy thread is trimmed its list element may have had its next and/or prev RING linkage nulled out which may cause the subsequent APR_RING_REMOVE() in thread_pool_func() crash. 2) The allocation of the thread pool function list element uses apr_pcalloc() w/o first serializing the use of the pool. apr_pcalloc() is not thread-safe and the same bit of memory may be handed out more than once. 3) When threads (especially idle ones) are trimmed the lock is not held long enough which may allow the list element to be removed more than once (similar to #1). This problem was introduced w/the idle worker timeout enhancement detailed in Bug 42889. Plus, the list element descriptors allocated to track an active worker thread were leaking. I have included a patch that has the fixes for these 4 problems. The patch includes the idle timeout and statistic updates in bug 42889. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org For additional commands, e-mail: bugs-help@apr.apache.org