Re: Segmentation Fault [was: The Eagle has Landed!]

2000-07-15 Thread jeff

ANy word on why the startup print line is executing twice. I'm having the same
problem. But I'm running apache w/o the -X option.


Greg Leidreiter wrote:

> Hello all,
>
> I have recompiled mod_perl/apache with PERL_DEBUG=1
>
> running
>
> gdb httpd
>
> followed by
>
> run httpd -X
>
> produces the following output:
>
> startup.pl is attempting to modify the include path...
>
> startup.pl is attempting to modify the include path...
>
> Program received signal SIGSEGV, segmentation fault
> 0x807ca20 in perl_handler_ismethod()
>
> (It is interesting that the "...modification..." line appears twice. I added
> it (once only!)
> to the beginning of my startup.pl so that I could see if it was being found.
> It somehow  seems to be being found more than I expected!)
>
> bt produces:
>
> #0  0x807ca20 in perl_handler_ismethod()
> #1  0x807d2c4 in perl_call_handler()
> #2  0x807ce36 in perl_run_stacked_handler()
> #3  0x807bb7d in perl_handler()
> #4  0x8096af3 in ap_invoke_handler()
> #5  0x80aa0f9 in ap_some_auth_required()
> #6  0x80aa15c in ap_process_request()
> #7  0x80a1a0e in ap_child_terminate()
> #8  0x80a1b9c in ap_child_terminate()
> #9  0x80a1cf9 in ap_child_terminate()
> #10 0x80a2326 in ap_child_terminate()
> #11 0x80a2ab3 in main()
> #12 0x400d31eb in --libc_start_main (main=0x80a276c , argc=3,
> argv=0xbce4, init=0x8061f9c <_init>, fini=0x8136d7c <_fini>,
> rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbcdc) at
> ../sysdeps/generic/libc-start.c:90
>
> If this makes sense to anybody please drop me a line, I've read all the way
> through chapters
> 1-6 and I'm itching to try out some code... just can't get the setup
> straight :0
>
> Thanks,
> Greg
>
> PS. Here is the config again, just to be sure:
>
> Perl 5.6.0
> Apache 1.3.12
> mod_perl-1.24
>
> ServerRoot is /usr/local/apache
> underneath which I have created the lib/perl/Apache tree for holding
> mod_perl modules,
> and dutifully entered the required code in a file called Hello.pm in this
> directory.
>
> DocumentRoot is /usr/local/apache/htdocs
>
> in httpd.conf I have added the following:
> --
> 
> Include conf/perl.conf
> 
> --
>
> conf/perl.conf looks like this:
> --
> PerlRequire conf/startup.pl
> PerlFreshRestart On
>
> 
> SetHandler perl-script
> PerlHandler Apache::Hello
> 
>
> ---
>
> and startup.pl looks like this:
> ---
> #!/usr/local/bin/perl
>
> print "\n\tstartup.pl is attempting to modify the include path...\n\n";
>
> BEGIN {
> use Apache();
> use lib Apache->server_root_relative('lib/perl');
> }
>
> use Apache::Registry
> use Apache::Constants
> use CGI qw(-compile :all);
> use CGI::Carp;
>
> 1;
> --

--
Jeff Saenz
[EMAIL PROTECTED]





Re: Segmentation Fault [was: The Eagle has Landed!]

2000-07-15 Thread G.W. Haywood

Hi there,

On Sat, 15 Jul 2000, Greg Leidreiter wrote:

> I have recompiled mod_perl/apache with PERL_DEBUG=1

>   startup.pl is attempting to modify the include path...
>   startup.pl is attempting to modify the include path...
>   Program received signal SIGSEGV, segmentation fault
>   0x807ca20 in perl_handler_ismethod()

> (It is interesting that the "...modification..." line appears
> twice. I added it (once only!)  to the beginning of my startup.pl so
> that I could see if it was being found.  It somehow seems to be
> being found more than I expected!)

Have a look for $Apache::Server::Starting an PERL_STARTUP_DONE_CHECK
in the Guide.  They in the configuration and troubleshooting sections
in my (oldish - February) copy.  The Guide's kindofa moving target.

Eric will probably help you with the sigsev.
They seem to be getting more common thesedays...

73,
Ged.





Segmentation Fault [was: The Eagle has Landed!]

2000-07-15 Thread Greg Leidreiter

Hello all,

I have recompiled mod_perl/apache with PERL_DEBUG=1

running

gdb httpd

followed by

run httpd -X

produces the following output:

startup.pl is attempting to modify the include path...

startup.pl is attempting to modify the include path...

