httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <>
Subject Re: core dump in ap_send_fd
Date Fri, 21 Dec 2001 18:56:46 GMT
On Sat, 22 Dec 2001, Stas Bekman wrote:

> I think the misunderstanding started from the moment Cliff forwarded my
> email, but snipped the end of it. At at the end it had:
> [Fri Dec 21 02:03:29 2001] file core.c, line 2271, assertion
> "total_bytes_left > 0 && tmplen > 0" failed
> [Fri Dec 21 02:03:30 2001] [error] server reached MaxClients setting,
> consider raising the MaxClients setting
> [Fri Dec 21 02:03:30 2001] [notice] child pid 2607 exit signal Aborted
> (6), possible coredump in /home/stas/
> I was just asking why if the code *does* the check and asserts

You must be in maintainer mode if it actually did the check.

> (see the log before the stack trace), it also dumps core?

Because that's what assert does.  :)  It exits with an Aborted signal,
which triggers a coredump for debugging purposes.  (coredump != SEGV)

> My goal is somehow to get back the ability to take an OS specific fh
> generated outside APR, convert it into apr_file_t and be able to use
> send_fd optionally without specifying the length, as it was possible in
> 1.3.x.

Is it the case that you know whether the thing is a file or a pipe?  If
so, just use the correct kind of bucket directly.  If you know the thing
is a file and you just don't know the length, do the fseek/ftell yourself.
The thing will be _way_ faster.  If you give the buckets code a file
descriptor and don't know the length, (assuming that were possible, which
it currently isn't, unless you were to put the file into a pipe bucket),
it would have to read the file 8KB at a time, rather than being able to
MMAP it or sendfile() the fd.  That's a massive amount of overhead that
you probably want to avoid like the plague (I've benchmarked it... it's
awful, even for files < 8KB).

Just stop using ap_send_fd().  Use the buckets code directly.  For one
thing, you can save yourself some extra brigade-creation overhead, and you
can probably save yourself a few calls down the filter stack as well.
(And yes, the code I gave you the other day will work for files as well.
While you could in theory put a file into a pipe bucket, I wouldn't
recommend it.)


   Cliff Woolley
   Charlottesville, VA

View raw message