www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Patterson <Jim.Patter...@Cognos.COM>
Subject os-windows/5171: Apache server goes into an infinite loop after CGI error
Date Tue, 19 Oct 1999 20:57:51 GMT

>Number:         5171
>Category:       os-windows
>Synopsis:       Apache server goes into an infinite loop after CGI error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Oct 19 15:10:01 PDT 1999
>Originator:     Jim.Patterson@Cognos.COM
>Release:        1.3.9
Windows NT 4.0 SP4
Visual C++ 5.0 SP3
I think that this is a timeout problem - the CGI timed out. It could also be a 
failure in the CGI but I don't think so. If you arent satisfied by my proposed
fix, I will attempt to create a CGI that will reproduce it for you.
The problem appears to be an invalid assumption by saferead_guts (src/main/buff.c) 
on Win32, or an improper Win32 implementation of ap_read (same file). 

saferead_guts loops until it gets no error or the error is other than EINTR.
However, ap_read for Win32 calls the Win32 API function ReadFile directly.
Because it's not using the C RTL, errno isn't set. If a) ReadFile fails and 
b) errno has the value EINTR initially, saferead_guts retries the read. In
my situation, the cgi process has gone away so ReadFile persistently returns
an error status. Because no code is setting the errno flag, it loops endlessly.

Since I presume ReadFile is being used for a valid reason (i.e. you won't
want to switch to using the C RTL read() routine), I suggest that the logic
be modified for Win32 to not check for the EINTR condition. There is no 
equivalent to the EINTR interrupt of a system call on Win32. 
[In order for any reply to be added to the PR database, you need]
[to include <apbugs@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]

View raw message