Program received signal SIGSEGV, segmentation fault
0x807ca20 in perl_handler_ismethod()

(It is interesting that the "...modification..." line appears twice. I added
it (once only!)
to the beginning of my startup.pl so that I could see if it was being found.
It somehow  seems to be being found more than I expected!)

bt produces:

#0  0x807ca20 in perl_handler_ismethod()
#1  0x807d2c4 in perl_call_handler()
#2  0x807ce36 in perl_run_stacked_handler()
#3  0x807bb7d in perl_handler()
#4  0x8096af3 in ap_invoke_handler()
#5  0x80aa0f9 in ap_some_auth_required()
#6  0x80aa15c in ap_process_request()
#7  0x80a1a0e in ap_child_terminate()
#8  0x80a1b9c in ap_child_terminate()
#9  0x80a1cf9 in ap_child_terminate()
#10 0x80a2326 in ap_child_terminate()
#11 0x80a2ab3 in main()
#12 0x400d31eb in --libc_start_main (main=0x80a276c , argc=3,
argv=0xbce4, init=0x8061f9c <_init>, fini=0x8136d7c <_fini>,
rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbcdc) at
../sysdeps/generic/libc-start.c:90


If this makes sense to anybody please drop me a line, I've read all the way
through chapters
1-6 and I'm itching to try out some code... just can't get the setup
straight :0

Thanks,
Greg



PS. Here is the config again, just to be sure:

Perl 5.6.0
Apache 1.3.12
mod_perl-1.24

ServerRoot is /usr/local/apache
underneath which I have created the lib/perl/Apache tree for holding
mod_perl modules,
and dutifully entered the required code in a file called Hello.pm in this
directory.

DocumentRoot is /usr/local/apache/htdocs

in httpd.conf I have added the following:
--

Include conf/perl.conf

--


conf/perl.conf looks like this:
--
PerlRequire conf/startup.pl
PerlFreshRestart On


SetHandler perl-script
PerlHandler Apache::Hello


---

and startup.pl looks like this:
---
#!/usr/local/bin/perl

print "\n\tstartup.pl is attempting to modify the include path...\n\n";

BEGIN {
use Apache();
use lib Apache->server_root_relative('lib/perl');
}

use Apache::Registry
use Apache::Constants
use CGI qw(-compile :all);
use CGI::Carp;

1;
--




RE: The Eagle has landed!

2000-07-13 Thread G.W. Haywood

Hi all,

On Wed, 12 Jul 2000, Dan Rench wrote:

> Watch out for those @INC push()es in your configs.
> I used to have one of those in mine, and every time I did a kill -USR1,
> @INC grew,

'sfunny, that happened to me even though I *wasn't* using a push.
Never got a reply to my question though...

73,
Ged.





Re: The Eagle has landed!

2000-07-12 Thread Roger Espel Llima

Dan Rench <[EMAIL PROTECTED]> wrote:
> According to pages 500-501 in the Eagle book, changes made to @INC from
> PerlRequire'd code don't stick.

That is strange, because it seems to work here.  I have 

PerlRequire /www/perl/perlstart.pl

in my httpd.conf, and perlstart.pl starts with

BEGIN { unshift @INC, "/www/perl" if $INC[0] ne '/www/perl' }

and nothing else could possibly be putting "/www/perl" in @INC (Apache's
root is /usr/local/apache).

I guess I've been using an undocumented behavior all long...

-- 
Roger Espel Llima, [EMAIL PROTECTED]
http://www.iagora.com/~espel/index.html



RE: The Eagle has landed!

2000-07-12 Thread Dan Rench

On Wed, 12 Jul 2000, Greg Leidreiter wrote:

> Firstly becuase the Eagle book seems very rigorous to me, and such an
> oversight as forgetting to push a path into @INC should have been picked up
> well before now. I've never heard mention of this problem...

mod_perl automatically adds {ServerRoot} and {ServerRoot}/lib/perl to @INC.

> Moreover, Stein
> and MacEachern *do* address the issue of having to add another lib path. In
> my understanding that's exactly the point of the BEGIN block in startup.pl -
> it's just that for some reason this doesn't seem to be getting picked up
> properly.

According to pages 500-501 in the Eagle book, changes made to @INC from
PerlRequire'd code don't stick.

> Secondly, when I added the  push ... directive to perl.conf the server
> repeatedly failed to start (which may provide a clue to those of you out
> there who know a lot more than I do) even though it came up with Syntax OK
> under httpd -t.

