You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by mt...@towertechnology.com.au on 2001/02/05 05:52:54 UTC

mod_perl failing to interpret bytecode modules

Arguments about open source aside, I have been asked to convert our
commercial mod_perl modules into bytecode. I have tried to do this but have
encountered various problems as described below.  I have also browsed the
previous discussion threads on this topic with interest, but they are quite
old, and it is not clear that anyone has actually got this working.

Any feedback on this issue would be much appreciated. I need to know
whether this is a "show stopper" or just something I am doing wrongly.

Thanks,
Mark Twose
(Senior Software Consultant)


My experience is as follows:

I am using Apache 1.3.12 and Mod Perl 1.24.01 that I have built on Solaris
2.6.

Having sucessfully converted and run a simple stand alone perl script I
decided to try a simple mod_perl based web page (Hello.pm) attached:
(See attached file: Hello.pm)

I can successfully convert Apache/Hello.pm into bytcode by doing the
following:
   perlcc -b -o Hello_bc.pm Hello.pm
   mv Hello.pm Hello_txt.pm
   cp Hello_bc.pm Hello.pm

I then registered this in httpd.conf with the following directives:

   <Location /hello/friend>
           SetHandler perl-script
           PerlHandler     Apache::Hello
   </Location>

When I access hello/friend from a browser the following error is logged in
apache/logs/error_log:

   [Mon Feb  5 13:13:41 2001] [notice] child pid 1967 exit signal Bus Error
   (10)

I have also tried encoding Hello.pm using the example "Rot13" source
filter. This also fails to interpret under mod_perl.

I then tried bytecoding an Apache Perl Module. I pre-loaded this with the
following directive:

     PerlModule Apache::MyModule

Apache core dumped  on  startup as follows:

   (gdb) where
   #0  0xef563a08 in byteloader_filter ()
      from
   /usr/local/lib/perl5/5.6.0/sun4-solaris/auto/ByteLoader/ByteLoader.so
   #1  0xc7b50 in S_filter_gets ()
   #2  0xc9480 in Perl_yylex ()
   #3  0xdcf98 in Perl_yyparse ()
   #4  0x14b544 in S_doeval ()
   #5  0x14ce9c in Perl_pp_require ()
   #6  0x111b88 in Perl_runops_standard ()
   #7  0xb9670 in perl_eval_sv ()
   #8  0x3ec88 in perl_require_module ()
   #9  0x392e4 in perl_cmd_module ()
   #10 0x82fec in invoke_cmd ()
   #11 0x83680 in ap_handle_command ()
   #12 0x83760 in ap_srm_command_loop ()
   #13 0x83ec4 in ap_process_resource_config ()
   #14 0x84b00 in ap_read_config ()
   #15 0x93428 in main ()

I am guessing that the problem is related to the perl "eval" function. I
have tried running bytecode (& source filtered) modules using "eval"
directly from Perl and this also failed. Perhaps this is a limitation of
PERL, not mod_perl?