You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rainer Jung <ra...@kippdata.de> on 2009/01/18 19:23:59 UTC

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

On 16.01.2009 20:30, wrowe@apache.org wrote:
> Author: wrowe
> Date: Fri Jan 16 11:30:42 2009
> New Revision: 735093
>
> URL: http://svn.apache.org/viewvc?rev=735093&view=rev
> Log:
> Introduce Win32 AcceptFilter handling.
>
> Divided into 3 classes, this implements the first two;
>
>   * AcceptFilter 'data' - much as on Unix, accept will not complete
>     until data is ready to be accepted.  Unlike Unix, it will actually
>     fetch the first bucket full of data from the tcp socket, and this
>     patch implements passing that bucket into the core net brigade
>     in front of the accepted socket.
>
>   * AcceptFilter 'connect' - just as in Apache 2.2, accept will not
>     complete until three way handshake is complete and the endpoints
>     are resolved, and quickly grabs the endpoint addresses using the
>     AcceptEx API (which some people have problems with).  This will
>     not be the default.
>
>   * AcceptFilter 'none' [not yet implemented] - will be the traditional
>     select/WSAAccept style processing for broken network socket stacks
>     and more trivial tcp style connections.  If AcceptEx appears to be
>     a problem, the listener will be able to downgrade to 'none'.
>
>
> Modified:
>      httpd/httpd/trunk/server/mpm/winnt/child.c

I built trunk on XP today. When trying to run it, I get a restart loop 
for the child process, and the error log contains repetitions of:

======================================
[Sun Jan 18 19:20:42 2009] [notice] Apache/2.3.2-dev (Win32) configured 
-- resuming normal operations
[Sun Jan 18 19:20:42 2009] [notice] Server built: Jan 18 2009 01:17:29
[Sun Jan 18 19:20:42 2009] [notice] Parent: Created child process 4556
[Sun Jan 18 19:20:43 2009] [notice] Child 4556: Child process is running
[Sun Jan 18 19:20:43 2009] [notice] Child 4556: Acquired the start mutex.
[Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting 150 worker threads.
[Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting thread to 
listen on port 8000.
[Sun Jan 18 19:20:43 2009] [error] (OS 10038)Ein Vorgang bezog sich auf 
ein Objekt, das kein Socket ist.  : Child 4556: Encountered too many 
AcceptEx faults accepting client connections. Possible causes: dynamic 
address renewal, or incompatible VPN or firewall software.
[Sun Jan 18 19:20:43 2009] [notice] (OS 10038)Ein Vorgang bezog sich auf 
ein Objekt, das kein Socket ist.  : winnt_mpm: falling back to 
'AcceptFilter none'.
[Sun Jan 18 19:20:43 2009] [crit] (OS 10038)Ein Vorgang bezog sich auf 
ein Objekt, das kein Socket ist.  : winnt_mpm: AcceptFilter 'none' is 
not yet supported (a classic WSAAccept logic).  Use AcceptFilter 
'connect' or 'data' in the meantime
[Sun Jan 18 19:20:43 2009] [notice] Child 4556: Exit event signaled. 
Child process is ending.
[Sun Jan 18 19:20:44 2009] [notice] Child 4556: Released the start mutex
[Sun Jan 18 19:20:45 2009] [notice] Child 4556: All worker threads have 
exited.
[Sun Jan 18 19:20:45 2009] [notice] Child 4556: Child process is exiting
[Sun Jan 18 19:20:45 2009] [notice] Parent: child process exited with 
status 0 -- Restarting.
======================================

Since it is my first trunk build on Windows (and  don't have VC6), I 
could have well made a mistake. Just wanted to let you know the result, 
in case you get the same.

Regards,

Rainer


Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by Issac Goldstand <ma...@beamartyr.net>.
Rainer Jung wrote:
> On 19.01.2009 09:55, Issac Goldstand wrote:
>> Rainer Jung wrote:
>>> On 16.01.2009 20:30, wrowe@apache.org wrote:
>>>> Author: wrowe
>>>> Date: Fri Jan 16 11:30:42 2009
>>>> New Revision: 735093
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=735093&view=rev
>>>> Log:
>>>> Introduce Win32 AcceptFilter handling.
>>>>
>>>> Divided into 3 classes, this implements the first two;
>>>>
>>>>    * AcceptFilter 'data' - much as on Unix, accept will not complete
>>>>      until data is ready to be accepted.  Unlike Unix, it will
>>>> actually
>>>>      fetch the first bucket full of data from the tcp socket, and this
>>>>      patch implements passing that bucket into the core net brigade
>>>>      in front of the accepted socket.
>>>>
>>>>    * AcceptFilter 'connect' - just as in Apache 2.2, accept will not
>>>>      complete until three way handshake is complete and the endpoints
>>>>      are resolved, and quickly grabs the endpoint addresses using the
>>>>      AcceptEx API (which some people have problems with).  This will
>>>>      not be the default.
>>>>
>>>>    * AcceptFilter 'none' [not yet implemented] - will be the
>>>> traditional
>>>>      select/WSAAccept style processing for broken network socket
>>>> stacks
>>>>      and more trivial tcp style connections.  If AcceptEx appears
>>>> to be
>>>>      a problem, the listener will be able to downgrade to 'none'.
>>>>
>>>>
>>>> Modified:
>>>>       httpd/httpd/trunk/server/mpm/winnt/child.c
>>> I built trunk on XP today. When trying to run it, I get a restart loop
>>> for the child process, and the error log contains repetitions of:
>>>
>>> ======================================
>>> [Sun Jan 18 19:20:42 2009] [notice] Apache/2.3.2-dev (Win32)
>>> configured -- resuming normal operations
>>> [Sun Jan 18 19:20:42 2009] [notice] Server built: Jan 18 2009 01:17:29
>>> [Sun Jan 18 19:20:42 2009] [notice] Parent: Created child process 4556
>>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Child process is
>>> running
>>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Acquired the start
>>> mutex.
>>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting 150 worker
>>> threads.
>>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting thread to
>>> listen on port 8000.
>>> [Sun Jan 18 19:20:43 2009] [error] (OS 10038)Ein Vorgang bezog sich
>>> auf ein Objekt, das kein Socket ist.  : Child 4556: Encountered too
>>> many AcceptEx faults accepting client connections. Possible causes:
>>> dynamic address renewal, or incompatible VPN or firewall software.
>>> [Sun Jan 18 19:20:43 2009] [notice] (OS 10038)Ein Vorgang bezog sich
>>> auf ein Objekt, das kein Socket ist.  : winnt_mpm: falling back to
>>> 'AcceptFilter none'.
>>> [Sun Jan 18 19:20:43 2009] [crit] (OS 10038)Ein Vorgang bezog sich auf
>>> ein Objekt, das kein Socket ist.  : winnt_mpm: AcceptFilter 'none' is
>>> not yet supported (a classic WSAAccept logic).  Use AcceptFilter
>>> 'connect' or 'data' in the meantime
>>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Exit event signaled.
>>> Child process is ending.
>>> [Sun Jan 18 19:20:44 2009] [notice] Child 4556: Released the start
>>> mutex
>>> [Sun Jan 18 19:20:45 2009] [notice] Child 4556: All worker threads
>>> have exited.
>>> [Sun Jan 18 19:20:45 2009] [notice] Child 4556: Child process is
>>> exiting
>>> [Sun Jan 18 19:20:45 2009] [notice] Parent: child process exited with
>>> status 0 -- Restarting.
>>> ======================================
>>>
>>> Since it is my first trunk build on Windows (and  don't have VC6), I
>>> could have well made a mistake. Just wanted to let you know the
>>> result, in case you get the same.
>>>
>>> Regards,
>>>
>>> Rainer
>> This looks like it's trying to downgrade to the not-yet-existing "none"
>> filter, based on bill's commit comment
>
> Sure, the question is: is it expected to downgrade, i.e. why is there
> error 10038 on my system (and how can I debug this). It could be a
> systems setup problem, or it could be a code problem.
>
> Regards,
>
> Rainer
I'd assume that you're having AcceptEx troubles.  It happens in
win32-land.  Annoyingly often, sometimes.  Bill's  much better at this
than I am, so we'll let him answer...

  Issac

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by Rainer Jung <ra...@kippdata.de>.
On 19.01.2009 09:55, Issac Goldstand wrote:
> Rainer Jung wrote:
>> On 16.01.2009 20:30, wrowe@apache.org wrote:
>>> Author: wrowe
>>> Date: Fri Jan 16 11:30:42 2009
>>> New Revision: 735093
>>>
>>> URL: http://svn.apache.org/viewvc?rev=735093&view=rev
>>> Log:
>>> Introduce Win32 AcceptFilter handling.
>>>
>>> Divided into 3 classes, this implements the first two;
>>>
>>>    * AcceptFilter 'data' - much as on Unix, accept will not complete
>>>      until data is ready to be accepted.  Unlike Unix, it will actually
>>>      fetch the first bucket full of data from the tcp socket, and this
>>>      patch implements passing that bucket into the core net brigade
>>>      in front of the accepted socket.
>>>
>>>    * AcceptFilter 'connect' - just as in Apache 2.2, accept will not
>>>      complete until three way handshake is complete and the endpoints
>>>      are resolved, and quickly grabs the endpoint addresses using the
>>>      AcceptEx API (which some people have problems with).  This will
>>>      not be the default.
>>>
>>>    * AcceptFilter 'none' [not yet implemented] - will be the traditional
>>>      select/WSAAccept style processing for broken network socket stacks
>>>      and more trivial tcp style connections.  If AcceptEx appears to be
>>>      a problem, the listener will be able to downgrade to 'none'.
>>>
>>>
>>> Modified:
>>>       httpd/httpd/trunk/server/mpm/winnt/child.c
>> I built trunk on XP today. When trying to run it, I get a restart loop
>> for the child process, and the error log contains repetitions of:
>>
>> ======================================
>> [Sun Jan 18 19:20:42 2009] [notice] Apache/2.3.2-dev (Win32)
>> configured -- resuming normal operations
>> [Sun Jan 18 19:20:42 2009] [notice] Server built: Jan 18 2009 01:17:29
>> [Sun Jan 18 19:20:42 2009] [notice] Parent: Created child process 4556
>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Child process is running
>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Acquired the start mutex.
>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting 150 worker
>> threads.
>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting thread to
>> listen on port 8000.
>> [Sun Jan 18 19:20:43 2009] [error] (OS 10038)Ein Vorgang bezog sich
>> auf ein Objekt, das kein Socket ist.  : Child 4556: Encountered too
>> many AcceptEx faults accepting client connections. Possible causes:
>> dynamic address renewal, or incompatible VPN or firewall software.
>> [Sun Jan 18 19:20:43 2009] [notice] (OS 10038)Ein Vorgang bezog sich
>> auf ein Objekt, das kein Socket ist.  : winnt_mpm: falling back to
>> 'AcceptFilter none'.
>> [Sun Jan 18 19:20:43 2009] [crit] (OS 10038)Ein Vorgang bezog sich auf
>> ein Objekt, das kein Socket ist.  : winnt_mpm: AcceptFilter 'none' is
>> not yet supported (a classic WSAAccept logic).  Use AcceptFilter
>> 'connect' or 'data' in the meantime
>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Exit event signaled.
>> Child process is ending.
>> [Sun Jan 18 19:20:44 2009] [notice] Child 4556: Released the start mutex
>> [Sun Jan 18 19:20:45 2009] [notice] Child 4556: All worker threads
>> have exited.
>> [Sun Jan 18 19:20:45 2009] [notice] Child 4556: Child process is exiting
>> [Sun Jan 18 19:20:45 2009] [notice] Parent: child process exited with
>> status 0 -- Restarting.
>> ======================================
>>
>> Since it is my first trunk build on Windows (and  don't have VC6), I
>> could have well made a mistake. Just wanted to let you know the
>> result, in case you get the same.
>>
>> Regards,
>>
>> Rainer
> This looks like it's trying to downgrade to the not-yet-existing "none"
> filter, based on bill's commit comment

Sure, the question is: is it expected to downgrade, i.e. why is there 
error 10038 on my system (and how can I debug this). It could be a 
systems setup problem, or it could be a code problem.

Regards,

Rainer

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by Issac Goldstand <ma...@beamartyr.net>.
Rainer Jung wrote:
> On 16.01.2009 20:30, wrowe@apache.org wrote:
>> Author: wrowe
>> Date: Fri Jan 16 11:30:42 2009
>> New Revision: 735093
>>
>> URL: http://svn.apache.org/viewvc?rev=735093&view=rev
>> Log:
>> Introduce Win32 AcceptFilter handling.
>>
>> Divided into 3 classes, this implements the first two;
>>
>>   * AcceptFilter 'data' - much as on Unix, accept will not complete
>>     until data is ready to be accepted.  Unlike Unix, it will actually
>>     fetch the first bucket full of data from the tcp socket, and this
>>     patch implements passing that bucket into the core net brigade
>>     in front of the accepted socket.
>>
>>   * AcceptFilter 'connect' - just as in Apache 2.2, accept will not
>>     complete until three way handshake is complete and the endpoints
>>     are resolved, and quickly grabs the endpoint addresses using the
>>     AcceptEx API (which some people have problems with).  This will
>>     not be the default.
>>
>>   * AcceptFilter 'none' [not yet implemented] - will be the traditional
>>     select/WSAAccept style processing for broken network socket stacks
>>     and more trivial tcp style connections.  If AcceptEx appears to be
>>     a problem, the listener will be able to downgrade to 'none'.
>>
>>
>> Modified:
>>      httpd/httpd/trunk/server/mpm/winnt/child.c
>
> I built trunk on XP today. When trying to run it, I get a restart loop
> for the child process, and the error log contains repetitions of:
>
> ======================================
> [Sun Jan 18 19:20:42 2009] [notice] Apache/2.3.2-dev (Win32)
> configured -- resuming normal operations
> [Sun Jan 18 19:20:42 2009] [notice] Server built: Jan 18 2009 01:17:29
> [Sun Jan 18 19:20:42 2009] [notice] Parent: Created child process 4556
> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Child process is running
> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Acquired the start mutex.
> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting 150 worker
> threads.
> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting thread to
> listen on port 8000.
> [Sun Jan 18 19:20:43 2009] [error] (OS 10038)Ein Vorgang bezog sich
> auf ein Objekt, das kein Socket ist.  : Child 4556: Encountered too
> many AcceptEx faults accepting client connections. Possible causes:
> dynamic address renewal, or incompatible VPN or firewall software.
> [Sun Jan 18 19:20:43 2009] [notice] (OS 10038)Ein Vorgang bezog sich
> auf ein Objekt, das kein Socket ist.  : winnt_mpm: falling back to
> 'AcceptFilter none'.
> [Sun Jan 18 19:20:43 2009] [crit] (OS 10038)Ein Vorgang bezog sich auf
> ein Objekt, das kein Socket ist.  : winnt_mpm: AcceptFilter 'none' is
> not yet supported (a classic WSAAccept logic).  Use AcceptFilter
> 'connect' or 'data' in the meantime
> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Exit event signaled.
> Child process is ending.
> [Sun Jan 18 19:20:44 2009] [notice] Child 4556: Released the start mutex
> [Sun Jan 18 19:20:45 2009] [notice] Child 4556: All worker threads
> have exited.
> [Sun Jan 18 19:20:45 2009] [notice] Child 4556: Child process is exiting
> [Sun Jan 18 19:20:45 2009] [notice] Parent: child process exited with
> status 0 -- Restarting.
> ======================================
>
> Since it is my first trunk build on Windows (and  don't have VC6), I
> could have well made a mistake. Just wanted to let you know the
> result, in case you get the same.
>
> Regards,
>
> Rainer
This looks like it's trying to downgrade to the not-yet-existing "none"
filter, based on bill's commit comment

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by Rainer Jung <ra...@kippdata.de>.
On 19.01.2009 19:48, Rainer Jung wrote:
> On 19.01.2009 18:33, William A. Rowe, Jr. wrote:
>> Curiosity, XP SP? -- and did you tweak apr.h(w) to enable IPV6?

Tested again with APR_HAVE_IPV6 set to 1.

Build succeeds, httpd starts, but http requests do not get any answer. 
There is no restart loop as without IPV6 and also error log has a 
different content:

[Tue Jan 20 00:29:54 2009] [notice] Parent: Child process exited 
successfully.
[Tue Jan 20 00:30:27 2009] [notice] Apache/2.3.2-dev (Win32) configured 
-- resuming normal operations
[Tue Jan 20 00:30:27 2009] [notice] Server built: Jan 20 2009 00:18:04
[Tue Jan 20 00:30:27 2009] [notice] Parent: Created child process 5404
[Tue Jan 20 00:30:27 2009] [notice] Child 5404: Child process is running
[Tue Jan 20 00:30:27 2009] [notice] Child 5404: Acquired the start mutex.
[Tue Jan 20 00:30:27 2009] [notice] Child 5404: Starting 64 worker threads.
[Tue Jan 20 00:30:27 2009] [error] (OS 10038)Ein Vorgang bezog sich auf 
ein Objekt, das kein Socket ist.  : winnt_accept: getsockname error on 
listening socket, is IPv6 available?

But unfortunately we still see the 10038 error.

I tried with "Listen 8000", "Listen localhost:8000" and "Listen 
A.B.C.D:8000".

Regards,

Rainer

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
William A. Rowe, Jr. wrote:
> Rainer Jung wrote:
>> When I undo this change, it works again :)
>>
>> By adding some logging, I see, that my XP system takes the else branch.
> 
> Feel free to commit - fantastic sleuthing --- Thanks!!!
> 
> If you don't beat me to it the fix will be in my next round of commits :)

I saw you had committed.

w.r.t. Apache 2.3-alpha-next, I know I mentioned I would finish this code
by the end of the week, but a brick wall of work just fell on me that is
going to eat all my availability to polish this up.  Soonest it will be
done (the AcceptMutex none logic) is going to be end of the month (that
weekend, anyways).

So if we do roll an alpha, I'd suggest a strong cautionary note that win32
support is incomplete, and without a working AcceptFilter 'data' (for http)
or even AcceptFilter 'connect' (for https) the server is expected not to
function correctly.


Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Rainer Jung wrote:
> On 21.01.2009 18:33, William A. Rowe, Jr. wrote:
>> William A. Rowe, Jr. wrote:
>>> Rainer Jung wrote:
>>>> Could be, that there's something wrong with the code that copies the
>>>> listen sockets from the main process to the child.
>>> Exactly; one of the primary possibilities is that a well documented API,
>>> WSADuplicateSocket does not behave for a given socket provider.
>>
>> It's also possible that there is an [un]obvious bug.  I hate this
>> particular
>> tracing, but I'm off to check this out from the parent/child this
>> afternoon.
>> Yes - my own testing initially has been -X - it explains our discrepancy.
> 
> Looks like I solved it:
> 
> In r730828 Win9x code was removed. At least in one function, the Win9x
> code was kept and instead the more modern code was removed, namely in
> file mpm_winnt.c, function get_listeners_from_parent():
> 
> @@ -480,30 +466,12 @@
>              exit(APEXIT_CHILDINIT);
>          }
> 
> -        if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
> -            HANDLE hProcess = GetCurrentProcess();
> -            HANDLE dup;
> -            if (DuplicateHandle(hProcess, (HANDLE) nsd, hProcess, &dup,
> -                                0, FALSE, DUPLICATE_SAME_ACCESS)) {
> ...
> -            }
> -        }
> -        else {
> ...
> -            if (!SetHandleInformation((HANDLE)nsd, HANDLE_FLAG_INHERIT,
> 0)) {
> ...
> -            }
> +        if (DuplicateHandle(hProcess, (HANDLE) nsd, hProcess, &dup,
> +                            0, FALSE, DUPLICATE_SAME_ACCESS)) {
> +            closesocket(nsd);
> +            nsd = (SOCKET) dup;
>          }
> +
>          apr_os_sock_put(&lr->sd, &nsd, s->process->pool);
>      }
> 
> In effect, the "if" part is still there and the else part has been
> removed. As far as MSDN tells me, osver.dwPlatformId ==
> VER_PLATFORM_WIN32_WINDOWS is true for Win9x, so the if part is the one
> to remove, and the else part is the one we might want to keep.
> 
> When I undo this change, it works again :)
> 
> By adding some logging, I see, that my XP system takes the else branch.

Feel free to commit - fantastic sleuthing --- Thanks!!!

If you don't beat me to it the fix will be in my next round of commits :)

Bill

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by Rainer Jung <ra...@kippdata.de>.
On 21.01.2009 18:33, William A. Rowe, Jr. wrote:
> William A. Rowe, Jr. wrote:
>> Rainer Jung wrote:
>>> Could be, that there's something wrong with the code that copies the
>>> listen sockets from the main process to the child.
>> Exactly; one of the primary possibilities is that a well documented API,
>> WSADuplicateSocket does not behave for a given socket provider.
>
> It's also possible that there is an [un]obvious bug.  I hate this particular
> tracing, but I'm off to check this out from the parent/child this afternoon.
> Yes - my own testing initially has been -X - it explains our discrepancy.

Looks like I solved it:

In r730828 Win9x code was removed. At least in one function, the Win9x 
code was kept and instead the more modern code was removed, namely in 
file mpm_winnt.c, function get_listeners_from_parent():

@@ -480,30 +466,12 @@
              exit(APEXIT_CHILDINIT);
          }

-        if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
-            HANDLE hProcess = GetCurrentProcess();
-            HANDLE dup;
-            if (DuplicateHandle(hProcess, (HANDLE) nsd, hProcess, &dup,
-                                0, FALSE, DUPLICATE_SAME_ACCESS)) {
...
-            }
-        }
-        else {
...
-            if (!SetHandleInformation((HANDLE)nsd, HANDLE_FLAG_INHERIT, 
0)) {
...
-            }
+        if (DuplicateHandle(hProcess, (HANDLE) nsd, hProcess, &dup,
+                            0, FALSE, DUPLICATE_SAME_ACCESS)) {
+            closesocket(nsd);
+            nsd = (SOCKET) dup;
          }
+
          apr_os_sock_put(&lr->sd, &nsd, s->process->pool);
      }