Watch out for those @INC push()es in your configs.
I used to have one of those in mine, and every time I did a kill -USR1,
@INC grew, though I didn't realize this at first.  Then I found out about
{ServerRoot}/lib/perl, moved my modules there, and dumped the @INC
modifications.




Re: The Eagle has landed!

2000-07-12 Thread G.W. Haywood

Hi there,

On Tue, 11 Jul 2000, Greg Leidreiter wrote:

> when attempting to access http://localhost/hello/world from a
> browser it returns 404, and the errorlog shows the /hello/world URL appended
> to DocumentRoot

> any ideas?

Is there an `Alias' directive somewhere in your config?

73,
Ged.






RE: The Eagle has landed!

2000-07-11 Thread Greg Leidreiter



-Original Message-
From: Darko Krizic [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 11 July 2000 10:56 PM
To: 'Greg Leidreiter'
Subject: RE: The Eagle has landed!


> ServerRoot is /usr/local/apache
> underneath which I have created the lib/perl/Apache tree for holding
> mod_perl modules,
> and dutifully entered the required code in a file called
> Hello.pm in this
> directory.
>
> DocumentRoot is /usr/local/apache/htdocs
>
> in httpd.conf I have added the following:
> --
> 
>   Include conf/perl.conf
> 
> --
>
>
> conf/perl.conf looks like this:
> --
> PerlRequire conf/startup.pl
> PerlFreshRestart On
>
> 
>   SetHandler perl-script
>   PerlHandler Apache::Hello
> 
>
> ---
>
> and startup.pl looks like this:
> ---
> #!/usr/local/bin/perl
>
> print "\n\tstartup.pl is attempting to modify the include
> path...\n\n";
>
> BEGIN {
>   use Apache();
>   use lib Apache->server_root_relative('lib/perl');
> }
>
> use Apache::Registry
> use Apache::Constants
> use CGI qw(-compile :all);
> use CGI::Carp;
>
> 1;
> --

You must add the directory /usr/local/apache/lib/perl to you @INC, for
example like that in your httpd.conf


push @INC,"/usr/local/apache/lib/perl";


If you reference an Module named Apache::MyMod then it is searched as
/usr/local/apache/lib/perl/Apache/MyMod.pm.

...darko


Hmm, while I do appreciate the logic of this approach I remain sceptical for
a number of reasons.

Firstly becuase the Eagle book seems very rigorous to me, and such an
oversight as forgetting to push a path into @INC should have been picked up
well before now. I've never heard mention of this problem... Moreover, Stein
and MacEachern *do* address the issue of having to add another lib path. In
my understanding that's exactly the point of the BEGIN block in startup.pl -
it's just that for some reason this doesn't seem to be getting picked up
properly.

Secondly, when I added the  push ... directive to perl.conf the server
repeatedly failed to start (which may provide a clue to those of you out
there who know a lot more than I do) even though it came up with Syntax OK
under httpd -t.

Any other suggestions?

Cheers,
Greg.




The Eagle has landed!

2000-07-11 Thread Greg Leidreiter

I am trying to work my way through Stein and MacEachern but having a few
teething troubles.
I am following the example code in Chapter 2 faithfully, have build and
installed mod_perl
(which now appears under httpd -l) and modified the configuration files
according to the suggestions in the book. ie:

Perl 5.6.0
Apache 1.3.12
mod_perl-1.24

ServerRoot is /usr/local/apache
underneath which I have created the lib/perl/Apache tree for holding
mod_perl modules,
and dutifully entered the required code in a file called Hello.pm in this
directory.

DocumentRoot is /usr/local/apache/htdocs

in httpd.conf I have added the following:
--

Include conf/perl.conf

--


conf/perl.conf looks like this:
--
PerlRequire conf/startup.pl
PerlFreshRestart On


SetHandler perl-script
PerlHandler Apache::Hello


---

and startup.pl looks like this:
---
#!/usr/local/bin/perl

print "\n\tstartup.pl is attempting to modify the include path...\n\n";

BEGIN {
use Apache();
use lib Apache->server_root_relative('lib/perl');
}

use Apache::Registry
use Apache::Constants
use CGI qw(-compile :all);
use CGI::Carp;

1;
--

which I understood was going to update @INC to include my new module
library, and the  directive would realise that
Apache::Hello refered to /lib/perl/Apache/Hello.pm...

However, when attempting to access http://localhost/hello/world from a
browser it returns 404, and the errorlog shows the /hello/world URL appended
to DocumentRoot, so of course it can't find anything, it's expecting to find
a /hello/world! Clearly I have misunderstood something here
but the Apache manual assures me that arguments to 
are completely independent of the file system... any ideas?

Thanks,
Greg