You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Thierry Valentin <va...@earthdecision.com> on 2004/11/24 11:29:49 UTC

Apache2/Modperl2 fails to preload Win32::OLE at server startup

Hello,
I'm currently using the following configuration:

- Perl 5.8.4.810 from Activestate
- Apache 2.0.52 installed from the MSI package
- mod_perl 1.99_17 installed with ppm from http://theoryx5.uwinnipeg.ca

All these 3 packages are frehsly installed and I did no other additions.

After configuring mod_perl in http.conf I tried the following:

- preload Win32::OLE with a 'use Win32::OLE' in the mod_perl startup script:
=> Apache2 refuses to start.

- preload Win32::OLE with a PerlModule Win32::OLE' directive in http.conf:
=> Apache2 still refuses to start


What's strange is that CGI scripts that use Win32::OLE under mod_perl in an 
identical server configuration run successfully!

What did I miss?

Thanks in advance for your help.

Here is my mod_perl configuration in http.conf:
#################################################
# mod_perl configuration directives

LoadModule perl_module modules/mod_perl.so
LoadFile "C:/Perl/bin/perl58.dll"
PerlRequire "C:/Program Files/Apache Group/Apache2/conf/mod_perl_startup.pl"
PerlSwitches -w

Alias /perl/ "C:/Program Files/Apache Group/Apache2/perl/"
<Location /perl>
      AllowOverride None
      Order allow,deny
      Allow from all
      SetHandler perl-script
      PerlResponseHandler ModPerl::Registry
      Options +ExecCGI
      PerlOptions +ParseHeaders
</Location>
#################################################


Here is my mod_perl startup script mod_perl_startup.pl:
#################################################
# mod_perl startup script
use Apache2 ();
use ModPerl::Util ();
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::RequestUtil ();
use Apache::ServerRec ();
use Apache::ServerUtil ();
use Apache::Connection ();
use Apache::Log ();
use Apache::Const -compile => ':common';
use APR::Const -compile => ':common';
use APR::Table ();
use Apache::compat ();
use ModPerl::Registry ();
use CGI ();
CGI->compile();
use Win32::OLE (); #### FAILS TO START HERE!
1;
#################################################

-- 


Thierry Valentin
earth decision sciences SA
/(formerly known as T-Surf)/
22, allée de la Foret de la Reine
54500 Vandoeuvre-lès-Nancy, France
Email: valentin@earthdecision.com
Phone: +33 (0)3-83-67-66-29
Fax: +33 (0)3-83-67-66-34
Please visit our website at: www.earthdecision.com
<http://www.earthdecision.com/>


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Thierry Valentin <va...@earthdecision.com>.
Randy Kobes wrote:
> On Wed, 24 Nov 2004, Thierry Valentin wrote:
> 
> 
>>Hello,
>>I'm currently using the following configuration:
>>
>>- Perl 5.8.4.810 from Activestate
>>- Apache 2.0.52 installed from the MSI package
>>- mod_perl 1.99_17 installed with ppm from http://theoryx5.uwinnipeg.ca
>>
>>All these 3 packages are frehsly installed and I did no other additions.
>>
>>After configuring mod_perl in http.conf I tried the following:
>>
>>- preload Win32::OLE with a 'use Win32::OLE' in the mod_perl startup script:
>>=> Apache2 refuses to start.
>>
>>- preload Win32::OLE with a PerlModule Win32::OLE' directive in http.conf:
>>=> Apache2 still refuses to start
>>
>>What's strange is that CGI scripts that use Win32::OLE
>>under mod_perl in an identical server configuration run
>>successfully!
> 
> 
> I see the same problem when trying to use Win32::OLE in a
> startup script (with no error messages recorded - just a
> popup box saying that Apache encountered a problem when
> trying to start). This will require some debugging, but just
> to confirm - if you take out Win32::OLE from your startup
> script, but use it in a location handled by
> ModPerl::Registry, are there any problems?
> 

Hello
Taking Win32::OLE out of the startup script solves the startup problem.
I have used Win32::OLE in locations handled by ModPerl::Registry without any
problems already.

This raises another question:
Is there a performance/memory issue regarding preloading a perl module at
startup vs. loading it in ModPerl::Registry perl scripts ?

Thanks for your help

-- 


Thierry Valentin
earth decision sciences SA
/(formerly known as T-Surf)/
22, allée de la Foret de la Reine
54500 Vandoeuvre-lès-Nancy, France
Email: valentin@earthdecision.com
Phone: +33 (0)3-83-67-66-29
Fax: +33 (0)3-83-67-66-34
Please visit our website at: www.earthdecision.com
<http://www.earthdecision.com/>


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


RE: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Jan Dubois <ja...@ActiveState.com>.
On Thu, 25 Nov 2004, Randy Kobes wrote:
> I see the same problem when trying to use Win32::OLE in a startup
> script (with no error messages recorded - just a popup box saying that
> Apache encountered a problem when trying to start). This will require
> some debugging, but just to confirm - if you take out Win32::OLE from
> your startup script, but use it in a location handled by
> ModPerl::Registry, are there any problems?

I did not follow this thread, but want to remind you all that Win32::OLE
is not multi-thread safe.  You can call OLE methods only on the thread
that initialized Win32::OLE, and you should not spawn additional threads
from a Perl interpreter once you have initialized Win32::OLE in that thread.

Cheers,
-Jan



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Wed, 24 Nov 2004, Thierry Valentin wrote:

> Hello,
> I'm currently using the following configuration:
>
> - Perl 5.8.4.810 from Activestate
> - Apache 2.0.52 installed from the MSI package
> - mod_perl 1.99_17 installed with ppm from http://theoryx5.uwinnipeg.ca
>
> All these 3 packages are frehsly installed and I did no other additions.
>
> After configuring mod_perl in http.conf I tried the following:
>
> - preload Win32::OLE with a 'use Win32::OLE' in the mod_perl startup script:
> => Apache2 refuses to start.
>
> - preload Win32::OLE with a PerlModule Win32::OLE' directive in http.conf:
> => Apache2 still refuses to start
>
> What's strange is that CGI scripts that use Win32::OLE
> under mod_perl in an identical server configuration run
> successfully!

I see the same problem when trying to use Win32::OLE in a
startup script (with no error messages recorded - just a
popup box saying that Apache encountered a problem when
trying to start). This will require some debugging, but just
to confirm - if you take out Win32::OLE from your startup
script, but use it in a location handled by
ModPerl::Registry, are there any problems?

-- 
best regards,
randy

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Thierry Valentin <va...@earthdecision.com>.
Hello,
I definitely agree with that.
A daemon would solve all the authentication and connection persistence issues. 
But the problem is that all accesses to the database that I'm using *must* go 
through a vendor specific API which is only available as a COM library.
This explains the choice of Apache/win32 and Win32::OLE.

In face of the potential problems, I will reconsider writing a RPC::PlServer 
daemon that uses Win32::OLE to access the database.

Thanks for the suggestion.


Stas Bekman wrote:
> Thierry Valentin wrote:
> 
>> Hello all
>> the discussion has become a little bit technical for me...
>>
>> What I understand is that I've been lucky to make this work so far and 
>> that sooner or later I will end up with some problems.
> 
> 
> I'm not familiar with win32-perl internals, but based on what Jan 
> explained so far I suspect that you may have the problem. I could be 
> wrong though. Jan will probably know better to answer this question.
> 
>> Is there some not-too-complicated way to workaround the problems in 
>> the perl scripts or at least prevent the most severe problems to happen?
>>
>> NOTE: Actually what I'm currently doing is a authentication handler 
>> derived from Apache::AuthCookie. My handler is connecting to a 
>> database through Win32::OLE to authenticate users. Active connections 
>> are kept in a cache until users logout.
>>  From what I understand of Jan's answer: should I keep an active 
>> connection per thread-id?
> 
> 
> I don't think this will work. You could try to run a daemon which will 
> do the auth (i.e. taking win32::OLE out of picture) and have your 
> modperl scripts talk to that daemon when they need auth.
> 
> I think your best solution is to get linux or another unix flavor and 
> then you will be on the safe ground (at least with prefork mpm). I think 
> 99.9% of modperl users use some Unix flavor, so things are much more 
> solid on this side of the world.
> 


-- 


Thierry Valentin
earth decision sciences SA
/(formerly known as T-Surf)/
22, allée de la Foret de la Reine
54500 Vandoeuvre-lès-Nancy, France
Email: valentin@earthdecision.com
Phone: +33 (0)3-83-67-66-29
Fax: +33 (0)3-83-67-66-34
Please visit our website at: www.earthdecision.com
<http://www.earthdecision.com/>


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Thierry Valentin wrote:
> Hello all
> the discussion has become a little bit technical for me...
> 
> What I understand is that I've been lucky to make this work so far and 
> that sooner or later I will end up with some problems.

I'm not familiar with win32-perl internals, but based on what Jan 
explained so far I suspect that you may have the problem. I could be wrong 
though. Jan will probably know better to answer this question.

> Is there some not-too-complicated way to workaround the problems in the 
> perl scripts or at least prevent the most severe problems to happen?
> 
> NOTE: Actually what I'm currently doing is a authentication handler 
> derived from Apache::AuthCookie. My handler is connecting to a database 
> through Win32::OLE to authenticate users. Active connections are kept in 
> a cache until users logout.
>  From what I understand of Jan's answer: should I keep an active 
> connection per thread-id?

I don't think this will work. You could try to run a daemon which will do 
the auth (i.e. taking win32::OLE out of picture) and have your modperl 
scripts talk to that daemon when they need auth.

I think your best solution is to get linux or another unix flavor and then 
you will be on the safe ground (at least with prefork mpm). I think 99.9% 
of modperl users use some Unix flavor, so things are much more solid on 
this side of the world.

-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Thierry Valentin <va...@earthdecision.com>.
Hello all
the discussion has become a little bit technical for me...

What I understand is that I've been lucky to make this work so far and that 
sooner or later I will end up with some problems.

Is there some not-too-complicated way to workaround the problems in the perl 
scripts or at least prevent the most severe problems to happen?

NOTE: Actually what I'm currently doing is a authentication handler derived from 
Apache::AuthCookie. My handler is connecting to a database through Win32::OLE to 
authenticate users. Active connections are kept in a cache until users logout.
 From what I understand of Jan's answer: should I keep an active connection per 
thread-id?

