Steve Hay wrote:
[...]
Can you step through to the write and see why it doesn't show up in the error_log file?


I've stepped into apr_file_write(). This calls a Win32 API function called WriteFile() (readwrite.c, line 328), which fails: rv is 0. The last OS error (GetLastError()) is retrieved via apr_get_os_error(), which returns a horribly munged value via apr_errno.h. The value is 720,006, which I think corresponds to the GetLastError() value of 6 if I've waded through all the #define's in apr_errno.h correctly. That error number corresponds to the message "The handle is invalid".

So apr_file_write() does indeed fail, and reason is that the handle is invalid. (The value of thefile->filehand is 0x00000170.)

This could be a problem in mod_perl, please break at modperl_trace_level_set. It has this code:


logfile = s->error_log; /* XXX */

notice XXX, which probably indicates that it could be wrong. That logfile is a static variable, I'd start checking from this place to see if it's a valid apr_file_t variable and then looking inside (using some accessor e.g. you can get the handle via:

    {
        apr_status_t rc;
        apr_os_file_t os_file;
        rc = apr_os_file_get(&os_file, logfile);
        if (rc != APR_SUCCESS) {
            Perl_croak(aTHX_ "filehandle retrieval failed!");
        }
    }

It's possible that logfile contains a seemingly valid apr_file_t, but if for some reason s->error_log is closed/reopened, leaving invalid pointer in logfile.

remember that modperl_trace_level_set will be called at least twice (start+restart).

But may be first try this temp patch:

Index: src/modules/perl/modperl_log.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_log.c,v
retrieving revision 1.8
diff -u -r1.8 modperl_log.c
--- src/modules/perl/modperl_log.c      3 Apr 2003 06:25:26 -0000       1.8
+++ src/modules/perl/modperl_log.c      19 Sep 2003 17:47:58 -0000
@@ -2,6 +2,7 @@
 #include "apr_lib.h"
 #include "modperl_trace.h"
 #include "modperl_log.h"
+#include "mod_perl.h"

#undef getenv /* from XSUB.h */

@@ -28,6 +29,8 @@
     if (!logfile) {
         return;
     }
+
+    logfile = modperl_global_get_server_rec()->error_log;

     if (func) {
         apr_file_printf(logfile, "%s: ", func);


Do other folks have any success using MOD_PERL_TRACE=o on Win32?



May be the whole tracing is not working on win32? Can you trace other things? e.g. =f for filters? See:
http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_
I think Randy has reported successful tracing before.


I can't get any trace information appearing in the error_log other than a dump of the trace flags and a few other bits before the server starts up. I just ran the whole testsuite (except filter, hooks and modules) with MOD_PERL_TRACE set to "fmo" (filters, memory, I/O) and all I got in the error_log was this:
[...]
I assume there should have been loads more than that!

Indeed.



__________________________________________________________________ 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


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to