Re: Problem with long http request generation time - process restarting

2012-01-27 Thread Perrin Harkins
Sorry, just a clumsy cell phone touch.

- Perrin
On Jan 27, 2012 5:42 PM, "Perrin Harkins"  wrote:

> - Perrin
> On Jan 13, 2012 6:47 PM, "Andrew Merton (subscriptions)" <
> amerton.sig...@gmail.com> wrote:
>
>>  On 17/12/2011 7:20 a.m., Randolf Richardson wrote:
>>
>>  Thanks for the responses :)
>>
>> However - I just read another thread somewhere that made me think of
>> looking in the Event log.
>>
>> It appears that the culprit is Oracle - there are errors
>> naming OraOCIEI11.dll as the "Faulting Module name".
>>
>>
>>  That's very interesting.  Windows Event Viewer is a good place to
>> look (I keep forgetting about it as I'm used to /var/log/messages in
>> Unix/Linux and similar environments).
>>
>>  Well.  It turns out that in this case the event log was actually a red
>> herring. By creating another Apache instance (to avoid breaking the
>> "production" server :)) and stripping out all references to Oracle, DBI,
>> DBD etc from both httpd.conf and the Perl, I have determined that the
>> problem has nothing to do with Oracle.
>>
>> After doing that, I was getting exception code 0xC0FD (Stack
>> overflow) in Classify.dll (Params::Classify?) so I tried setting the
>> ThreadStackSize to 2MB, and now I get 0xC005 and the module is unknown
>> according to the Event log.
>>
>> I think I'm going mad.
>>
>> Is there a way to make Apache/mod_perl (on Windows 7) give me a stack
>> dump when the child process exits?  Al I get in the log is the "Parent:
>> child process exited ..." message, which is not very helpful.  I have
>> downloaded the -symbols.zip files from ActiveState and installed them in
>> the proper directories (alongside their .dlls), but then realised that I'm
>> not getting the equivalent of a core dump file to analyze.  The Event log
>> points to a directory containing only a text file (*.wer) which doesn't
>> have anything useful AFAICS...
>>
>> Andrew
>>
>


Re: Problem with long http request generation time - process restarting

2012-01-27 Thread Perrin Harkins
- Perrin
On Jan 13, 2012 6:47 PM, "Andrew Merton (subscriptions)" <
amerton.sig...@gmail.com> wrote:

>  On 17/12/2011 7:20 a.m., Randolf Richardson wrote:
>
>  Thanks for the responses :)
>
> However - I just read another thread somewhere that made me think of
> looking in the Event log.
>
> It appears that the culprit is Oracle - there are errors
> naming OraOCIEI11.dll as the "Faulting Module name".
>
>
>   That's very interesting.  Windows Event Viewer is a good place to
> look (I keep forgetting about it as I'm used to /var/log/messages in
> Unix/Linux and similar environments).
>
>  Well.  It turns out that in this case the event log was actually a red
> herring. By creating another Apache instance (to avoid breaking the
> "production" server :)) and stripping out all references to Oracle, DBI,
> DBD etc from both httpd.conf and the Perl, I have determined that the
> problem has nothing to do with Oracle.
>
> After doing that, I was getting exception code 0xC0FD (Stack overflow)
> in Classify.dll (Params::Classify?) so I tried setting the ThreadStackSize
> to 2MB, and now I get 0xC005 and the module is unknown according to the
> Event log.
>
> I think I'm going mad.
>
> Is there a way to make Apache/mod_perl (on Windows 7) give me a stack dump
> when the child process exits?  Al I get in the log is the "Parent: child
> process exited ..." message, which is not very helpful.  I have downloaded
> the -symbols.zip files from ActiveState and installed them in the proper
> directories (alongside their .dlls), but then realised that I'm not getting
> the equivalent of a core dump file to analyze.  The Event log points to a
> directory containing only a text file (*.wer) which doesn't have anything
> useful AFAICS...
>
> Andrew
>


Re: Registry and CGI::Carp

2012-01-27 Thread Brett Lee
 
Jim,

Thanks for your reply.  Yes, 
that was my post to perlmonks.  set_progname() is a function in the Carp module 
that lets you set/reset the name of the Carping script; that way you know which 
script generated the logged event.  Another way is to pass 
"name=scriptX" to 'use CGI::Carp'.

> seeing problems with the logging.  The message that is logged is correct,
> however the name of the script that generated the event is not.

The question above was implied; sorry, not ideal for this format.  Being more 
explicit:

"What is the best way to get CGI::Carp to accurately log the names of Carping 
Registry scripts?"

Regarding END{}, my inconclusive tests support this:


