Re: [PATCH] aborting on OOM

2006-05-11 Thread Colm MacCarthaigh
On Thu, May 11, 2006 at 04:01:50PM +0100, Joe Orton wrote: > +#if APR_HAVE_UNISTD_H > +#include > +#endif > + We might need io.h on win32, but we can easily figure that out :) > +#define OOM_MESSAGE "[crit] Memory allocation failed, aborting process.\n" APR_EOL_STR instead of \n, but apart from

Re: [PATCH] aborting on OOM

2006-05-11 Thread Joe Orton
On Wed, May 10, 2006 at 07:11:42PM +0100, Colm MacCarthaigh wrote: > On Wed, May 10, 2006 at 10:53:50AM -0700, Garrett Rooney wrote: > > I would personally prefer abort to exit... > > is write()'ing a static error message an option too? I don't know if more effort than this is required to make wr

Re: [PATCH] aborting on OOM

2006-05-10 Thread William A. Rowe, Jr.
Colm MacCarthaigh wrote: On Wed, May 10, 2006 at 11:22:25AM -0700, Garrett Rooney wrote: Which is likely to be redirected to /dev/null in most cases... We redirect standard error to the main error log :) See ap_open_logs in server/log.c :-) httpd -E also causes stderr redirection for the st

Re: [PATCH] aborting on OOM

2006-05-10 Thread William A. Rowe, Jr.
Colm MacCarthaigh wrote: On Wed, May 10, 2006 at 11:11:27AM -0700, Garrett Rooney wrote: On 5/10/06, Colm MacCarthaigh <[EMAIL PROTECTED]> wrote: On Wed, May 10, 2006 at 10:53:50AM -0700, Garrett Rooney wrote: I would personally prefer abort to exit... is write()'ing a static error messag

Re: [PATCH] aborting on OOM

2006-05-10 Thread Garrett Rooney
On 5/10/06, Colm MacCarthaigh <[EMAIL PROTECTED]> wrote: On Wed, May 10, 2006 at 11:22:25AM -0700, Garrett Rooney wrote: > Which is likely to be redirected to /dev/null in most cases... We redirect standard error to the main error log :) See ap_open_logs in server/log.c :-) httpd -E also cause

Re: [PATCH] aborting on OOM

2006-05-10 Thread Colm MacCarthaigh
On Wed, May 10, 2006 at 11:22:25AM -0700, Garrett Rooney wrote: > Which is likely to be redirected to /dev/null in most cases... We redirect standard error to the main error log :) See ap_open_logs in server/log.c :-) httpd -E also causes stderr redirection for the start-up phase, /dev/null is t

Re: [PATCH] aborting on OOM

2006-05-10 Thread Jim Jagielski
Garrett Rooney wrote: > > On 5/10/06, Colm MacCarthaigh <[EMAIL PROTECTED]> wrote: > > On Wed, May 10, 2006 at 11:11:27AM -0700, Garrett Rooney wrote: > > > On 5/10/06, Colm MacCarthaigh <[EMAIL PROTECTED]> wrote: > > > >On Wed, May 10, 2006 at 10:53:50AM -0700, Garrett Rooney wrote: > > > >> I wo

Re: [PATCH] aborting on OOM

2006-05-10 Thread Jim Jagielski
Colm MacCarthaigh wrote: > > On Wed, May 10, 2006 at 11:11:27AM -0700, Garrett Rooney wrote: > > On 5/10/06, Colm MacCarthaigh <[EMAIL PROTECTED]> wrote: > > >On Wed, May 10, 2006 at 10:53:50AM -0700, Garrett Rooney wrote: > > >> I would personally prefer abort to exit... > > > > > >is write()'ing

Re: [PATCH] aborting on OOM

2006-05-10 Thread Garrett Rooney
On 5/10/06, Colm MacCarthaigh <[EMAIL PROTECTED]> wrote: On Wed, May 10, 2006 at 11:11:27AM -0700, Garrett Rooney wrote: > On 5/10/06, Colm MacCarthaigh <[EMAIL PROTECTED]> wrote: > >On Wed, May 10, 2006 at 10:53:50AM -0700, Garrett Rooney wrote: > >> I would personally prefer abort to exit... >

Re: [PATCH] aborting on OOM

2006-05-10 Thread Colm MacCarthaigh
On Wed, May 10, 2006 at 11:11:27AM -0700, Garrett Rooney wrote: > On 5/10/06, Colm MacCarthaigh <[EMAIL PROTECTED]> wrote: > >On Wed, May 10, 2006 at 10:53:50AM -0700, Garrett Rooney wrote: > >> I would personally prefer abort to exit... > > > >is write()'ing a static error message an option too? >

Re: [PATCH] aborting on OOM

2006-05-10 Thread Garrett Rooney
On 5/10/06, Colm MacCarthaigh <[EMAIL PROTECTED]> wrote: On Wed, May 10, 2006 at 10:53:50AM -0700, Garrett Rooney wrote: > I would personally prefer abort to exit... is write()'ing a static error message an option too? Perhaps, but where would you write() to? -garrett

Re: [PATCH] aborting on OOM

2006-05-10 Thread Colm MacCarthaigh
On Wed, May 10, 2006 at 10:53:50AM -0700, Garrett Rooney wrote: > I would personally prefer abort to exit... is write()'ing a static error message an option too? -- Colm MacCárthaighPublic Key: [EMAIL PROTECTED]

Re: [PATCH] aborting on OOM

2006-05-10 Thread Garrett Rooney
On 5/10/06, Joe Orton <[EMAIL PROTECTED]> wrote: There a few choices for what to do in the oom handler: 1.3 fprintf's to stderr, then does exit(1), which doesn't seem particularly wise since fprintf can itself malloc; could do similarly, could just exit(1) or even just exit(APEXIT_CHILDSICK); but

[PATCH] aborting on OOM

2006-05-10 Thread Joe Orton
There a few choices for what to do in the oom handler: 1.3 fprintf's to stderr, then does exit(1), which doesn't seem particularly wise since fprintf can itself malloc; could do similarly, could just exit(1) or even just exit(APEXIT_CHILDSICK); but then nothing gets logged. With abort() at lea