Re: Apache is exiting....

2003-03-04 Thread Paolo Campanella
On Mon, 3 Mar 2003 13:36:05 + (GMT)
Ged Haywood [EMAIL PROTECTED] wrote:

 Hi there,
 
 On Mon, 3 Mar 2003, Paolo Campanella wrote:
 
  gdb reports that clean_child_exit is not defined - perhaps you are
  looking at newer sources than mine (1.3.22).
 
 Is there a reason why you don't want to upgrade to 1.3.27?

I'm quite tied in to RedHat RPMS, which I've had to customise and
install across various servers. So I need to upgrade sometime, but
it's not something I can undertake lightly. I will test it soon
though  let the list know if it made any difference.




Re: Apache is exiting....

2003-03-04 Thread Paolo Campanella
On Mon, 3 Mar 2003 13:36:05 + (GMT)
Ged Haywood [EMAIL PROTECTED] wrote:

 Hi there,
 
 On Mon, 3 Mar 2003, Paolo Campanella wrote:
 
  gdb reports that clean_child_exit is not defined - perhaps you are
  looking at newer sources than mine (1.3.22).
 
 Is there a reason why you don't want to upgrade to 1.3.27?

Have now tried 1.3.27 - no difference.




Re: Apache is exiting....

2003-03-03 Thread Paolo Campanella
On Fri, 28 Feb 2003 12:15:32 -0800
Kyle Oppenheim [EMAIL PROTECTED] wrote:

 It looks like the parent server will exit if one of its children exits
 with APEXIT_CHILDFATAL.  Unfortunately, if you grep for that in the
 Apache source, it comes up more than a few times.  A stacktrace would be
 useful. Try setting a breakpoint on clean_child_exit() or use a call
 tracing utility like Solaris' truss.

gdb reports that clean_child_exit is not defined - perhaps you are
looking at newer sources than mine (1.3.22).

 Without a stacktrace, you could try to work around the problem.  It

Accept mutexes didn't solve it, but I have a reasonable workaround at
the code level to make it relatively safe - I think this is where I'm
going to leave it. Thanks for the comments though.

Bye

Paolo





Re: Apache is exiting....

2003-03-03 Thread Paolo Campanella
On Fri, 28 Feb 2003 12:12:48 -0500
Perrin Harkins [EMAIL PROTECTED] wrote:

  Exception 415: UnableToReadFont
  (@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf) at /path/to/script line
  584.[Fri Feb 28 14:31:49 2003] [alert] Child 1216 returned a Fatal
  error... Apache is exiting!
 
 That's bad.  Sounds like an apache bug to me.  Can anyone else confirm 
 if this is intended behavior or not?  You might want to check the httpd 
 lists and newsgroups for info about this.

I haven't been able to find anything relevant in list  newsgroups. But
I'm going to call it quits  just try to make sure at the code level
that nothing similar has a chance to happen. Thanks for all the help.

Bye

Paolo



Re: Apache is exiting....

2003-03-03 Thread Ged Haywood
Hi there,

On Mon, 3 Mar 2003, Paolo Campanella wrote:

 gdb reports that clean_child_exit is not defined - perhaps you are
 looking at newer sources than mine (1.3.22).

Is there a reason why you don't want to upgrade to 1.3.27?

73,
Ged.



Re: Apache is exiting....

2003-02-28 Thread Paolo Campanella
On 27 Feb 2003 11:35:15 -0500
Perrin Harkins [EMAIL PROTECTED] wrote:

 On Thu, 2003-02-27 at 11:06, Paolo Campanella wrote:
  Just one thing though: when the process dies, it
  really does take the main server process down with it:
  
  [Thu Feb 27 17:55:04 2003] [alert] Child 8592 returned a Fatal
  error... Apache is exiting!
 
 Are you certain?  Have you actually checked to see if the main server
 process PID is still running?  If it crashes the parent process, that's
 bad.  (You are running prefork MPM, aren't you?)

I'm sure:
[EMAIL PROTECTED] /root]# ps axf
[...]
 1212 ?S  0:00 httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1215 ?S  0:00  \_ httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1216 ?S  0:00  \_ httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1217 ?S  0:00  \_ httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf

[get killer URL here]

[EMAIL PROTECTED] /root]# ps axf | grep httpd-modperl
 1288 pts/4S  0:00  \_ grep httpd-modperl
 1215 ?S  0:00 httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1217 ?S  0:00 httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1284 ?S  0:00 httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf

[EMAIL PROTECTED] /root]# tail /var/log/httpd-modperl/error_log 
[...]
Exception 415: UnableToReadFont (@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf) at 
/path/to/script line 584.
[Fri Feb 28 14:31:49 2003] [alert] Child 1216 returned a Fatal error... 
Apache is exiting!

No MPM - I'm running Apache 1.3.22. 

Bye

Paolo



Re: Apache is exiting....

2003-02-28 Thread Perrin Harkins
Paolo Campanella wrote:
I'm sure:
[EMAIL PROTECTED] /root]# ps axf
[...]
 1212 ?S  0:00 httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1215 ?S  0:00  \_ httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1216 ?S  0:00  \_ httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1217 ?S  0:00  \_ httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
[get killer URL here]

[EMAIL PROTECTED] /root]# ps axf | grep httpd-modperl
 1288 pts/4S  0:00  \_ grep httpd-modperl
 1215 ?S  0:00 httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1217 ?S  0:00 httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
 1284 ?S  0:00 httpd-modperl -f /etc/httpd/conf/httpd-modperl.conf
[EMAIL PROTECTED] /root]# tail /var/log/httpd-modperl/error_log 
[...]
Exception 415: UnableToReadFont (@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf) at /path/to/script line 584.
[Fri Feb 28 14:31:49 2003] [alert] Child 1216 returned a Fatal error... 
Apache is exiting!
That's bad.  Sounds like an apache bug to me.  Can anyone else confirm 
if this is intended behavior or not?  You might want to check the httpd 
lists and newsgroups for info about this.

- Perrin



Re: Apache is exiting....

2003-02-28 Thread Kyle Oppenheim
  [Fri Feb 28 14:31:49 2003] [alert] Child 1216 returned a Fatal error...
  Apache is exiting!

 That's bad.  Sounds like an apache bug to me.  Can anyone else confirm
 if this is intended behavior or not?  You might want to check the httpd
 lists and newsgroups for info about this.

In http_main.c:process_child_status() there's a bit of code:

if ((WIFEXITED(status)) 
WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, server_conf,
Child %d returned a Fatal error... \n
Apache is exiting!,
pid);
exit(APEXIT_CHILDFATAL);
}

It looks like the parent server will exit if one of its children exits with
APEXIT_CHILDFATAL.  Unfortunately, if you grep for that in the Apache
source, it comes up more than a few times.  A stacktrace would be useful.
Try setting a breakpoint on clean_child_exit() or use a call tracing utility
like Solaris' truss.

