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.
I suppose, since no one cares, I'll just commit it. I can't test this patch, but I trust Steve that it's good. Let me know if you have any objections.
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 [email protected] 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,
------------------------------------------------------------------------
--- 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:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
