You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/07/30 19:23:24 UTC

DO NOT REPLY [Bug 45507] New: once in a while, apache forgets to send headers for a binary file.

https://issues.apache.org/bugzilla/show_bug.cgi?id=45507

           Summary: once in a while, apache forgets to send headers for a
                    binary file.
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: PC
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: rahul@sun.com


On a stock build of apache, No modules loaded,
request for a pdf file multiple times, once in a while
the response does not contain response headers.

Note that the same behavior is visible on Apache/2.2.8 also (did not check
2.2.9)

Here is what I did,
|uname -a
SunOS agneyam 5.11 snv_84 sun4u sparc SUNW,Sun-Blade-1000
|file htdocs/test.pdf
htdocs/test.pdf:    Adobe Portable Document Format (PDF)  v1.2
|(echo "GET /test.pdf HTTP/1.0\n\n";sleep5)|telnet 0 8080 > o
|cat o
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
GET /test.pdf HTTP/1.0

ÛßÞ~}>^#õ¥æcuVêã

*Note the absence of headers*.
This happens only once in 10 times.

Other times, it gives me back the correct response.

|(echo "GET /test.pdf HTTP/1.0\n\n";sleep 5) | telnet 0 8080

Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
HTTP/1.1 200 OK
Date: Wed, 30 Jul 2008 17:08:57 GMT
Server: Apache/2.3.0-dev (Unix)
Last-Modified: Wed, 30 Jul 2008 17:01:10 GMT
ETag: "616bb-139-45340b40cdf90"
Accept-Ranges: bytes
Content-Length: 313
Connection: close
Content-Type: application/pdf

ÛßÞ~}>^#õ¥æcuVêã
                ïD~
&¤<½®ö¹@jË(ßoÜ©h×SZ;ðÊ2ë=_?[ÉÌ
Connection to 0 closed by foreign host.


|bin/httpd -V
Server version: Apache/2.3.0-dev (Unix)
Server built:   Jul 30 2008 21:26:59
Server's Module Magic Number: 20080722:0
Server loaded:  APR 1.4.0-dev, APR-UTIL 1.4.0-dev
Compiled using: APR 1.4.0-dev, APR-UTIL 1.4.0-dev
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FCNTL_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/space/store/apache.30.Jul/install"
 -D SUEXEC_BIN="/space/store/apache.30.Jul/install/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
|cat logs/error_log
[Wed Jul 30 22:26:46 2008] [notice] Apache/2.3.0-dev (Unix) configured --
resuming normal operations
[Wed Jul 30 22:26:46 2008] [info] Server built: Jul 30 2008 21:26:59
[Wed Jul 30 22:26:46 2008] [debug] prefork.c(960): AcceptMutex: fcntl (default:
fcntl)

Also stock httpd.conf with only these changes from what the make install
provided.

|diff -u conf/httpd.conf.orig conf/httpd.conf
--- conf/httpd.conf.orig        Wed Jul 30 22:35:07 2008
+++ conf/httpd.conf     Wed Jul 30 22:30:46 2008
@@ -37,7 +37,7 @@
 # prevent Apache from glomming onto all bound IP addresses.
 #
 #Listen 12.34.56.78:80
-Listen 80
+Listen 8080

 #
 # Dynamic Shared Object (DSO) Support
@@ -94,7 +94,7 @@
 #
 # If your host doesn't have a registered DNS name, enter its IP address here.
 #
-#ServerName www.example.com:80
+ServerName agneyam

 #
 # DocumentRoot: The directory out of which you will serve your

The same does not happen at all when using a text file instead.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45507] once in a while, apache forgets to send headers for a binary file.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45507


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEEDINFO




--- Comment #4 from Ruediger Pluem <rp...@apache.org>  2008-07-30 13:31:33 PST ---
(In reply to comment #1)
> truss :
> |truss -p 20322
> accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT) (sleeping...)
> accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT)  = 12
> getsockname(12, 0x001ADEF0, 0x001ADEDC, SOV_DEFAULT) = 0
> fcntl(12, F_GETFL)                              = 2
> fcntl(12, F_SETFL, FWRITE|FNONBLOCK)            = 0
> read(12, 0x001B1E70, 8000)                      Err#11 EAGAIN
> pollsys(0xFFBFE104, 1, 0xFFBFE080, 0x00000000)  = 1
> read(12, " G E T   / t e s t . p d".., 8000)    = 28
> stat64("/space/store/apache.30.Jul/install/htdocs/test.pdf", 0xFFBFE138) = 0
> getpid()                                        = 20322 [20321]
> open("/space/store/apache.30.Jul/install/htdocs/test.pdf",
> O_RDONLY|O_LARGEFILE) = 13
> setsockopt(12, tcp, TCP_CORK, 0xFFBFE294, 4, SOV_DEFAULT) = 0
> writev(12, 0xFFBFE2BC, 1)                       = 261