Without a stacktrace, you could try to work around the problem.  It looks
like many errors in the accept mutex code will trigger a fatal error -- try
a different mutex (see
http://httpd.apache.org/docs/mod/core.html#acceptmutex).  Also, security
errors such as errors from setuid(), setgid(), or getpwuid() may cause a
fatal error.  Finally, certain values of errno after the accept() call in
child_main() will cause a fatal error (like ENETDOWN).

--
Kyle Oppenheim
Tellme Networks, Inc.
http://www.tellme.com



Apache is exiting....

2003-02-27 Thread Paolo Campanella

Hi all

Here's a stripped-down version of a script I use:
===
use Image::Magick;
my $image=Image::Magick-new(size='75x75');
$image-Read('null:white');
my @x = 
$image-QueryFontMetrics(font='@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf',text='X', 
pointsize=12);
===

If the font can't be found, I get this in my error log:
===
Exception 415: UnableToReadFont (@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf) at 
/path/to/script line 584.
[Thu Feb 27 15:17:07 2003] [alert] Child 8329 returned a Fatal error... 
Apache is exiting!
===

Even using an Error.pm try/catch block makes no difference. Pretend
for a moment that you have no specific knowledge of the library which
causes this problem: is there any black box approach to stopping some
library's complaints from shutting down my web server?

Thanks

Paolo



Re: Apache is exiting....

2003-02-27 Thread Nigel Hamilton
HI Paolo,

Can you use an eval {}; block?

Or maybe solve the bug. Is the @ symbol meant to appear in the 
font path?

NIge


 
 Hi all
 
 Here's a stripped-down version of a script I use:
 ===
 use Image::Magick;
 my $image=Image::Magick-new(size='75x75');
 $image-Read('null:white');
 my @x = 
 $image-QueryFontMetrics(font='@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf',text='X',
  pointsize=12);
 ===
 
 If the font can't be found, I get this in my error log:
 ===
 Exception 415: UnableToReadFont (@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf) at 
 /path/to/script line 584.
 [Thu Feb 27 15:17:07 2003] [alert] Child 8329 returned a Fatal error... 
 Apache is exiting!
 ===
 
 Even using an Error.pm try/catch block makes no difference. Pretend
 for a moment that you have no specific knowledge of the library which
 causes this problem: is there any black box approach to stopping some
 library's complaints from shutting down my web server?
 
 Thanks
 
 Paolo
 

-- 
Nigel Hamilton
Turbo10 Metasearch Engine

email:  [EMAIL PROTECTED]
tel:+44 (0) 207 987 5460
fax:+44 (0) 207 987 5468

http://turbo10.com  Search Deeper. Browse Faster.



RE: Apache is exiting....

2003-02-27 Thread Chris Faust
Hey Paolo,

Did you try to add some die statements to see if it made any difference, so
something like:

use Image::Magick;
my $image=Image::Magick-new(size='75x75');
$image-Read('null:white');
die display_error(Read Error Error: Image: null:white $image \n) if
($image);
my @x = $image-QueryFontMetrics
font='@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf',text='X', pointsize=12);
die display_error(ImFont Query Error: @x $image) if ($image);

Works for me, then I just have a sub called display_error that prints the
message and error out in a browser, but you could make that anything you
want.

