You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Richard Foley <Ri...@rfi.net> on 2006/11/22 12:28:22 UTC

Module code being truncated with modperl 1.29 and apache 1.3.36

I'm seeing some strange behaviour with modperl, it appears to be truncating 
the module code for certain files.  Firstly, the code runs fine under CGI and 
using a similar commandline setup.  Next, there's a apache/conf/startup.pl 
script which loads all the expected modules at startup, and the library files 
are all their via a manual (commandline) run.  Everything appears ok when 
apache starts up.  

  [notice] Apache/1.3.36 (Unix) mod_perl/1.29 configured -- resuming normal 
operations

Again, under 'normal' cgi usage there are no problems, however, as soon as a 
page is requested from the server, a log file entry of the form: 

  [error] Error executing run mode 'display': Can't locate object method 
"page" via package "Class::CGI::Welcome" at /classes/Class/CGI/Welcome.pm 
line 34.\n at (eval 1361)
[/usr/lib/perl5/site_perl/5.8.7/i586-linux-thread-multi/Apache/Registry.pm:184] 
line 5\n

Now, the Class::CGI::Welcome module is loaded.  I can even see the correct and 
up to date code entry under @{main::_<$pathtowelcomedotpm}, _but_, the code 
simply stops after 20 lines, so that the page() method is (clearly because 
it's not there) not found.  What I mean is that the first 20 lines of the 
module can be seen, and the rest appears to have been inconveniently and 
completely truncated for some unknown reason.  

Has anyone seen this before?  Am I being remarkably slow here?  Any helpful 
hints appreciated.

	$> perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
    osname=linux, osvers=2.6.13-15-smp, archname=i686-linux-thread-multi
    uname='linux linux225 2.6.13-15-smp #1 smp tue sep 13 14:56:15 utc 2005 
i686 i686 i386 gnulinux '
    config_args='-des 
-Dotherlibdirs=/usr/lib/perl5/5.8.7:/usr/lib/perl5/5.8.7/i586-linux-thread-multi:/usr/lib/perl5/site_perl:/usr/lib/perl5/site_perl/5.8.7:/usr/lib/perl5/site_perl/5.8.7/i586-linux-thread-multi:/usr/lib/perl5/vendor_perl:/usr/lib/perl5/vendor_perl/5.8.7:/usr/lib/perl5/vendor_perl/5.8.7/i586-linux-thread-multi 
-Dinstallusrbinperl -Dusethreads'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -pipe -Wdeclaration-after-statement 
-I/usr/local/include'
    ccversion='', gccversion='4.0.2 20050901 (prerelease) (SUSE Linux)', 
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.3.5.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.5'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
                        PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_ITHREADS
                        USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
  Built under linux
  Compiled at Oct 20 2006 15:27:16
  @INC:
    /usr/local/lib/perl5/5.8.8/i686-linux-thread-multi
    /usr/local/lib/perl5/5.8.8
    /usr/local/lib/perl5/site_perl/5.8.8/i686-linux-thread-multi
    /usr/local/lib/perl5/site_perl/5.8.8
    /usr/local/lib/perl5/site_perl
    /usr/lib/perl5/5.8.7
    /usr/lib/perl5/5.8.7/i586-linux-thread-multi
    /usr/lib/perl5/site_perl
    /usr/lib/perl5/site_perl/5.8.7
    /usr/lib/perl5/site_perl/5.8.7/i586-linux-thread-multi
    /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/vendor_perl/5.8.7
    /usr/lib/perl5/vendor_perl/5.8.7/i586-linux-thread-multi


-- 
Richard Foley
Ciao - shorter than aufwiedersehen

http://www.rfi.net/

Re: Module code being truncated with modperl 1.29 and apache 1.3.36

Posted by Perrin Harkins <pe...@elem.com>.
Richard Foley wrote:
> Thing is, it's not happening on another box, with a similar installation, and 
> the same code base, so I'm suspecting something environment oriented, odd 
> libraries or the like.  The major thing that's different is the modperl 
> installation - which I installed against apache manually, under SuSe 10, 
> instead of using the standard Debian package install which the working box 
> uses, for various reasons.

Did you compile mod_perl as DSO by any chance?  I might try doing it 
statically.  Also, see if the perl on the machine where it works is the 
same as this one, with the same compile options (especially threads).

- Perrin

Re: Module code being truncated with modperl 1.29 and apache 1.3.36

Posted by Richard Foley <Ri...@rfi.net>.
I knew it was a stupid question :-)

