logo       

Re: [mp1 bug] mp_preload_module() bustage: msg#00130

Subject: Re: [mp1 bug] mp_preload_module() bustage
On Wed, 2003-06-11 at 20:14, Geoffrey Young wrote:
> >     if(!perl_module_is_loaded(*name)) { 
> 
> > PerlLogHandler My::Module->somehandler
> > or
> > PerlLogHandler $My::Obj->somehandler
> 
> 
> > 
> > First of them is that My::Module->somehandler gets called on startup (or
> > once per request if in a .htaccess) without a valid $r as argument.
> > 
> > Second one, the require call itself will most likely fail, trying to
> > require the value of Apache::OK.
> > 
> > I propose to fix mp_preload_module to be a bit smarter and skip those
> > odd cases... 
> > 
> > But I wonder how come this issue hasn't been reported already? Am I
> > missing something terribly simple here?
> 
> I suspect the reason it hasn't been reported is because it tends to fix 
> itself :)  method handlers (in mp1 at least) require the module to be 
> preloaded - otherwise mod_perl doesn't resolve the ($class, $r) stuff 
> properly and it doesn't work anyway.

Well, this does make sense, since if you do
PerlHandler This::Handler->foo, mp_preload_module will try to require
This::Handler->foo and of course, that won't load This::Handler, thus
the run-time problem.

> so, I suspect that most people figure it out when the module doesn't work as 
> expected, preload the module, and don't see a problem.

Well, preloading will sure fix the breakage, but you will still get one
strange _extra_ call to that method with no $r on startup.

> does that seem to gel with what you've found?

Sure does! I figured if I looked back in the mlist archives I might find
something like this. Thanks for the insight then Geoff !

It also means that mp_preload_module is indeed broken and will be fixed
shortly ;-) Unless anybody beats me to it, that is.

> --Geoff
-- 
-- -----------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)
http://gozer.ectoplasm.org/    F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'

Attachment: signature.asc
Description: This is a digitally signed message part

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

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | 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