In effect, the "if" part is still there and the else part has been 
removed. As far as MSDN tells me, osver.dwPlatformId == 
VER_PLATFORM_WIN32_WINDOWS is true for Win9x, so the if part is the one 
to remove, and the else part is the one we might want to keep.

When I undo this change, it works again :)

By adding some logging, I see, that my XP system takes the else branch.

Regards,

Rainer

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
William A. Rowe, Jr. wrote:
> Rainer Jung wrote:
>>
>> Could be, that there's something wrong with the code that copies the
>> listen sockets from the main process to the child.
> 
> Exactly; one of the primary possibilities is that a well documented API,
> WSADuplicateSocket does not behave for a given socket provider.

It's also possible that there is an [un]obvious bug.  I hate this particular
tracing, but I'm off to check this out from the parent/child this afternoon.
Yes - my own testing initially has been -X - it explains our discrepancy.

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Rainer Jung wrote:
> On 19.01.2009 19:48, Rainer Jung wrote:
>> On 19.01.2009 18:33, William A. Rowe, Jr. wrote:
>>> Rainer Jung wrote:
>>>> I built trunk on XP today. When trying to run it, I get a restart loop
>>>> for the child process, and the error log contains repetitions of:
>>>
>>>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting thread to
>>>> listen on port 8000.
>>>> [Sun Jan 18 19:20:43 2009] [error] (OS 10038)Ein Vorgang bezog sich auf
>>>> ein Objekt, das kein Socket ist. : Child 4556: Encountered too many
>>>> AcceptEx faults accepting client connections. Possible causes: dynamic
>>>> address renewal, or incompatible VPN or firewall software.
>>>
>>> I'd love to know what leads into this WSAENOTSOCK ... failing to recycle
>>> the socket or the listener socket falling apart. Needs review, maybe
>>> some
>>> extra magic to log this distinction.
>>>
>>> The "falling back on 'none'" is going to be a problem till I finish that
>>> code this week. I'm actually attacking two problems, having each listen
>>> thread pay attention to up to 62 different sockets, and adding the
>>> required
>>> classic accept() logic. So... this listener may be accepting on both the
>>> classic listen logic and the AcceptEx logic on different listeners at
>>> the
>>> same time.
> 
> When running with httpd -X, I can't observe the problem. Inspecting the
> structures indicates, that the problem might actually be the listen
> socket in AcceptEx (nlsd), not the accept socket.
> 
> Could be, that there's something wrong with the code that copies the
> listen sockets from the main process to the child.

