httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <>
Subject Re: mod_file_cache broken on Windows
Date Sat, 30 Jun 2001 20:08:01 GMT
Your patch calls apr_bucket_file_create with the cached file in the pconf pool.  If I do the
apr_os_file_get()/apr_os_file_put() trick to put the fd into an apr_file_t allocated out of
request pool before calling apr_bucket_file_create(), everything works (with HTTP/1.0 non-keep
request).  It is still broken for keep alive requests of course, which I know is the problem
you are
trying to fix...

The seg fault only happens when I am sending in multiple concurrent requests.  ab -n 100 -c
server/cached_file.html  works. ab -n 100 -c >1 server/cached_file.html seg faults everytime.
are HTTP/1.0 non-keepalive requests and no additional content filters are being installed,
so we
should never attempt to read from the file (ie, we should always use sendfile).  So the problem
related to one of the following:

1. that the file passed in on apr_bucket_file_is allocated out of the pconf pool...
If I had time, I would trace how the pconf pool in the apr_file_t is being used on the sendfile
path, especially during request cleanup.

2. fields set in the cached apr_file_t that are not set in the new apr_file_t created by the
apr_os_file_blah() trick file.
Since we are (should be :-) on the sendfile path, I wouldn't expect to get into the XTHREAD
code in
APR, but it could be that we are because of some of the settings in the cached apr_file_t.


> On Fri, 29 Jun 2001, Cliff Woolley wrote:
> > Bummer.  Especially because that's the exact sort of thing I did when
> > testing it myself on Unix, and I didn't get any segfaults.  To help narrow
> > in on the problem, please try changing APR_HAS_XTHREAD_FILES to 0 in
> > apr.hw and try your test again.  That will help us figure out where the
> > problem is.
> So I'm pushing on the code... I have found some behaviour I can't explain
> yet, but I still haven't gotten it to segfault, so I'm guessing we're
> talking about two different problems.  What I'm seeing at the moment is
> that if I request the very *first* file on my list of cached files, it
> happens to have file descriptor #2.  When I request it and it gets served
> with sendfile(), I end up getting the beginning of my error log served as
> the request!  It seems to be the right number of bytes, just the wrong
> file.  That sucks.  I'll try to figure this out... in the meanwhile, I'm
> still curious to hear what you see when you switch to
> Thanks,
> Cliff
> --------------------------------------------------------------
>    Cliff Woolley
>    Charlottesville, VA

View raw message