This is exactly the size of the headers. So writev says that it wrote the
headers to the network. I suspect an OS problem somewhere between TCP_CORK,
writev and sendfilev64. Can you please test this on older Solaris versions
(8, 9, 10) if available and see if this is reproducible there? 

> sendfilev64(1, 12, 0x001AE7D0, 1, 0xFFBFE1A0)   = 313


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

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


DO NOT REPLY [Bug 45507] once in a while, apache forgets to send headers for a binary file.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45507


rahul <ra...@sun.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |ASSIGNED
           Platform|PC                          |Sun




--- Comment #3 from rahul <ra...@sun.com>  2008-07-30 12:44:42 PST ---
Yes, it is the case when no headers are sent,

Solaris 11 sparc
|uname -a
SunOS agneyam 5.11 snv_84 sun4u sparc SUNW,Sun-Blade-1000


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

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


DO NOT REPLY [Bug 45507] once in a while, apache forgets to send headers for a binary file.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45507


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #2 from Ruediger Pluem <rp...@apache.org>  2008-07-30 12:31:00 PST ---
(In reply to comment #1)

Is this a truss of a case where no headers are sent?

> truss :
> |truss -p 20322
> accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT) (sleeping...)
> accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT)  = 12
> getsockname(12, 0x001ADEF0, 0x001ADEDC, SOV_DEFAULT) = 0
> fcntl(12, F_GETFL)                              = 2
> fcntl(12, F_SETFL, FWRITE|FNONBLOCK)            = 0
> read(12, 0x001B1E70, 8000)                      Err#11 EAGAIN
> pollsys(0xFFBFE104, 1, 0xFFBFE080, 0x00000000)  = 1
> read(12, " G E T   / t e s t . p d".., 8000)    = 28
> stat64("/space/store/apache.30.Jul/install/htdocs/test.pdf", 0xFFBFE138) = 0
> getpid()                                        = 20322 [20321]
> open("/space/store/apache.30.Jul/install/htdocs/test.pdf",
> O_RDONLY|O_LARGEFILE) = 13
> setsockopt(12, tcp, TCP_CORK, 0xFFBFE294, 4, SOV_DEFAULT) = 0
> writev(12, 0xFFBFE2BC, 1)                       = 261
> sendfilev64(1, 12, 0x001AE7D0, 1, 0xFFBFE1A0)   = 313
> write(9, " 1 2 7 . 0 . 0 . 1   -  ".., 76)      = 76
> shutdown(12, SHUT_WR, SOV_DEFAULT)              = 0
> pollsys(0xFFBFE3B4, 1, 0xFFBFE330, 0x00000000)  = 1
> read(12, 0xFFBFE4A8, 512)                       = 0
> close(12)                                       = 0
> read(7, 0xFFBFE6A3, 1)                          Err#11 EAGAIN
> close(13)                                       = 0
> accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT) (sleeping...)
> 

>From a first glance looks good to me. Maybe some issue with writev and
sendfilev64 not working well together or could this be caused by a bug with
TCP_CORK? What version of Solaris are you using? So far I know TCP_CORK only on
the Linux platform.


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

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


DO NOT REPLY [Bug 45507] once in a while, apache forgets to send headers for a binary file.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45507


rahul <ra...@sun.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |INVALID




--- Comment #7 from rahul <ra...@sun.com>  2008-07-31 06:32:16 PST ---
Really sorry for the spurious alert, It is not a bug with apache,

The binary test file that I was using contained two 
chars 0xff 0xf2, this is an escape char for telnet. which cut off
all data before that point.

Thus though it received all headers, it did not print them when it received
0xff 0xf2


http://lists.freebsd.org/pipermail/freebsd-bugs/2003-May/000725.html


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

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


DO NOT REPLY [Bug 45507] once in a while, apache forgets to send headers for a binary file.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45507





--- Comment #5 from rahul <ra...@sun.com>  2008-07-30 13:32:07 PST ---
Created an attachment (id=22333)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22333)
a binary file that reproduces the bug

The bug seems to be connected with the size of the file
in that it is reproducible in Solaris 11 (i86 & sparc) And Linux (ubuntu)
with a small size file but not with a large one.

|du  htdocs/test.pdf                                                            
2 htdocs/test.pdf


|uname -a
Linux vaishnavam 2.6.24-19-generic #1 SMP Wed Jun 18 14:43:41 UTC 2008 i686
GNU/Linux
|./bin/httpd -V
Server version: Apache/2.3.0-dev (Unix)
Server built:   Jul 22 2008 15:05:28
Server's Module Magic Number: 20080528:1
Server loaded:  APR 1.4.0-dev, APR-UTIL 1.4.0-dev
Compiled using: APR 1.4.0-dev, APR-UTIL 1.4.0-dev
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/space/store/apache.22.Jul/install"
 -D SUEXEC_BIN="/space/store/apache.22.Jul/install/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"