Exactly; one of the primary possibilities is that a well documented API,
WSADuplicateSocket does not behave for a given socket provider.



Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by Rainer Jung <ra...@kippdata.de>.
On 19.01.2009 19:48, Rainer Jung wrote:
> On 19.01.2009 18:33, William A. Rowe, Jr. wrote:
>> Rainer Jung wrote:
>>> I built trunk on XP today. When trying to run it, I get a restart loop
>>> for the child process, and the error log contains repetitions of:
>>
>>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting thread to
>>> listen on port 8000.
>>> [Sun Jan 18 19:20:43 2009] [error] (OS 10038)Ein Vorgang bezog sich auf
>>> ein Objekt, das kein Socket ist. : Child 4556: Encountered too many
>>> AcceptEx faults accepting client connections. Possible causes: dynamic
>>> address renewal, or incompatible VPN or firewall software.
>>
>> I'd love to know what leads into this WSAENOTSOCK ... failing to recycle
>> the socket or the listener socket falling apart. Needs review, maybe some
>> extra magic to log this distinction.
>>
>> The "falling back on 'none'" is going to be a problem till I finish that
>> code this week. I'm actually attacking two problems, having each listen
>> thread pay attention to up to 62 different sockets, and adding the
>> required
>> classic accept() logic. So... this listener may be accepting on both the
>> classic listen logic and the AcceptEx logic on different listeners at the
>> same time.

