Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 4287 invoked from network); 14 Jun 2007 21:43:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jun 2007 21:43:28 -0000 Received: (qmail 48483 invoked by uid 500); 14 Jun 2007 21:43:28 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 48432 invoked by uid 500); 14 Jun 2007 21:43:27 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 48421 invoked by uid 99); 14 Jun 2007 21:43:27 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2007 14:43:27 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Beau.Croteau@ca.com designates 141.202.248.42 as permitted sender) Received: from [141.202.248.42] (HELO mail13.ca.com) (141.202.248.42) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2007 14:43:23 -0700 Received: from USILMS12.ca.com ([141.202.201.12]) by mail13.ca.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 14 Jun 2007 17:43:02 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: Thread Creation/Destruction Problems Date: Thu, 14 Jun 2007 17:43:01 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Thread Creation/Destruction Problems Thread-Index: AceuzPtw2EpUN4OiQ2yTLzsOcX3WVw== From: "Croteau, Beau" To: X-OriginalArrivalTime: 14 Jun 2007 21:43:02.0528 (UTC) FILETIME=[FBDA0800:01C7AECC] X-Virus-Checked: Checked by ClamAV on apache.org I'm running the following code inside of an apache module (actually inside of a web service running inside an apache module): apr_thread_t *thd_arr; apr_pool_create(&ai->mp, NULL); apr_threadattr_t *thd_attr; apr_threadattr_create(&thd_attr, (ai->mp)); apr_threadattr_detach_set(thd_attr,1); apr_thread_create(&thd_arr, thd_attr, ExecuteAction, ai, ai->mp); The module runs in the mod_gsoap module (it's running as a gsoap web service). It's running on Apache 2.2.3 on Windows. The problem is that we're seeing a thread handle leak. I can see in the logs that a thread is created and should be exiting correctly, but when I use Handle.exe to dump all handles I can still see that the thread ID is still in the list, even after exiting. From my debugging it doesn't appear to be the original handle, but a copy of the handle for some reason. I've added the above code into a simple test program and the program seems to run as expected, the handle count doesn't go up, the threads are created, and when the threads die the thread count goes down. I've also used the standard windows ::CreateThread and _beginthread calls with similar types of 'leaks'. When I dump the handle list for the apache process I see the thread handle for the thread that should've since been released. Has anyone seen such behavior? It's strange to me and I'll admit that I'm not completely aware of the Apache internals that would cause something like this. Any help would be greatly appreciated. Thanks.