|(echo "GET /test.pdf HTTP/1.0\n\n";sleep 5)|telnet 0 8080
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
��}>^#����uV�
            
��~�&�<�����jˇ(ߕoܩ�h�Z;�2�_�?[ɇ��
Connection closed by foreign host.

A little more info:
================================================================
I commented these out in apr, cleaned,rebuilt and ran again,

./include/arch/unix/apr_private.h:/* Define if TCP_CORK is defined in
netinet/tcp.h */
./include/arch/unix/apr_private.h:/*#define HAVE_TCP_CORK 1*/
./include/arch/unix/apr_private.h:/* Define if TCP_NODELAY and TCP_CORK can be
enabled at the same time */
./include/apr.h:/*#define APR_TCP_NOPUSH_FLAG       TCP_CORK*/

it is reproducible again.

|truss -p 16007
accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT) (sleeping...)
accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT)  = 12
getsockname(12, 0x001ADEF0, 0x001ADEDC, SOV_DEFAULT) = 0
fcntl(12, F_GETFL)                              = 2
fcntl(12, F_SETFL, FWRITE|FNONBLOCK)            = 0
read(12, 0x001B1E70, 8000)                      Err#11 EAGAIN
pollsys(0xFFBFE104, 1, 0xFFBFE080, 0x00000000)  = 1
read(12, " G E T   / t e s t . p d".., 8000)    = 28
stat64("/space/store/apache.30.Jul/install/htdocs/test.pdf", 0xFFBFE138) = 0
getpid()                                        = 16007 [16006]
open("/space/store/apache.30.Jul/install/htdocs/test.pdf",
O_RDONLY|O_LARGEFILE) = 13
writev(12, 0xFFBFE2BC, 1)                       = 261
sendfilev64(1, 12, 0x001AE7D0, 1, 0xFFBFE1A0)   = 313
write(9, " 1 2 7 . 0 . 0 . 1   -  ".., 76)      = 76
shutdown(12, SHUT_WR, SOV_DEFAULT)              = 0
pollsys(0xFFBFE3B4, 1, 0xFFBFE330, 0x00000000)  = 1
read(12, 0xFFBFE4A8, 512)                       = 0
close(12)                                       = 0
read(7, 0xFFBFE6A3, 1)                          Err#11 EAGAIN
close(13)                                       = 0
accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT) (sleeping...)

(I am uploading a small test.pdf which reproduces this,
The pdf is not a valid pdf (truncated to small length
it to make it reproduce the bug)
)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45507] once in a while, apache forgets to send headers for a binary file.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45507





--- Comment #6 from Ruediger Pluem <rp...@apache.org>  2008-07-30 14:16:34 PST ---
Please try to connect via an ethernet and try if a pdf file with size 1199
fails and if a pdf file with 1200 bytes or larger succeeds. If this is not the
case please check if the behaviour flips over between 1459 and 1460 bytes file
size.


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

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


DO NOT REPLY [Bug 45507] once in a while, apache forgets to send headers for a binary file.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45507





--- Comment #1 from rahul <ra...@sun.com>  2008-07-30 11:57:35 PST ---
truss :
|truss -p 20322
accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT) (sleeping...)
accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT)  = 12
getsockname(12, 0x001ADEF0, 0x001ADEDC, SOV_DEFAULT) = 0
fcntl(12, F_GETFL)                              = 2
fcntl(12, F_SETFL, FWRITE|FNONBLOCK)            = 0
read(12, 0x001B1E70, 8000)                      Err#11 EAGAIN
pollsys(0xFFBFE104, 1, 0xFFBFE080, 0x00000000)  = 1
read(12, " G E T   / t e s t . p d".., 8000)    = 28
stat64("/space/store/apache.30.Jul/install/htdocs/test.pdf", 0xFFBFE138) = 0
getpid()                                        = 20322 [20321]
open("/space/store/apache.30.Jul/install/htdocs/test.pdf",
O_RDONLY|O_LARGEFILE) = 13
setsockopt(12, tcp, TCP_CORK, 0xFFBFE294, 4, SOV_DEFAULT) = 0
writev(12, 0xFFBFE2BC, 1)                       = 261
sendfilev64(1, 12, 0x001AE7D0, 1, 0xFFBFE1A0)   = 313
write(9, " 1 2 7 . 0 . 0 . 1   -  ".., 76)      = 76
shutdown(12, SHUT_WR, SOV_DEFAULT)              = 0
pollsys(0xFFBFE3B4, 1, 0xFFBFE330, 0x00000000)  = 1
read(12, 0xFFBFE4A8, 512)                       = 0
close(12)                                       = 0
read(7, 0xFFBFE6A3, 1)                          Err#11 EAGAIN
close(13)                                       = 0
accept(4, 0xFFBFE530, 0xFFBFE51C, SOV_DEFAULT) (sleeping...)


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

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