Bug 107982 - handler's behavior is strange when handler returns error
handler's behavior is strange when handler returns error
Product: Red Hat Linux
Classification: Retired
Component: httpd (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2003-10-25 11:22 EDT by maya
Modified: 2007-04-18 12:58 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-11-17 00:01:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
sample code (2.15 KB, text/plain)
2003-10-26 22:53 EST, maya
no flags Details
Patch for re-creation (944 bytes, patch)
2003-11-13 03:22 EST, maya
no flags Details | Diff

  None (edit)
Description maya 2003-10-25 11:22:09 EDT
Description of problem:
Return error in a handler, but go to next hander instead of go to logging phase.

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. Install httpd-2.0.40-21.5.i386.rpm and httpd-devel-2.0.40-21.5.i386.rpm
from ftp://updates.redhat.com/9/en/os/i386/.
2. Generate a module by `apxs -g -n overrun' command, and write
mod_overrun.c. Please see link of URL section.
3. Install this module and add follwings to httpd.conf:
  LoadModule overrun_module modules/mod_overrun.so
  <Location /somewhere>
    SetHander overrun
4. Access to `http://hostname/somewhere/.'

Actual results:
The `OK' message and the `NG' message appears in the error log
which wirtten by overrun_access_checker.

Expected results:
The `NG' message is not appears in the error log.
Only the `OK' message is appears.

Additional info:
I compiled httpd-2.0.47 manually `./configure; make; make install' and
tryed same module, but above problem was not appeared.
/usr/sbin/httpd in httpd-2.0.40-21.5.i386.rpm is borken?
Comment 1 maya 2003-10-26 22:53:39 EST
Created attachment 95502 [details]
sample code
Comment 2 maya 2003-10-27 00:09:59 EST
I moved to sample code sample code to `Attachment' and updated it.
I'm sorry to I didn't attach and comment at same time.

I set some value to request_rec->notes in the first handler and return error,
control is moved to next handler (this is bug) and if code accesses to
request_rec->notes then value will lost.
If code accesses to the value without check for NULL (it is negligence but)
then Segmentation fault will occurs.
Comment 3 maya 2003-11-13 03:22:11 EST
Created attachment 95939 [details]
Patch for re-creation

I checked the source code of httpd-2.0.40 and found
the place of problem in server/request.c.

I think that the httpd have to return from `ap_process_request_internal'
when `ap_run_translate_name' returns 404(it is a return code from module)
in `ap_process_request_internal'.
But httpd goes through next steatment for unknown reason.
I could not trace the Apache source code moreover.

Please try attached patch(it is not for solving the problem.
it is for re-creation.) and previous attached module at once.
Comment 4 Joe Orton 2003-11-13 05:57:55 EST
I can't reproduce a problem here.  The translate_name hook is run,
writes the log entry, and returns HTTP_NOT_FOUND, and that is what is
sent to the client.

The access_check hook is never run, as expected.
Comment 5 maya 2003-11-15 09:22:36 EST
I tryed to update glibc and kernel, but problem was not solved.

Then I installed Red Hat 9 other machine and try the
first module, but the problem appeared again.
My environment is:
OS       Red Hat 9
httpd    2.0.40-21.5
kernel   2.4.20-20.9
glibc    2.3.2-27.9.7
gcc      3.2.2-5
libtool  1.4.3-5
make     3.79.1-17
automake 15-1.5-6
autoconf 2.57-3

Please let me know the difference between above and
the environment that the problem not happened.
Comment 6 maya 2003-11-17 00:00:36 EST
The reason of this problem is a setting in httpd.conf.
Error document is set in httpd.conf from httpd-2.0.40-21.5.rpm.
When a handler returns a HTTP error then httpd request to the error 
document file again. This second request cause this problem.

I skipped this problem by follwoing procedure:
-     ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
+ #   ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var

Sorry. It's not rpm's problem.

Note You need to log in before you can comment on or make changes to this bug.