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): httpd-2.0.40-21.5.i386.rpm 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 </Loacation> 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?
Created attachment 95502 [details] sample code
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.
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.
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.
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 14-1.4p6-5.1 1.6.3-5 autoconf 2.57-3 Please let me know the difference between above and the environment that the problem not happened.
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.