Jan Dubois wrote:
> On Mon, 29 Nov 2004, Stas Bekman wrote:
> 
>>If you just call perl_clone it runs in the new perl context, but
>>inside the same thread. At least on Unix. Under ithreads.pm it
>>probably starts a new thread first (but I'm not sure). Under
>>modperl 2, there is no 1:1 relationship between interpreters and
>>apache threads
>>
>>so that means that it's out of question that Win32::OLE can be used at
>>all, right? I suppose Thierry was just lucky to get the thing working
>>by loading at request time, and most likely under a bit of stress
>>testing it'll show the same problems.
> 
> 
> Yes, it sounds like COM and mod_perl threads won't mix.  Even if Win32::OLE
> was made thread-safe (I still have that on my todo list), it would probably
> not work with mod_perl 2.0 because COM objects have apartment affinity.  You
> can't just create a COM object in one thread and then use it from another.
> 
> It will have to be explicitly marshaled in case the different threads
> belong to different threading apartments. This means COM will create a
> proxy object in the calling thread and uses something like in-process
> RPC to execute the call in the "home-thread" of the real object.
> 
> I guess this can be worked around too, by storing the "owning" thread id
> in each Win32::OLE object and then explicitly requesting it to be
> marshaled if it is being used from a different thread. But that will
> only work if both threads will properly crank the Windows message loop,
> in case one of the threads belongs to a single threaded apartment. It
> becomes a big can of worms...
> 
> It looks like "thread-safety" has a whole range of meanings in the
> ithreads world. :(
> 
> Cheers,
> -Jan
> 
> 


-- 


Thierry Valentin
earth decision sciences SA
/(formerly known as T-Surf)/
22, allée de la Foret de la Reine
54500 Vandoeuvre-lès-Nancy, France
Email: valentin@earthdecision.com
Phone: +33 (0)3-83-67-66-29
Fax: +33 (0)3-83-67-66-34
Please visit our website at: www.earthdecision.com
<http://www.earthdecision.com/>


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Jan Dubois wrote:
> On Tue, 30 Nov 2004, Stas Bekman wrote:
> 
>>What about the solution of ithreads? Originally ithreads were storing
>>their context in ThreadLocalStorage, and this didn't work under mp2,
>>so it was rewritten to store the context in a perl PL_ interpreter
>>global, now ithreads can be run inside the same thread.
> 
> 
> I'm not sure what you are referring to.  As far as I know the Perl context
> for a thread is still stored in TLS.  Can you point me to the relevant
> changes and/or the PL_ name you are talking about?

The main self context is not stored in TLS since 5.8.1. If it was it would 
be impossible to load and run ithreads::shared under mp2.

ext/threads/threads.xs:

void Perl_ithread_set (pTHX_ ithread* thread)
{
   SV* thread_sv = newSViv(PTR2IV(thread));
   if(!hv_store(PL_modglobal, "threads::self", 12, thread_sv,0)) {
     croak("%s\n","Internal error, couldn't set TLS");
   }
}

>>Could the same solution be applied for COM context? Make it
>>independent from threads?
> 
> 
> You will have to ask Microsoft about this. Something tells me their
> answer will be: "Don't use COM, use .NET".
> 
> For Win32::OLE this could be solved by only using the free-threaded
> apartment model, which is already done by default. But you will still
> need to initialize each new thread to join that apartment.  I guess each
> Perl interpreter could keep a global cache of thread ids and just try
> to call CoInitialize() when it hasn't been run in this thread before.
> Of course this will require all Perl interpreters to use the same
> COM threading model, but that is not really a big restriction.

Sounds like database connection pooling :)


-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


RE: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Jan Dubois <ja...@ActiveState.com>.
On Tue, 30 Nov 2004, Stas Bekman wrote:
> What about the solution of ithreads? Originally ithreads were storing
> their context in ThreadLocalStorage, and this didn't work under mp2,
> so it was rewritten to store the context in a perl PL_ interpreter
> global, now ithreads can be run inside the same thread.

I'm not sure what you are referring to.  As far as I know the Perl context
for a thread is still stored in TLS.  Can you point me to the relevant
changes and/or the PL_ name you are talking about?

> Could the same solution be applied for COM context? Make it
> independent from threads?

You will have to ask Microsoft about this. Something tells me their
answer will be: "Don't use COM, use .NET".

For Win32::OLE this could be solved by only using the free-threaded
apartment model, which is already done by default. But you will still
need to initialize each new thread to join that apartment.  I guess each
Perl interpreter could keep a global cache of thread ids and just try
to call CoInitialize() when it hasn't been run in this thread before.
Of course this will require all Perl interpreters to use the same
COM threading model, but that is not really a big restriction.

Cheers,
-Jan




-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Jan Dubois wrote:
> On Mon, 29 Nov 2004, Stas Bekman wrote:
> 
>>If you just call perl_clone it runs in the new perl context, but
>>inside the same thread. At least on Unix. Under ithreads.pm it
>>probably starts a new thread first (but I'm not sure). Under
>>modperl 2, there is no 1:1 relationship between interpreters and
>>apache threads
>>
>>so that means that it's out of question that Win32::OLE can be used at
>>all, right? I suppose Thierry was just lucky to get the thing working
>>by loading at request time, and most likely under a bit of stress
>>testing it'll show the same problems.
> 
> 
> Yes, it sounds like COM and mod_perl threads won't mix.  Even if Win32::OLE
> was made thread-safe (I still have that on my todo list), it would probably
> not work with mod_perl 2.0 because COM objects have apartment affinity.  You
> can't just create a COM object in one thread and then use it from another.
> 
> It will have to be explicitly marshaled in case the different threads
> belong to different threading apartments. This means COM will create a
> proxy object in the calling thread and uses something like in-process
> RPC to execute the call in the "home-thread" of the real object.
> 
> I guess this can be worked around too, by storing the "owning" thread id
> in each Win32::OLE object and then explicitly requesting it to be
> marshaled if it is being used from a different thread. But that will
> only work if both threads will properly crank the Windows message loop,
> in case one of the threads belongs to a single threaded apartment. It
> becomes a big can of worms...

What about the solution of ithreads? Originally ithreads were storing 
their context in ThreadLocalStorage, and this didn't work under mp2, so it 
was rewritten to store the context in a perl PL_ interpreter global, now 
ithreads can be run inside the same thread.

Could the same solution be applied for COM context? Make it independent 
from threads?

> It looks like "thread-safety" has a whole range of meanings in the
> ithreads world. :(

:(

-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


RE: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Jan Dubois <ja...@ActiveState.com>.
On Mon, 29 Nov 2004, Stas Bekman wrote:
> If you just call perl_clone it runs in the new perl context, but
> inside the same thread. At least on Unix. Under ithreads.pm it
> probably starts a new thread first (but I'm not sure). Under
> modperl 2, there is no 1:1 relationship between interpreters and
> apache threads
>
> so that means that it's out of question that Win32::OLE can be used at
> all, right? I suppose Thierry was just lucky to get the thing working
> by loading at request time, and most likely under a bit of stress
> testing it'll show the same problems.

Yes, it sounds like COM and mod_perl threads won't mix.  Even if Win32::OLE
was made thread-safe (I still have that on my todo list), it would probably
not work with mod_perl 2.0 because COM objects have apartment affinity.  You
can't just create a COM object in one thread and then use it from another.

It will have to be explicitly marshaled in case the different threads
belong to different threading apartments. This means COM will create a
proxy object in the calling thread and uses something like in-process
RPC to execute the call in the "home-thread" of the real object.

I guess this can be worked around too, by storing the "owning" thread id
in each Win32::OLE object and then explicitly requesting it to be
marshaled if it is being used from a different thread. But that will
only work if both threads will properly crank the Windows message loop,
in case one of the threads belongs to a single threaded apartment. It
becomes a big can of worms...

It looks like "thread-safety" has a whole range of meanings in the
ithreads world. :(

Cheers,
-Jan



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Jan Dubois wrote:
> On Mon, 29 Nov 2004, Stas Bekman wrote:
> 
>>Jan, do you have any idea why the CLONE trick doesn't work? CLONE is
>>running inside the newly-clonned perl, so thread-safety shouldn't get
>>on the way, no?
> 
> 
> Is CLONE running inside the new *thread* ? It is not good enough to run
> it in the correct Perl interpreter; you must call CoInitialize() inside
> the thread that is going to make COM/OLE calls. Otherwise COM will not
> operate from that thread. It needs to associate the *thread* with a
> specific apartment for synchronization purposes first.
> 
> Sorry, that is the only thing I can think of right now. I can't remember
> how CLONE is being called exactly.

If you just call perl_clone it runs in the new perl context, but inside 
the same thread. At least on Unix. Under ithreads.pm it probably starts a 
new thread first (but I'm not sure). Under modperl 2, there is no 1:1 
relationship between interpreters and apache threads

so that means that it's out of question that Win32::OLE can be used at 
all, right? I suppose Thierry was just lucky to get the thing working by 
loading at request time, and most likely under a bit of stress testing 
it'll show the same problems.

-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


RE: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Jan Dubois <ja...@ActiveState.com>.
On Mon, 29 Nov 2004, Stas Bekman wrote:
> Jan, do you have any idea why the CLONE trick doesn't work? CLONE is
> running inside the newly-clonned perl, so thread-safety shouldn't get
> on the way, no?

Is CLONE running inside the new *thread* ? It is not good enough to run
it in the correct Perl interpreter; you must call CoInitialize() inside
the thread that is going to make COM/OLE calls. Otherwise COM will not
operate from that thread. It needs to associate the *thread* with a
specific apartment for synchronization purposes first.

Sorry, that is the only thing I can think of right now. I can't remember
how CLONE is being called exactly.

Cheers,
-Jan



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Steve Hay <st...@uk.radan.com>.
Stas Bekman wrote:

>Jan, do you have any idea why the CLONE trick doesn't work? CLONE is 
>running inside the newly-clonned perl, so thread-safety shouldn't get on 
>the way, no?
>
Just a guess -- it may be the same problem with CoInitialize() that I 
experienced not long ago with Win32::Shortcut.  (Win32::OLE does call 
CoInitialize() in various places.)  See this thread:

http://marc.theaimsgroup.com/?t=109578393200002&r=1&w=2

- 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.


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Jan, do you have any idea why the CLONE trick doesn't work? CLONE is 
running inside the newly-clonned perl, so thread-safety shouldn't get on 
the way, no?

Thierry Valentin wrote:
> Hello,
> 
> Here is the startup script modified as you recommended:
> (I replaced the call to warn by Apache->server->log->debug because warn 
> does not log anything - at least under win32)
> 
> =================================
> # mod_perl startup script
> use Apache2 ();
> use ModPerl::Util ();
> use Apache::RequestRec ();
> use Apache::RequestIO ();
> use Apache::RequestUtil ();
> use Apache::ServerRec ();
> use Apache::ServerUtil ();
> use Apache::Connection ();
> use Apache::Log ();
> use Apache::Const -compile => ':common';
> use APR::Const -compile => ':common';
> use APR::Table ();
> use Apache::compat ();
> use ModPerl::Registry ();
> 
> # Special function called when a new interpreter is started
> sub Startup::CLONE {
>     Apache->server->log->debug("CLONE is running");
>     require Win32::OLE;
> }
> 
> 1;
> =================================
> 
> This still fails to startup with the same MS Apache failure dialog
> The only line I get in the error log is the following:
> 
> [Mon Nov 29 11:11:44 2004] [debug] mod_perl_startup.pl(22): CLONE is 
> running
> 
> 
> If I comment the "require Win32::OLE" server starts up correctly and 
> error log contains the following lines:
> 
> ...
> [Mon Nov 29 11:11:44 2004] [debug] mod_perl_startup.pl(22): CLONE is 
> running
> [Mon Nov 29 11:28:38 2004] [debug] mod_perl_startup.pl(22): CLONE is 
> running
> [Mon Nov 29 11:30:33 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:33 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:33 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:34 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:34 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:35 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:35 2004] [notice] Parent: Created child process 3492
> [Mon Nov 29 11:30:35 2004] [debug] mpm_winnt.c(479): Parent: Sent the 
> scoreboard to the child
> [Mon Nov 29 11:30:35 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:35 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:35 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:36 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:36 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:37 2004] [debug] mod_perl_startup.pl(19): CLONE is 
> running
> [Mon Nov 29 11:30:37 2004] [notice] Child 3492: Child process is running
> [Mon Nov 29 11:30:37 2004] [info] Parent: Duplicating socket 188 and 
> sending it to child process 3492
> ...
> 
> 
> 
> Stas Bekman wrote:
> 
>> Thierry Valentin wrote:
>>
>>> Hello,
>>> I've tried the My::HappyWorkaround::CLONE trick...
>>> But sorry, same punishment as before:
>>> => Apache refuses to start + MS Failure Dialog.
>>
>>
>>
>> Does this function get to run at all? Add:
>>
>>   warn "CLONE is running";
>>
>> inside this function and check the logs/console while starting the 
>> server.
>>
>> I'd expect that it should work, since CLONE is run inside the cloned 
>> interprters.
>>
>> Of course you need to remove any other instances of:
>>
>>   use Win32::OLE
>>
>> and inside CLONE it must be require().
>> [...]
>>
>>>> There is one possible solution that will work for you though. Try to 
>>>> add to startup.pl the following code:
>>>>
>>>> sub My::HappyWorkaround::CLONE {
>>>>    require Win32::OLE;
>>>> }
>>>>
>>>> CLONE is a special function which is called when a new interpreter 
>>>> is started. Think of it as ChildInit but for the interpreter.
>>
>>
>>
>>
>>
> 
> 


-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Thierry Valentin <va...@earthdecision.com>.
Hello,

Here is the startup script modified as you recommended:
(I replaced the call to warn by Apache->server->log->debug because warn does not 
log anything - at least under win32)

=================================
# mod_perl startup script
use Apache2 ();
use ModPerl::Util ();
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::RequestUtil ();
use Apache::ServerRec ();
use Apache::ServerUtil ();
use Apache::Connection ();
use Apache::Log ();
use Apache::Const -compile => ':common';
use APR::Const -compile => ':common';
use APR::Table ();
use Apache::compat ();
use ModPerl::Registry ();

# Special function called when a new interpreter is started
sub Startup::CLONE {
     Apache->server->log->debug("CLONE is running");
     require Win32::OLE;
}

1;
=================================

This still fails to startup with the same MS Apache failure dialog
The only line I get in the error log is the following:

[Mon Nov 29 11:11:44 2004] [debug] mod_perl_startup.pl(22): CLONE is running


If I comment the "require Win32::OLE" server starts up correctly and error log 
contains the following lines:

...
[Mon Nov 29 11:11:44 2004] [debug] mod_perl_startup.pl(22): CLONE is running
[Mon Nov 29 11:28:38 2004] [debug] mod_perl_startup.pl(22): CLONE is running
[Mon Nov 29 11:30:33 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:33 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:33 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:34 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:34 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:35 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:35 2004] [notice] Parent: Created child process 3492
[Mon Nov 29 11:30:35 2004] [debug] mpm_winnt.c(479): Parent: Sent the scoreboard 
to the child
[Mon Nov 29 11:30:35 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:35 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:35 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:36 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:36 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:37 2004] [debug] mod_perl_startup.pl(19): CLONE is running
[Mon Nov 29 11:30:37 2004] [notice] Child 3492: Child process is running
[Mon Nov 29 11:30:37 2004] [info] Parent: Duplicating socket 188 and sending it 
to child process 3492
...



Stas Bekman wrote:
> Thierry Valentin wrote:
> 
>> Hello,
>> I've tried the My::HappyWorkaround::CLONE trick...
>> But sorry, same punishment as before:
>> => Apache refuses to start + MS Failure Dialog.
> 
> 
> Does this function get to run at all? Add:
> 
>   warn "CLONE is running";
> 
> inside this function and check the logs/console while starting the server.
> 
> I'd expect that it should work, since CLONE is run inside the cloned 
> interprters.
> 
> Of course you need to remove any other instances of:
> 
>   use Win32::OLE
> 
> and inside CLONE it must be require().
> [...]
> 
>>> There is one possible solution that will work for you though. Try to 
>>> add to startup.pl the following code:
>>>
>>> sub My::HappyWorkaround::CLONE {
>>>    require Win32::OLE;
>>> }
>>>
>>> CLONE is a special function which is called when a new interpreter is 
>>> started. Think of it as ChildInit but for the interpreter.
> 
> 
> 
> 


-- 


Thierry Valentin
earth decision sciences SA
/(formerly known as T-Surf)/
22, allée de la Foret de la Reine
54500 Vandoeuvre-lès-Nancy, France
Email: valentin@earthdecision.com
Phone: +33 (0)3-83-67-66-29
Fax: +33 (0)3-83-67-66-34
Please visit our website at: www.earthdecision.com
<http://www.earthdecision.com/>


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Thierry Valentin wrote:
> Hello,
> I've tried the My::HappyWorkaround::CLONE trick...
> But sorry, same punishment as before:
> => Apache refuses to start + MS Failure Dialog.

Does this function get to run at all? Add:

   warn "CLONE is running\n";

inside this function and check the logs/console while starting the server.

I'd expect that it should work, since CLONE is run inside the cloned 
interprters.

Of course you need to remove any other instances of:

   use Win32::OLE

and inside CLONE it must be require().
[...]
>> There is one possible solution that will work for you though. Try to 
>> add to startup.pl the following code:
>>
>> sub My::HappyWorkaround::CLONE {
>>    require Win32::OLE;
>> }
>>
>> CLONE is a special function which is called when a new interpreter is 
>> started. Think of it as ChildInit but for the interpreter.



-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Thierry Valentin <va...@earthdecision.com>.
Hello,
I've tried the My::HappyWorkaround::CLONE trick...
But sorry, same punishment as before:
=> Apache refuses to start + MS Failure Dialog.

Jan Dubois was pointing out that win32::OLE was not thread safe. So this could 
explain why this still fails at startup, whatever the way we try to load this 
module.

I tried Randy Kobes' suggestion: I moved Win2::OLE outside the startup script 
back to my perl scripts and it solves the problem

Thanks again for your help.



Stas Bekman wrote:
> Thierry Valentin wrote:
> [...]
> 
>>> PerlChildInitHandler  'sub { require Win32::OLE}'
>>>
>>
>> Hello
>> I've tried this: the startup still fails
>> but this time I have no MS error dialog saying that Apache had a problem
>> Apache "cleanly" refuses to start.
>> But there are still no lines in the error.log
> 
> 
> As Jan has answered, the problem is that module is not thread-safe, so 
> my original proposal doesn't work. but see below.
> 
>  > This raises another question:
>  > Is there a performance/memory issue regarding preloading a perl 
> module  > at startup vs. loading it in ModPerl::Registry perl scripts ?
> 
> There certainly is. But each perl interpreter will suffer it only the 
> first time it loads this module, all subsequent requests to the same 
> interpreter will not have any additional overhead.
> 
> There is one possible solution that will work for you though. Try to add 
> to startup.pl the following code:
> 
> sub My::HappyWorkaround::CLONE {
>    require Win32::OLE;
> }
> 
> CLONE is a special function which is called when a new interpreter is 
> started. Think of it as ChildInit but for the interpreter.
> 
> Did it do the trick?
> 


-- 


Thierry Valentin
earth decision sciences SA
/(formerly known as T-Surf)/
22, allée de la Foret de la Reine
54500 Vandoeuvre-lès-Nancy, France
Email: valentin@earthdecision.com
Phone: +33 (0)3-83-67-66-29
Fax: +33 (0)3-83-67-66-34
Please visit our website at: www.earthdecision.com
<http://www.earthdecision.com/>


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Thierry Valentin wrote:
[...]
>> PerlChildInitHandler  'sub { require Win32::OLE}'
>>
> 
> Hello
> I've tried this: the startup still fails
> but this time I have no MS error dialog saying that Apache had a problem
> Apache "cleanly" refuses to start.
> But there are still no lines in the error.log

As Jan has answered, the problem is that module is not thread-safe, so my 
original proposal doesn't work. but see below.

 > This raises another question:
 > Is there a performance/memory issue regarding preloading a perl module 
  > at startup vs. loading it in ModPerl::Registry perl scripts ?

There certainly is. But each perl interpreter will suffer it only the 
first time it loads this module, all subsequent requests to the same 
interpreter will not have any additional overhead.

There is one possible solution that will work for you though. Try to add 
to startup.pl the following code:

sub My::HappyWorkaround::CLONE {
    require Win32::OLE;
}

CLONE is a special function which is called when a new interpreter is 
started. Think of it as ChildInit but for the interpreter.

Did it do the trick?

-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Thierry Valentin <va...@earthdecision.com>.
Stas Bekman wrote:
> Markus Wichitill wrote:
> 
>> Stas Bekman wrote:
>>
>>> Thierry Valentin wrote:
>>>
>>>> Sorry about the imprecision...
>>>> The reason why I forgot to send the error log is that there's 
>>>> absolutely nothing in the error log - not a single line even with a 
>>>> LogLevel set to debug.
>>>
>>>
>>>
>>> Understood. It's always a good idea to mention that, so we don't need 
>>> to guess :)
>>>
>>> Unfortunately I don't use win32 and w/o the error message I can't 
>>> really tell what's wrong. May be Randy has an idea.
>>>
>>> One though: you said you use:
>>> - Perl 5.8.4.810 from Activestate
>>> - Apache 2.0.52 installed from the MSI package
>>> - mod_perl 1.99_17 installed with ppm from http://theoryx5.uwinnipeg.ca
>>
>>
>>
>> I see the same with Apache 2.0.52/Perl 5.8.5/mod_perl 1.99_18-SVN, all 
>> built from vanilla sources.
>>
>> VMem::Free(void * 0x00a13cc4) line 208 + 3 bytes
>> CPerlHost::Free(void * 0x00a13cc4) line 59 + 34 bytes
>> PerlMemFree(IPerlMem * 0x009f4024, void * 0x00a13cc4) line 302
>> Perl_safesysfree(void * 0x00a13cc4) line 144 + 26 bytes
>> AtExit(interpreter * 0x00a1501c, void * 0x00a13cc4) line 3167 + 9 bytes
>> perl_destruct(interpreter * 0x00a1501c) line 567 + 48 bytes
>> modperl_perl_destruct(interpreter * 0x00a1501c) line 157 + 9 bytes
>> modperl_interp_destroy(modperl_interp_t * 0x00926490) line 145 + 12 bytes
>> interp_pool_shrink(modperl_tipool_t * 0x00871ac8, void * 0x00871ab8, 
>> void * 0x00926490) line 217 + 9 bytes
>> modperl_tipool_destroy(modperl_tipool_t * 0x00871ac8) line 204 + 30 bytes
>> modperl_interp_pool_destroy(void * 0x00871ab8) line 190 + 12 bytes
>> run_cleanups(cleanup_t * * 0x008a6af8) line 1951 + 13 bytes
>> apr_pool_destroy(apr_pool_t * 0x008a6ae8) line 730 + 12 bytes
>> apr_pool_clear(apr_pool_t * 0x0028a5b0) line 690 + 12 bytes
>> main(int 2, const char * const * 0x002825a8) line 576
>> mainCRTStartup() line 338 + 17 bytes
>> KERNEL32! 7c816d4f()
>>
>> Access violation happens in the "*nowhere = 0;" line of 
>> perl-5.8.5\win32\vmem.h, with nowhere being 0.
> 
> 
> Is it again a problem of wrong context? Even though there is no usual 
> "wrong pool to free" error here.
> 
> It looks like the problem happens in Apache's internal restart.
> Any difference if that module is loaded in ChildInit handler? Should it 
> still segfault on the normal server shutdown.
> 
> PerlChildInitHandler  'sub { require Win32::OLE}'
> 

Hello
I've tried this: the startup still fails
but this time I have no MS error dialog saying that Apache had a problem
Apache "cleanly" refuses to start.
But there are still no lines in the error.log

-- 


Thierry Valentin
earth decision sciences SA
/(formerly known as T-Surf)/
22, allée de la Foret de la Reine
54500 Vandoeuvre-lès-Nancy, France
Email: valentin@earthdecision.com
Phone: +33 (0)3-83-67-66-29
Fax: +33 (0)3-83-67-66-34
Please visit our website at: www.earthdecision.com
<http://www.earthdecision.com/>


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Markus Wichitill wrote:
> Stas Bekman wrote:
> 
>> Thierry Valentin wrote:
>>
>>> Sorry about the imprecision...
>>> The reason why I forgot to send the error log is that there's 
>>> absolutely nothing in the error log - not a single line even with a 
>>> LogLevel set to debug.
>>
>>
>> Understood. It's always a good idea to mention that, so we don't need 
>> to guess :)
>>
>> Unfortunately I don't use win32 and w/o the error message I can't 
>> really tell what's wrong. May be Randy has an idea.
>>
>> One though: you said you use:
>> - Perl 5.8.4.810 from Activestate
>> - Apache 2.0.52 installed from the MSI package
>> - mod_perl 1.99_17 installed with ppm from http://theoryx5.uwinnipeg.ca
> 
> 
> I see the same with Apache 2.0.52/Perl 5.8.5/mod_perl 1.99_18-SVN, all 
> built from vanilla sources.
> 
> VMem::Free(void * 0x00a13cc4) line 208 + 3 bytes
> CPerlHost::Free(void * 0x00a13cc4) line 59 + 34 bytes
> PerlMemFree(IPerlMem * 0x009f4024, void * 0x00a13cc4) line 302
> Perl_safesysfree(void * 0x00a13cc4) line 144 + 26 bytes
> AtExit(interpreter * 0x00a1501c, void * 0x00a13cc4) line 3167 + 9 bytes
> perl_destruct(interpreter * 0x00a1501c) line 567 + 48 bytes
> modperl_perl_destruct(interpreter * 0x00a1501c) line 157 + 9 bytes
> modperl_interp_destroy(modperl_interp_t * 0x00926490) line 145 + 12 bytes
> interp_pool_shrink(modperl_tipool_t * 0x00871ac8, void * 0x00871ab8, 
> void * 0x00926490) line 217 + 9 bytes
> modperl_tipool_destroy(modperl_tipool_t * 0x00871ac8) line 204 + 30 bytes
> modperl_interp_pool_destroy(void * 0x00871ab8) line 190 + 12 bytes
> run_cleanups(cleanup_t * * 0x008a6af8) line 1951 + 13 bytes
> apr_pool_destroy(apr_pool_t * 0x008a6ae8) line 730 + 12 bytes
> apr_pool_clear(apr_pool_t * 0x0028a5b0) line 690 + 12 bytes
> main(int 2, const char * const * 0x002825a8) line 576
> mainCRTStartup() line 338 + 17 bytes
> KERNEL32! 7c816d4f()
> 
> Access violation happens in the "*nowhere = 0;" line of 
> perl-5.8.5\win32\vmem.h, with nowhere being 0.

Is it again a problem of wrong context? Even though there is no usual 
"wrong pool to free" error here.

It looks like the problem happens in Apache's internal restart.
Any difference if that module is loaded in ChildInit handler? Should it 
still segfault on the normal server shutdown.

PerlChildInitHandler  'sub { require Win32::OLE}'

-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Markus Wichitill <ma...@gmx.de>.
Stas Bekman wrote:
> Thierry Valentin wrote:
>> Sorry about the imprecision...
>> The reason why I forgot to send the error log is that there's 
>> absolutely nothing in the error log - not a single line even with a 
>> LogLevel set to debug.
> 
> Understood. It's always a good idea to mention that, so we don't need to 
> guess :)
> 
> Unfortunately I don't use win32 and w/o the error message I can't really 
> tell what's wrong. May be Randy has an idea.
> 
> One though: you said you use:
> - Perl 5.8.4.810 from Activestate
> - Apache 2.0.52 installed from the MSI package
> - mod_perl 1.99_17 installed with ppm from http://theoryx5.uwinnipeg.ca

I see the same with Apache 2.0.52/Perl 5.8.5/mod_perl 1.99_18-SVN, all built 
from vanilla sources.

VMem::Free(void * 0x00a13cc4) line 208 + 3 bytes
CPerlHost::Free(void * 0x00a13cc4) line 59 + 34 bytes
PerlMemFree(IPerlMem * 0x009f4024, void * 0x00a13cc4) line 302
Perl_safesysfree(void * 0x00a13cc4) line 144 + 26 bytes
AtExit(interpreter * 0x00a1501c, void * 0x00a13cc4) line 3167 + 9 bytes
perl_destruct(interpreter * 0x00a1501c) line 567 + 48 bytes
modperl_perl_destruct(interpreter * 0x00a1501c) line 157 + 9 bytes
modperl_interp_destroy(modperl_interp_t * 0x00926490) line 145 + 12 bytes
interp_pool_shrink(modperl_tipool_t * 0x00871ac8, void * 0x00871ab8, void * 
0x00926490) line 217 + 9 bytes
modperl_tipool_destroy(modperl_tipool_t * 0x00871ac8) line 204 + 30 bytes
modperl_interp_pool_destroy(void * 0x00871ab8) line 190 + 12 bytes
run_cleanups(cleanup_t * * 0x008a6af8) line 1951 + 13 bytes
apr_pool_destroy(apr_pool_t * 0x008a6ae8) line 730 + 12 bytes
apr_pool_clear(apr_pool_t * 0x0028a5b0) line 690 + 12 bytes
main(int 2, const char * const * 0x002825a8) line 576
mainCRTStartup() line 338 + 17 bytes
KERNEL32! 7c816d4f()

Access violation happens in the "*nowhere = 0;" line of 
perl-5.8.5\win32\vmem.h, with nowhere being 0.

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Thierry Valentin wrote:
> Hello,
> Sorry about the imprecision...
> The reason why I forgot to send the error log is that there's absolutely 
> nothing in the error log - not a single line even with a LogLevel set to 
> debug.

Understood. It's always a good idea to mention that, so we don't need to 
guess :)

Unfortunately I don't use win32 and w/o the error message I can't really 
tell what's wrong. May be Randy has an idea.

One though: you said you use:
- Perl 5.8.4.810 from Activestate
- Apache 2.0.52 installed from the MSI package
- mod_perl 1.99_17 installed with ppm from http://theoryx5.uwinnipeg.ca

Is it possible that this ppm requires you to also download a perl ppm from 
randy's site. And win32::OLE too? I'm just guessing here.

-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Thierry Valentin <va...@earthdecision.com>.
Hello,
Sorry about the imprecision...
The reason why I forgot to send the error log is that there's absolutely nothing 
in the error log - not a single line even with a LogLevel set to debug.

The only feedback I get is the standard Microsoft error dialog that says:

"Apache HTTP server has encountered a problem and needs to close..."

and proposes to send Microsoft a bug report.

Then I get the Apache Monitor Error Dialog with this message:

"The requested operation has failed"


Note that 2 files are attached to the Microsoft bug report:
- Apache.exe.mdmp - binary (144KB)
- appcompat.txt - textual - (22KB)

Are these files of any help to you?

One important information that could help:
I'm running windows Xp professionnal

Sorry about the few information, but I've nothing more.
Best regards
Thierry


Stas Bekman wrote:
> Thierry Valentin wrote:
> 
>> Hello,
>> I'm currently using the following configuration:
>>
>> - Perl 5.8.4.810 from Activestate
>> - Apache 2.0.52 installed from the MSI package
>> - mod_perl 1.99_17 installed with ppm from http://theoryx5.uwinnipeg.ca
>>
>> All these 3 packages are frehsly installed and I did no other additions.
>>
>> After configuring mod_perl in http.conf I tried the following:
>>
>> - preload Win32::OLE with a 'use Win32::OLE' in the mod_perl startup 
>> script:
>> => Apache2 refuses to start.
>>
>> - preload Win32::OLE with a PerlModule Win32::OLE' directive in 
>> http.conf:
>> => Apache2 still refuses to start
>>
>>
>> What's strange is that CGI scripts that use Win32::OLE under mod_perl 
>> in an identical server configuration run successfully!
>>
>> What did I miss?
> 
> 
> The exact error messsage?
> 


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Stas Bekman <st...@stason.org>.
Thierry Valentin wrote:
> Hello,
> I'm currently using the following configuration:
> 
> - Perl 5.8.4.810 from Activestate
> - Apache 2.0.52 installed from the MSI package
> - mod_perl 1.99_17 installed with ppm from http://theoryx5.uwinnipeg.ca
> 
> All these 3 packages are frehsly installed and I did no other additions.
> 
> After configuring mod_perl in http.conf I tried the following:
> 
> - preload Win32::OLE with a 'use Win32::OLE' in the mod_perl startup 
> script:
> => Apache2 refuses to start.
> 
> - preload Win32::OLE with a PerlModule Win32::OLE' directive in http.conf:
> => Apache2 still refuses to start
> 
> 
> What's strange is that CGI scripts that use Win32::OLE under mod_perl in 
> an identical server configuration run successfully!
> 
> What did I miss?

The exact error messsage?

-- 
__________________________________________________________________
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

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: Apache2/Modperl2 fails to preload Win32::OLE at server startup

Posted by Aaron Ross <aa...@plusthree.com>.
> - preload Win32::OLE with a 'use Win32::OLE' in the mod_perl startup 
> script:
> => Apache2 refuses to start.

"refuses to start" is pretty vague. Can you send us a specific error 
message from the error log? or the error output of the server process 
when it tries to start?

Aaron

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html