From dev-return-12810-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Thu Sep 16 15:54:58 2004 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 5279 invoked from network); 16 Sep 2004 15:54:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 16 Sep 2004 15:54:58 -0000 Received: (qmail 71766 invoked by uid 500); 16 Sep 2004 15:54:56 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 71624 invoked by uid 500); 16 Sep 2004 15:54:54 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 71599 invoked by uid 99); 16 Sep 2004 15:54:53 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Organisation: Radan Computational Ltd., Bath, UK. Phone: +44 1225 320320 Fax: +44 1225 320311 Web: http://www.radan.com/ Message-ID: <4149B740.40800@uk.radan.com> Date: Thu, 16 Sep 2004 16:54:40 +0100 From: Steve Hay User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-gb, en, en-us MIME-Version: 1.0 To: dev@apr.apache.org Subject: [PATCH] apr_file_dup() doesn't set mutex on Win32 Content-Type: multipart/mixed; boundary="------------060905080203040500040904" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------060905080203040500040904 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-NAIMIME-Disclaimer: 1 X-NAIMIME-Modified: 1 I've just been experiencing problems using a tracing facility in mod_perl 2 (latest CVS sources) with Apache httpd-2.0.50. It seems to boil down, at least in part, to a bug in apr_file_dup() on Win32, namely that the mutex member of the new apr_file_t * is not being set. The attached patch (against whichever apr is in httpd-2.0.50) seems to help, although there is still one situation causing a crash that I haven't been able to fix yet. Please see this thread on the dev@perl.apache.org list for more details: http://marc.theaimsgroup.com/?t=109524076100001&r=1&w=2. Is the patch correct? Is there another bug lurking here somewhere that is still causing the crash with MOD_PERL_TRACE=g described in http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=109534744919759&w=2 ? Sorry, I've no idea how to reproduce that crash outside of mod_perl land, or even if it definitely is an apr problem. The MOD_PERL_TRACE feature is apparently working fine on Unix/Linux. Thanks, - Steve ------------------------------------------------ Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. --------------060905080203040500040904 Content-Type: text/plain; name="diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff.txt" --- srclib/apr/file_io/win32/filedup.c.orig 2004-02-13 00:33:44.000000000 +0000 +++ srclib/apr/file_io/win32/filedup.c 2004-09-16 16:47:10.028472900 +0100 @@ -44,6 +44,13 @@ (*new_file)->buffered = FALSE; (*new_file)->ungetchar = old_file->ungetchar; +#if APR_HAS_THREADS + if (old_file->mutex) { + apr_thread_mutex_create(&((*new_file)->mutex), + APR_THREAD_MUTEX_DEFAULT, p); + } +#endif + apr_pool_cleanup_register((*new_file)->pool, (void *)(*new_file), file_cleanup, apr_pool_cleanup_null); @@ -114,6 +121,13 @@ new_file->buffered = FALSE; new_file->ungetchar = old_file->ungetchar; +#if APR_HAS_THREADS + if (old_file->mutex) { + apr_thread_mutex_create(&(new_file->mutex), + APR_THREAD_MUTEX_DEFAULT, p); + } +#endif + return APR_SUCCESS; #endif /* !defined(_WIN32_WCE) */ } --------------060905080203040500040904--