-Chris

 -Original Message-
 From: Paolo Campanella [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 27, 2003 8:43 AM
 To: [EMAIL PROTECTED]
 Subject: Apache is exiting



 Hi all

 Here's a stripped-down version of a script I use:
 ===
 use Image::Magick;
 my $image=Image::Magick-new(size='75x75');
 $image-Read('null:white');
 my @x =
 $image-QueryFontMetrics(font='@/usr/X11R6/lib/X11/fonts/ttf/Rit
 alin.ttf',text='X', pointsize=12);
 ===

 If the font can't be found, I get this in my error log:
 ===
 Exception 415: UnableToReadFont
 (@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf) at /path/to/script line 584.
 [Thu Feb 27 15:17:07 2003] [alert] Child 8329 returned a Fatal error...
 Apache is exiting!
 ===

 Even using an Error.pm try/catch block makes no difference. Pretend
 for a moment that you have no specific knowledge of the library which
 causes this problem: is there any black box approach to stopping some
 library's complaints from shutting down my web server?

 Thanks

 Paolo




Re: Apache is exiting....

2003-02-27 Thread Paolo Campanella

Hi Nigel

On Thu, 27 Feb 2003 14:16:45 + (GMT)
Nigel Hamilton [EMAIL PROTECTED] wrote:

 HI Paolo,
 
   Can you use an eval {}; block?

No, doesn't work. This is also (AFAIK) how Error.pm works.

   Or maybe solve the bug. Is the @ symbol meant to appear in the 
 font path?

Solving the bug is not the problem - I can simply check that the
font exists first. My problem is that I hate having something running
which could kill my web server at any time, perhaps if it is passed
some other argument which it does not like - I can't anticipate
every possible way that it could die, which is why I want a black
box solution to running it safely.

Bye

Paolo



Re: Apache is exiting....

2003-02-27 Thread Paolo Campanella

Hi Chris

On Thu, 27 Feb 2003 09:33:07 -0500
Chris Faust [EMAIL PROTECTED] wrote:

 Hey Paolo,
 
 Did you try to add some die statements to see if it made any difference,
 so something like:
 
 use Image::Magick;
 my $image=Image::Magick-new(size='75x75');
 $image-Read('null:white');
   die display_error(Read Error Error: Image: null:white $image
   \n) if
 ($image);
 my @x = $image-QueryFontMetrics
 font='@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf',text='X',
 pointsize=12);
   die display_error(ImFont Query Error: @x $image) if ($image);
 
 Works for me, then I just have a sub called display_error that prints
 the message and error out in a browser, but you could make that anything
 you want.

In this example, it would croak (let's not call it die, because it
doesn't) on the $image-QueryFontMetrics() call, before it reaches
the die statement. Yes, I have made sure exactly where it dies. I don't
think one can do much better than this:

===
use Image::Magick;
use Error qw (:try);

my $image=Image::Magick-new(size='75x75');
$image-Read('null:white');

try {
my @x = 
$image-QueryFontMetrics(font='@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf',text='X', 
pointsize=12);
die Got past QueryFontMetrics();
}
catch Error with {
warn trapped an exception;
};
warn Completed;
===

This gives the same output as the original post:
Exception 415: UnableToReadFont (@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf) at 
./xxx line 12.

Thanks

Paolo



Re: Apache is exiting....

2003-02-27 Thread Perrin Harkins
On Thu, 2003-02-27 at 08:42, Paolo Campanella wrote:
 Pretend
 for a moment that you have no specific knowledge of the library which
 causes this problem: is there any black box approach to stopping some
 library's complaints from shutting down my web server?

No.  The library is executing C code in the web server process.  There
is nothing stopping it from simply saying exit(), or even segfaulting
and killing that process.  Note that it's just one process though, not
the whole server.  Not a big deal.

You can sort of work around this by using a reverse proxy to separate
your mod_perl server from your front-end web server.  This gives you a
scenario similar to CGI, and it's what FastCGI does, and Microsoft and
other commercial vendors make a big fuss about doing this.  However, the
only advantage to it is that you can return a prettier error message to
the user.  It won't prevent anyone from exiting a process.

- Perrin



Re: Apache is exiting....

2003-02-27 Thread Paolo Campanella
On 27 Feb 2003 10:33:21 -0500
Perrin Harkins [EMAIL PROTECTED] wrote:

 On Thu, 2003-02-27 at 08:42, Paolo Campanella wrote:
  Pretend
  for a moment that you have no specific knowledge of the library which
  causes this problem: is there any black box approach to stopping some
  library's complaints from shutting down my web server?
 
 No.  The library is executing C code in the web server process.  There
 is nothing stopping it from simply saying exit(), or even segfaulting
 and killing that process.  Note that it's just one process though, not
 the whole server.  Not a big deal.

Thanks - that makes sense. I'll just live with making sure that it
doesn't happen. Just one thing though: when the process dies, it
really does take the main server process down with it:

[Thu Feb 27 17:55:04 2003] [alert] Child 8592 returned a Fatal error... 
Apache is exiting!

The remaining child processes then hang around, useful until they
receive a similar, deadly request.

I'd be interested to know why the main Apache process shuts down.

Thanks





Re: Apache is exiting....

2003-02-27 Thread Perrin Harkins
On Thu, 2003-02-27 at 11:06, Paolo Campanella wrote:
 Just one thing though: when the process dies, it
 really does take the main server process down with it:
 
 [Thu Feb 27 17:55:04 2003] [alert] Child 8592 returned a Fatal error... 
 Apache is exiting!

Are you certain?  Have you actually checked to see if the main server
process PID is still running?  If it crashes the parent process, that's
bad.  (You are running prefork MPM, aren't you?)

- Perrin