Thing is, it's not happening on another box, with a similar installation, and 
the same code base, so I'm suspecting something environment oriented, odd 
libraries or the like.  The major thing that's different is the modperl 
installation - which I installed against apache manually, under SuSe 10, 
instead of using the standard Debian package install which the working box 
uses, for various reasons.  And modperl doesn't work, so I'm suspecting 
either I've messed something up, or modperl has.  I'm clearly more likely to 
be at fault here, but it's very wierd behaviour, so I thought someone else 
might have come across it before.

R.

On Wednesday 22 November 2006 17:42, Michael Peters wrote:
> 
> Richard Foley wrote:
> > On Wednesday 22 November 2006 16:21, Michael Peters wrote:
> >> I've never seen anything like this before. Does it happen with all of 
your
> >> modules or just some of them. 
> >>
> > I'm only noticing it with a couple of modules out of a batch of perhaps a 
> > thousand...
> > 
> >> Are you using source filters? 
> >>
> > I don't think so.
> > 
> >> Or are you using modules with source filters (like Switch)?
> >>
> > Well, I was about to say no, I'm not using Switch, but then I checked :-\, 
and 
> > yes, it appears some of the code uses Switch.  Now I'm not sure this has 
an 
> > effect because Switch is not loaded at the time I can see the truncated 
> > library, but maybe something related is happening.
> 
> Well, Switch is just one library that uses source filters.
> 
> > What makes you think it's a "module with a source filter" issue of some 
kind?  
> > If it's not a daft question ?-)
> 
> Source filters actually alter the source code. It's not just doing symbol 
table
> manipulation or changing the parsing rules. It's actually parsing your code 
and
> changing it. If some code has something that the filter's parser can't deal
> with, strange things can happen.
> 

-- 
Richard Foley
Ciao - shorter than aufwiedersehen

http://www.rfi.net/

Re: Module code being truncated with modperl 1.29 and apache 1.3.36 - fixed

Posted by Richard Foley <Ri...@rfi.net>.
On Wednesday 22 November 2006 17:42, Michael Peters wrote:> 
> >> I've never seen anything like this before. Does it happen with all
> >> of your modules or just some of them. 
> >>
> > I'm only noticing it with a couple of modules out of a batch of perhaps a 
> > thousand...
> > 
Ok, so the reason for my module code being missing in some places, and not in 
others, was someone had written a startup.pl script, which was appropriately 
being called from the apache config, in which was a statement like this:
	
	eval "require $package";

Naturally there was no matching:

	die 'dramatically '.$@ if $@;

so I blissfully missed all the obvious and helpful error messages.  My only 
excuse for not seeing this before is I've been ill with an infection this 
week with a (low) fever too.  I'll creep away slowly about now...

-- 
Richard Foley
Ciao - shorter than aufwiedersehen

http://www.rfi.net/

ps. thanks to Andreas for nudging me in the right direction.

Re: Module code being truncated with modperl 1.29 and apache 1.3.36

Posted by Michael Peters <mp...@plusthree.com>.

Richard Foley wrote:
> On Wednesday 22 November 2006 16:21, Michael Peters wrote:
>> I've never seen anything like this before. Does it happen with all of your
>> modules or just some of them. 
>>
> I'm only noticing it with a couple of modules out of a batch of perhaps a 
> thousand...
> 
>> Are you using source filters? 
>>
> I don't think so.
> 
>> Or are you using modules with source filters (like Switch)?
>>
> Well, I was about to say no, I'm not using Switch, but then I checked :-\, and 
> yes, it appears some of the code uses Switch.  Now I'm not sure this has an 
> effect because Switch is not loaded at the time I can see the truncated 
> library, but maybe something related is happening.

Well, Switch is just one library that uses source filters.

> What makes you think it's a "module with a source filter" issue of some kind?  
> If it's not a daft question ?-)