When running with httpd -X, I can't observe the problem. Inspecting the 
structures indicates, that the problem might actually be the listen 
socket in AcceptEx (nlsd), not the accept socket.

Could be, that there's something wrong with the code that copies the 
listen sockets from the main process to the child.

Regards,

Rainer

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by Rainer Jung <ra...@kippdata.de>.
On 19.01.2009 18:33, William A. Rowe, Jr. wrote:
> Rainer Jung wrote:
>> I built trunk on XP today. When trying to run it, I get a restart loop
>> for the child process, and the error log contains repetitions of:
>
>> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting thread to
>> listen on port 8000.
>> [Sun Jan 18 19:20:43 2009] [error] (OS 10038)Ein Vorgang bezog sich auf
>> ein Objekt, das kein Socket ist.  : Child 4556: Encountered too many
>> AcceptEx faults accepting client connections. Possible causes: dynamic
>> address renewal, or incompatible VPN or firewall software.
>
> I'd love to know what leads into this WSAENOTSOCK ... failing to recycle
> the socket or the listener socket falling apart.  Needs review, maybe some
> extra magic to log this distinction.
>
> The "falling back on 'none'" is going to be a problem till I finish that
> code this week.  I'm actually attacking two problems, having each listen
> thread pay attention to up to 62 different sockets, and adding the required
> classic accept() logic.  So... this listener may be accepting on both the
> classic listen logic and the AcceptEx logic on different listeners at the
> same time.
>
> Restructuring the code is a little painful, but I should get through this
> by the end of the week.
>
> Curiosity, XP SP? -- and did you tweak apr.h(w) to enable IPV6?
>
>> Since it is my first trunk build on Windows (and  don't have VC6), I
>> could have well made a mistake. Just wanted to let you know the result,
>> in case you get the same.
>
> Yes; there is more work to be done here.  But thank you for the notes and
> I don't believe there is any difference here for VC12 vs. later compilers
> or c runtimes.

Windows XP Professional Version 2002 SP 3, regular MS Update patches 
applied. APR_HAVE_IPV6 is defined to be "0", I can rebuild and retest 
with "1" later this week if that change is interesting.

I have Visual Studio .NET 2003 on the system, So I could attach the 
debugger and inspect data structures easily, if that's interesting.

Version used for build:

httpd r735283
apr 1.3.x r735290
apr-util 1.3.x r735291
apr-iconv 1.1.x r735291

zlib 1.2.3
openssl 0.9.8j
pcre 7.8

I did the build using Visual Studio by first converting the dsp files. 
Before converting them, I applied cvtdsp.pl (and had to convert line 
ends on some of them). Including a recent pcre into the build was a bit 
tedious, but no other changes were needed.

Regards,

Rainer

Re: svn commit: r735093 - /httpd/httpd/trunk/server/mpm/winnt/child.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Rainer Jung wrote:
> On 16.01.2009 20:30, wrowe@apache.org wrote:
>> Author: wrowe
>> Date: Fri Jan 16 11:30:42 2009
>> New Revision: 735093
>>
>> URL: http://svn.apache.org/viewvc?rev=735093&view=rev
>> Log:
>> Introduce Win32 AcceptFilter handling.
>>
>> Divided into 3 classes, this implements the first two;
>>
>>   * AcceptFilter 'data' - much as on Unix, accept will not complete
>>     until data is ready to be accepted.  Unlike Unix, it will actually
>>     fetch the first bucket full of data from the tcp socket, and this
>>     patch implements passing that bucket into the core net brigade
>>     in front of the accepted socket.
>>
>>   * AcceptFilter 'connect' - just as in Apache 2.2, accept will not
>>     complete until three way handshake is complete and the endpoints
>>     are resolved, and quickly grabs the endpoint addresses using the
>>     AcceptEx API (which some people have problems with).  This will
>>     not be the default.
>>
>>   * AcceptFilter 'none' [not yet implemented] - will be the traditional
>>     select/WSAAccept style processing for broken network socket stacks
>>     and more trivial tcp style connections.  If AcceptEx appears to be
>>     a problem, the listener will be able to downgrade to 'none'.

> I built trunk on XP today. When trying to run it, I get a restart loop
> for the child process, and the error log contains repetitions of:

> [Sun Jan 18 19:20:43 2009] [notice] Child 4556: Starting thread to
> listen on port 8000.
> [Sun Jan 18 19:20:43 2009] [error] (OS 10038)Ein Vorgang bezog sich auf
> ein Objekt, das kein Socket ist.  : Child 4556: Encountered too many
> AcceptEx faults accepting client connections. Possible causes: dynamic
> address renewal, or incompatible VPN or firewall software.

I'd love to know what leads into this WSAENOTSOCK ... failing to recycle
the socket or the listener socket falling apart.  Needs review, maybe some
extra magic to log this distinction.

The "falling back on 'none'" is going to be a problem till I finish that
code this week.  I'm actually attacking two problems, having each listen
thread pay attention to up to 62 different sockets, and adding the required
classic accept() logic.  So... this listener may be accepting on both the
classic listen logic and the AcceptEx logic on different listeners at the
same time.

Restructuring the code is a little painful, but I should get through this
by the end of the week.

Curiosity, XP SP? -- and did you tweak apr.h(w) to enable IPV6?

> Since it is my first trunk build on Windows (and  don't have VC6), I
> could have well made a mistake. Just wanted to let you know the result,
> in case you get the same.

Yes; there is more work to be done here.  But thank you for the notes and
I don't believe there is any difference here for VC12 vs. later compilers
or c runtimes.