Kevin A. McGrail wrote:
> Stas,
> 
> I'm much closer thanks to your document*.  I now at least I feel like I'm
> moving forward for the first time in months.

cool! :)

> OK, so I'm pretty sure short of recompiling Perl, that I have all the
> correct debug things turned on though the user permission problem still
> plague me a bit.  I just chgrp'd the whole dir to httpd and did a chmod
> g+w -R so I think that should fix any permission problems for a core file to
> be created.
> 
> Here's some notes abour your document and the problems I had as I'm pretty
> sure it's a work in progress.
> 
> 1st,  I had a little trouble following the Bad Segv stuff because I had to
> install Parser and then Inline.  That was no big deal but then your code was
> written for a much older version of Inline and no longer works, yada, yada,
> yada.  The version of Bad::Segv that I developed VERY quickly to get around
> this is up at http://www.peregrinehw.com/downloads/apache/mod_perl

thanks, I'll update the online version with your corrected one, once we 
figure out how to make it work with mod_perl.

> 2nd, The segv.cgi at the same location as the Bad:Segv above, segfaults on
> the command line and through normal CGI but not with mod_perl.  Here's the
> error I get trying to run this script with mod_perl (1.26):
> 
> [Tue Apr  9 09:53:16 2002] [error] [Tue Apr  9 09:53:16 2002] PerlHandler
> subroutine `Apache::Registry::handler': Undefined subroutine
> &Bad::Segv::segv called at /htdocs/peregrinehw.com/html/segv.cgim line 12.
> [Tue Apr  9 09:53:16 2002] END block subroutine `Inline::END': One or
> moreDATA sections were not processed by Inline.
> [Tue Apr  9 09:53:16 2002] END block subroutine `Inline::END':
> 
> Thoughts?  Something special with mod_perl?  I didn't add the Bad::Segv to
> the startup.pl or anything at all.

Looks like you cannot run the Inline code under mod_perl. I remember 
Brian told me the secret code to make it work under mod_perl :) Can you 
run a simple Inline code doing just printf("Hello")? Once you make it 
run, the segfault should work just as well. could be that your webserver 
has no write perms to Inline dir... but you say it works with mod_cgi...

I'm a little out of sync with the recent developments with Inline, but 
last time I needed to do it for the book we work on, I wrote:

   package Factorial;
   use strict;

   use Apache::Constants qw(:common);

   use Inline 'Untaint';
   use Inline Config => DIRECTORY => '/tmp/Inline';
   use Inline 'C';
   Inline->init;

   sub handler {
       my $r = shift;
       $r->send_http_header('text/plain');

       printf "%3d! = %10d\n", $_, factorial($_) for 1..10;

       return Apache::Constants::OK;
   }

   1;

   __DATA__

   __C__

   double factorial(int x) {
       if (x < 2)  return 1;
       return x * factorial(x - 1);
   }

make sure that /tmp/Inline is writable by the webserver.
Hopefully you will figure out how to fix completely Bad::Segv and I'll 
have more time to do other things :) Thanks.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Reply via email to