http://perl.apache.org/docs/2.0/api/ModPerl/Registry.html#C_END__Blocks


Brett





>
> From: Jim Schueler 
>To: Brett Lee  
>Cc: modperl  
>Sent: Friday, January 27, 2012 2:11 PM
>Subject: Re: Registry and CGI::Carp
> 
>There's no question or anything resembling a request in your email.  So my 
>response may waste a lot of time.
>
>Is this your original post?
>  http://www.perlmonks.org/?node_id=949773
>
>If so, I might be able to help.
>
>Admittedly, I can't follow the thread.  The PerlMonds responder refers to a 
>function set_progname().  But I can't figure out what that refers to.
>
>However, in the third exchange, you referenced a problem I have some 
>experience with:  Apache::Registry executes the BEGIN{} block once, and the 
>END{} block repeatedly.  Fundamentally, the Perl specification expects them to 
>be balanced, and I'm still amazed at this shortcoming.  I wrote a workaround 
>that might get you over your hurdle.  Please check out Apache::ChildExit.
>
>I'm amazed that my solution wasn't generally adopted.  As you note, it seems 
>like this would be a pretty common scenario.  Give it a try, and please let me 
>know whether this solution gives you any traction.
>
>Cheers!
>
>-Jim
>
>
>
>On Fri, 27 Jan 2012, Brett Lee wrote:
>
>> Hi Folks,
>> 
>> Running several scripts under ModPerl::Registry that use CGI::Carp.  Am
>> seeing problems with the logging.  The message that is logged is correct,
>> however the name of the script that generated the event is not.
>> 
>> Each script contains a line similar to:
>> 
>> use CGI::Carp qw(name=my_script_X);
>> 
>> When the scripts are precompiled in startup.pl, the *same* script name is
>> logged for each and every script.  When scripts are not precompiled the name
>> is frequently correct, but it is not correct all of the time.
>> 
>> A post earlier to Perl Monks came back with the suggestion to extend
>> CGI::Carp.pm to support running under Registry.  As what I am trying to do
>> seems like it would be a pretty common scenario, am thinking there may be
>> another option.
>> 
>> Thanks for considering this one.
>> Brett
>> 
>> 
>
>

Re: Registry and CGI::Carp

2012-01-27 Thread Jim Schueler
There's no question or anything resembling a request in your email.  So my 
response may waste a lot of time.


Is this your original post?
  http://www.perlmonks.org/?node_id=949773

If so, I might be able to help.

Admittedly, I can't follow the thread.  The PerlMonds responder refers to 
a function set_progname().  But I can't figure out what that refers to.


However, in the third exchange, you referenced a problem I have some 
experience with:  Apache::Registry executes the BEGIN{} block once, and 
the END{} block repeatedly.  Fundamentally, the Perl specification expects 
them to be balanced, and I'm still amazed at this shortcoming.  I wrote a 
workaround that might get you over your hurdle.  Please check out 
Apache::ChildExit.


I'm amazed that my solution wasn't generally adopted.  As you note, it 
seems like this would be a pretty common scenario.  Give it a try, and 
please let me know whether this solution gives you any traction.


Cheers!

 -Jim



On Fri, 27 Jan 2012, Brett Lee wrote:


Hi Folks,

Running several scripts under ModPerl::Registry that use CGI::Carp.  Am
seeing problems with the logging.  The message that is logged is correct,
however the name of the script that generated the event is not.

Each script contains a line similar to:

use CGI::Carp qw(name=my_script_X);

When the scripts are precompiled in startup.pl, the *same* script name is
logged for each and every script.  When scripts are not precompiled the name
is frequently correct, but it is not correct all of the time.

A post earlier to Perl Monks came back with the suggestion to extend
CGI::Carp.pm to support running under Registry.  As what I am trying to do
seems like it would be a pretty common scenario, am thinking there may be
another option.

Thanks for considering this one.
Brett



Registry and CGI::Carp

2012-01-27 Thread Brett Lee
Hi Folks,

Running several scripts under ModPerl::Registry that use CGI::Carp.  Am seeing 
problems with the logging.  The message that is logged is correct, however the 
name of the script that generated the event is not.

Each script contains a line similar to:

use CGI::Carp qw(name=my_script_X);

When the scripts are precompiled in startup.pl, the *same* script name is 
logged for each and every script.  When scripts are not precompiled the name is 
frequently correct, but it is not correct all of the time.

A post earlier to Perl Monks came back with the suggestion to extend 
CGI::Carp.pm to support running under Registry.  As what I am trying to do 
seems like it would be a pretty common scenario, am thinking there may be 
another option.

Thanks for considering this one.
Brett