httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41362] New: - mod_disk_cache and mod_include conflict generating incorrect pages from cache
Date Sun, 14 Jan 2007 22:55:51 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41362>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41362

           Summary: mod_disk_cache and mod_include conflict generating
                    incorrect pages from cache
           Product: Apache httpd-2
           Version: 2.2.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: mod_disk_cache
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: dev-apache.org@humph.com


Tested in FreeBSD 6.1 and MacOSX 10.4.x.
Simple to reproduce (note added a test at the bottom using r470455):

create a SSI file in your DocumentRoot:

$ cat > DocumentRoot/test.shtml<<EOF
<html>
<head>
        <title>cache-bug-test</title>
</head>
<body>
<p>just before the exec call</p>
<!--#exec cmd="./foo.sh" -->
<p>just after the exec call</p>

</body>
</html>
EOF

and the commad to execute:

$ cat > DocumentRoot/foo.sh <<EOF    
#!/bin/sh
echo bar
EOF

to be chmod 755

in the VirtualHost configuration:

    CacheEnable disk /
    CacheRoot /var/www/cache
    CacheIgnoreNoLastMod On
    CacheDefaultExpire 3600
    CacheMaxExpire 3600
    CacheMinFileSize 64
    CacheMaxFileSize 64000

the first time the file is accessed it is server correctly to the client (indented for clarity):

	<html>
	<head>
		<title>cache-bug-test</title>
	</head>
	<body>
	<p>just before the exec call</p>
	bar
	
	<p>just after the exec call</p>
	
	</body>
	</html>


the second time it is served as:

	<html>
	<head>
		<title>cache-bug-test</title>
	</head>
	<body>
	<p>just before the exec call</p>
	<html>
	<head>
		<title>cache-bug-test</title>
	</head>
	<body>
	<p>just before the exec call</p>
	bar
	
	<p>just after the exec call</p>
	
	</body>
	</html>

that is: the correct output is preceded by the raw file up to and including the SSI instruction.

I inserted some ap_log_*error calls in mod_disk_cache.c, one in particular in store_body:


        rv = apr_bucket_read(e, &str, &length, APR_BLOCK_READ);
		//GG 3 lines
		ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
					 "cache_disk: read from server [%s]",
					 str);

perhaps not really a proper description. Anyway, I get:

[Sun Jan 14 22:27:21 2007] [debug] mod_disk_cache.c(999): cache_disk: read from server [<html>\r
\n<head>\r\n\t<title>cache-bug-test</title>\r\n</head>\r\n<body>\r\n<p>just
before the exec 
call</p>\r\n<!--#exec cmd="./foo.sh" -->\r\n<p>just after the exec call</p>\r\n\r\n</body>\r
\n</html>\r\n]
[Sun Jan 14 22:27:21 2007] [debug] mod_disk_cache.c(999): cache_disk: read from server [bar\n]
[Sun Jan 14 22:27:21 2007] [debug] mod_disk_cache.c(999): cache_disk: read from server []
[Sun Jan 14 22:27:21 2007] [debug] mod_disk_cache.c(999): cache_disk: read from server [\r\n<p>just

after the exec call</p>\r\n\r\n</body>\r\n</html>\r\n]
[Sun Jan 14 22:27:21 2007] [debug] mod_disk_cache.c(999): cache_disk: read from server [(null)]

so, first it reads the whole file unparsed by mod_include (that's bad enough), then it gets
the result 
from the parsing down to the end of the file. This is odd, and what puzzles me more: it is
not even 
what it going to be served from cache, as you saw above.


I tested then with r470455 of mod_cache (grafted in a 2.2.4 distribution) and found that the
output is 
fine but the content is stored each time a client requests it (and the serving crawls..)

Might be related to related to: http://issues.apache.org/bugzilla/show_bug.cgi?id=41200

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message