View Issue Details

IDProjectCategoryView StatusLast Update
0000738Apache 2.x Bugpublic2021-12-27 11:32
ReporterSteven Levine Assigned ToSteven Levine  
Status assignedResolutionopen 
PlatformOS2/eCSOSOS/2 or eComstationOS Version1.x 2.x or 4.5
Product Version2.4.x 
Summary0000738: Accessing large files via wget or a browser results in a truncated file.
DescriptionThis occurs for httpd 2.4.48 (, but there's not yet any reason to believe it does not occur for earlier builds.

GET requests for files smaller than some as yet unknown limit succeed without errors. GET requests for larger files end early for example, is 3.4MB.


gets into a retry loop because it detects that the entire file has not been received and requests more of the file. Firefox 45.9 reports no errors, but only receives the first 40,490 or so of the file.

The logs show that only a portion of the file has been sent. - - [13/Jul/2021:15:02:11 +0000] "GET /betas/ HTTP/1.1" 200 40490 "" "Mozilla/5.0 (OS/2; Warp 4.5; rv:38.0) Gecko/20100101 Firefox/38.0 SeaMonkey/2.35"
TagsNo tags attached.



2021-07-19 04:45

developer   ~0003826

In case it's of any help in correlating log files, this is a wget attempt (no proxy) which ultimately succeeded (local time is -0400 EDT):

--2021-07-18 15:06:12--
Resolving (
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 74865 (73K) [application/zip]
Saving to: ''

TestDosGetDateTimeT 48%[========> ] 35.67K 31.5KB/s in 1.1s

2021-07-18 15:06:13 (31.5 KB/s) - Connection closed at byte 36527. Retrying.

--2021-07-18 15:06:14-- (try: 2)
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 74865 (73K), 38338 (37K) remaining [application/zip]
Saving to: ''

TestDosGetDateTimeT 97%[+++++++++=========> ] 71.29K 29.2KB/s in 1.2s

2021-07-18 15:06:15 (29.2 KB/s) - Connection closed at byte 73001. Retrying.

--2021-07-18 15:06:17-- (try: 3)
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 74865 (73K), 1864 (1.8K) remaining [application/zip]
Saving to: ''

TestDosGetDateTimeT 100%[+++++++++++++++++++>] 73.11K --.-KB/s in 0s

2021-07-18 15:06:18 (36.4 KB/s) - '' saved [74865/74865]

I'll compare the above to Hawking's wget pull for the FTP mirror to see if the chunk sizes are the same (the update pass is not scheduled for another 11 hours or so).

Steven Levine

2021-08-23 01:11

manager   ~0003888

This issue is mostly resolved with the current libcx from netlabs-exp. However, some wget requests still restart intermittently, so we are not yet ready to say the issue is resolved.

Steven Levine

2021-11-10 05:17

manager   ~0003900

Status update...

The cause to that truncated GET requests has been isolated to the select statement at

            fds = sock->socketdes;
            rv = select(&fds, 0, 1, 0, sock->timeout >= 0 ? sock->timeout/1000 : -1);

This is in our apr_socket_sendv implementation. Other platforms do not use select.

As the code is currently written, the select is not expected to fail with no sockets ready to send, but it can because the socket is configured as non-blocking. The no sockets ready is a false positive probably because the stack is busy. The result is that APR_TIMEUP is returned to the caller. This is a problem because it is not treated as an error and the client believes that the GET request completed without errors.

This is likely the case because, if the stack is busy with other operations, the number of truncated GET requests seems to increase.

The fix will be a patch to retry to failing selects, as we have need to do elsewhere, and to ensure that real time outs result in reporting an error to the caller.

Steven Levine

2021-12-27 11:32

manager   ~0003901

Here's a copy of the diff I passed to Paul on the apache2 list.
sendrecv.c.diff (815 bytes)   
diff --git a/network_io/os2/sendrecv.c b/network_io/os2/sendrecv.c
index 06e725a..4d7e108 100644
--- a/network_io/os2/sendrecv.c
+++ b/network_io/os2/sendrecv.c
@@ -118,6 +118,7 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock,
     struct iovec *tmpvec;
     int fds, err = 0;
     int nv_tosend, total = 0;
+    int retries = 0;
 #ifndef __INNOTEK_LIBC__
     /* Make sure writev() only gets fed 64k at a time */
@@ -143,6 +144,10 @@ APR_DECLARE(apr_status_t) apr_socket_sendv(apr_socket_t *sock,
                 err = sock_errno();
                 if (rv == 0) {
+		    if (err == SOCEWOULDBLOCK && ++retries < 10) {
+		      apr_sleep(100 * 1000);        /* 100 mSec */
+		      continue;			/* Retry select */
+		    }
                     return APR_TIMEUP;
sendrecv.c.diff (815 bytes)   

Issue History

Date Modified Username Field Change
2021-07-15 14:03 Steven Levine New Issue
2021-07-15 14:03 Steven Levine Status new => assigned
2021-07-15 14:03 Steven Levine Assigned To => Steven Levine
2021-07-15 14:08 Steven Levine Issue cloned: 0000739
2021-07-19 04:45 LewisR Note Added: 0003826
2021-08-23 01:11 Steven Levine Note Added: 0003888
2021-11-10 05:17 Steven Levine Note Added: 0003900
2021-12-27 11:32 Steven Levine Note Added: 0003901
2021-12-27 11:32 Steven Levine File Added: sendrecv.c.diff