Source filters actually alter the source code. It's not just doing symbol table
manipulation or changing the parsing rules. It's actually parsing your code and
changing it. If some code has something that the filter's parser can't deal
with, strange things can happen.

-- 
Michael Peters
Developer
Plus Three, LP


Re: Module code being truncated with modperl 1.29 and apache 1.3.36

Posted by Richard Foley <Ri...@rfi.net>.
On Wednesday 22 November 2006 16:21, Michael Peters wrote:
> 
> I've never seen anything like this before. Does it happen with all of your
> modules or just some of them. 
>
I'm only noticing it with a couple of modules out of a batch of perhaps a 
thousand...

> Are you using source filters? 
>
I don't think so.

> Or are you using modules with source filters (like Switch)?
>
Well, I was about to say no, I'm not using Switch, but then I checked :-\, and 
yes, it appears some of the code uses Switch.  Now I'm not sure this has an 
effect because Switch is not loaded at the time I can see the truncated 
library, but maybe something related is happening.

What makes you think it's a "module with a source filter" issue of some kind?  
If it's not a daft question ?-)

R.
 
> Richard Foley wrote:
> 
> > Now, the Class::CGI::Welcome module is loaded.  I can even see the correct 
and 
> > up to date code entry under @{main::_<$pathtowelcomedotpm}, _but_, the 
code 
> > simply stops after 20 lines, so that the page() method is (clearly because 
> > it's not there) not found.  What I mean is that the first 20 lines of the 
> > module can be seen, and the rest appears to have been inconveniently and 
> > completely truncated for some unknown reason.  
> > 
> > Has anyone seen this before?  Am I being remarkably slow here?  Any 
helpful 
> > hints appreciated.
> 

-- 
Richard Foley
Ciao - shorter than aufwiedersehen

http://www.rfi.net/

Re: Module code being truncated with modperl 1.29 and apache 1.3.36

Posted by Michael Peters <mp...@plusthree.com>.

Richard Foley wrote:

> Now, the Class::CGI::Welcome module is loaded.  I can even see the correct and 
> up to date code entry under @{main::_<$pathtowelcomedotpm}, _but_, the code 
> simply stops after 20 lines, so that the page() method is (clearly because 
> it's not there) not found.  What I mean is that the first 20 lines of the 
> module can be seen, and the rest appears to have been inconveniently and 
> completely truncated for some unknown reason.  
> 
> Has anyone seen this before?  Am I being remarkably slow here?  Any helpful 
> hints appreciated.

I've never seen anything like this before. Does it happen with all of your
modules or just some of them. Are you using source filters? Or are you using
modules with source filters (like Switch)?

-- 
Michael Peters
Developer
Plus Three, LP


Re: Module code being truncated with modperl 1.29 and apache 1.3.36

Posted by Richard Foley <Ri...@rfi.net>.
Rereading my original post, it appears I may not have been explicit enough 
about what the problem appears to be.  Starting with the error message:  

  [error] Error executing run mode 'display': Can't locate object method 
> "page" via package "Class::CGI::Welcome" at /classes/Class/CGI/Welcome.pm 
> line 34.\n at (eval 1361)

This says the class cannot find the method called.  That's fine, but why not?  
Presumably because the class is not loaded (usual error), or because the 
class has been modified (current error).  The code which I can see from 
within modperl, (using the debugger), is the correct and up-to-date code, 
_but_ it has been snipped off at the neck.  So I can see the top of the file, 
but all the subroutines have been removed...

I hope that's a bit clearer ?-)

Any help appreciated - TIA.

R.

On Wednesday 22 November 2006 12:28, Richard Foley wrote:
> I'm seeing some strange behaviour with modperl, it appears to be truncating 
> the module code for certain files.  Firstly, the code runs fine under CGI 
and 
> using a similar commandline setup.  Next, there's a apache/conf/startup.pl 
> script which loads all the expected modules at startup, and the library 
files 
> are all their via a manual (commandline) run.  Everything appears ok when 
> apache starts up.  
> 
>   [notice] Apache/1.3.36 (Unix) mod_perl/1.29 configured -- resuming normal 
> operations
> 
> Again, under 'normal' cgi usage there are no problems, however, as soon as a 
> page is requested from the server, a log file entry of the form: 
> 
>   [error] Error executing run mode 'display': Can't locate object method 
> "page" via package "Class::CGI::Welcome" at /classes/Class/CGI/Welcome.pm 
> line 34.\n at (eval 1361)
> 
[/usr/lib/perl5/site_perl/5.8.7/i586-linux-thread-multi/Apache/Registry.pm:184] 
> line 5\n
> 
> Now, the Class::CGI::Welcome module is loaded.  I can even see the correct 
and 
> up to date code entry under @{main::_<$pathtowelcomedotpm}, _but_, the code 
> simply stops after 20 lines, so that the page() method is (clearly because 
> it's not there) not found.  What I mean is that the first 20 lines of the 
> module can be seen, and the rest appears to have been inconveniently and 
> completely truncated for some unknown reason.  
> 
> Has anyone seen this before?  Am I being remarkably slow here?  Any helpful 
> hints appreciated.
> 
> 	$> perl -V
> Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
>   Platform:
>     osname=linux, osvers=2.6.13-15-smp, archname=i686-linux-thread-multi
>     uname='linux linux225 2.6.13-15-smp #1 smp tue sep 13 14:56:15 utc 2005 
> i686 i686 i386 gnulinux '
>     config_args='-des 
> 
-Dotherlibdirs=/usr/lib/perl5/5.8.7:/usr/lib/perl5/5.8.7/i586-linux-thread-multi:/usr/lib/perl5/site_perl:/usr/lib/perl5/site_perl/5.8.7:/usr/lib/perl5/site_perl/5.8.7/i586-linux-thread-multi:/usr/lib/perl5/vendor_perl:/usr/lib/perl5/vendor_perl/5.8.7:/usr/lib/perl5/vendor_perl/5.8.7/i586-linux-thread-multi 
> -Dinstallusrbinperl -Dusethreads'
>     hint=recommended, useposix=true, d_sigaction=define
>     usethreads=define use5005threads=undef useithreads=define 
> usemultiplicity=define
>     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
>     use64bitint=undef use64bitall=undef uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
> -fno-strict-aliasing -pipe -Wdeclaration-after-statement 
-I/usr/local/include 
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
>     optimize='-O2',
>     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
> -fno-strict-aliasing -pipe -Wdeclaration-after-statement 
> -I/usr/local/include'
>     ccversion='', gccversion='4.0.2 20050901 (prerelease) (SUSE Linux)', 
> gccosandvers=''
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
>     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
> lseeksize=8
>     alignbytes=4, prototype=define
>   Linker and Libraries:
>     ld='cc', ldflags =' -L/usr/local/lib'
>     libpth=/usr/local/lib /lib /usr/lib
>     libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
>     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
>     libc=/lib/libc-2.3.5.so, so=so, useshrplib=false, libperl=libperl.a
>     gnulibc_version='2.3.5'
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
>     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
> 
> 
> Characteristics of this binary (from libperl):
>   Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT
>                         PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_ITHREADS
>                         USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API
>   Built under linux
>   Compiled at Oct 20 2006 15:27:16
>   @INC:
>     /usr/local/lib/perl5/5.8.8/i686-linux-thread-multi
>     /usr/local/lib/perl5/5.8.8
>     /usr/local/lib/perl5/site_perl/5.8.8/i686-linux-thread-multi
>     /usr/local/lib/perl5/site_perl/5.8.8
>     /usr/local/lib/perl5/site_perl
>     /usr/lib/perl5/5.8.7
>     /usr/lib/perl5/5.8.7/i586-linux-thread-multi
>     /usr/lib/perl5/site_perl
>     /usr/lib/perl5/site_perl/5.8.7
>     /usr/lib/perl5/site_perl/5.8.7/i586-linux-thread-multi
>     /usr/lib/perl5/vendor_perl
>     /usr/lib/perl5/vendor_perl/5.8.7
>     /usr/lib/perl5/vendor_perl/5.8.7/i586-linux-thread-multi
> 
> 
> -- 
> Richard Foley
> Ciao - shorter than aufwiedersehen
> 
> http://www.rfi.net/
> 
> 

-- 
Richard Foley
Ciao - shorter than aufwiedersehen

http://www.rfi.net/