apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [PATCH] apr_file_dup() doesn't set mutex on Win32
Date Tue, 21 Sep 2004 03:37:58 GMT
Steve Hay wrote:
> I've just been experiencing problems using a tracing facility in 
> mod_perl 2 (latest CVS sources) with Apache httpd-2.0.50.

folks, apr_file_dup on win32 is broken. Steve has posted a patch. Can 
someone on win32 review it and commit if it's good? Thank you.

> 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.
> 
> 
> ------------------------------------------------------------------------
> 
> --- 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) */
>  }


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message