Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: [mp2] Tracing doesn't seem to work on Win32: msg#00221

apache.mod-perl.devel

Subject: Re: [mp2] Tracing doesn't seem to work on Win32

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:stas@xxxxxxxxxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation