Article delegate-en/2878 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A2875@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: fix for "FATAL: inherited handle [0] NNN is not socket" on Win32
30 Mar 2005 07:24:21 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

Thank you for your testing.

In message <_A2875@delegate-en.ML_> on 03/30/05(00:21:39)
you Mikhail <peqfqbdyi-tqqtzd5vazfr.ml@ml.delegate.org> wrote:
 |>> Invoking DeleGate with "-W4" option might show some helpful information.
 |
 |OK. Here it is (one failured session, I'm sorry I don't know what
 |exactly to skip :( ):
...
 |(WIN) 09:50 [3168] Sockets(24/24/256:117/333): 208 209 210 232 233 234 252 253 254 276 277 278 280 281 282 352 353 354 392 393 394 412 413 414
 |(WIN) 09:50 [3168] connect(1740,1254) = 0
 |(WIN) 09:50 [1412] WinSock option "-WSAV:2.2" ReqVer:202 Result:0 Errno:0
 |(WIN) 09:50 [1412] Version:202 HighVersion:202 Description:WinSock 2.0
 |(WIN) 09:50 [1412] SystemStatus:Running MaxSockets:0 MaxUdpDg:0
 |(WIN) 09:50 [1412] Sockets(32/32/256:114/405): 208 209 210 220 232 233 234 240 252 253 254 264 276 277 278 280 281 282 332 344 352 353 354 372 380 392 393 394 408 412 413 414

This log shows that the sockets including 264 are not inherited to child
process [3168] from the parent [1412].  This is not the default behavior
of WindowsNT series including WindowsXP. (why?)

 |(WIN) 09:50 [1412] accept(408,1254) = 556 [127.0.0.1:1255]
 |(WIN) 09:50 [1412] PID=1412 SELF_HANDLE=408
 |(WIN) 09:50 [1412] INHERIT: 264->1728 (close_source=0,264/23)
 |(WIN) 09:50 [1412] INHERIT: 332->1724 (close_source=0,332/9)
 |(WIN) 09:50 [1412] INHERIT: 380->1720 (close_source=0,380/15)
 |(WIN) 09:50 [3168] inheritance recv() = 368
 |(WIN) 09:50 [3168] >>>> [0] 1728 is not SOCKET, retrying WSADuplicateSocket ...

This log shows that the socket 264 is duplicated by DuplicateHandle from the
parent into the child sucessfully as 1728, but it seems not to be received
as a socket in the child. (why?)

 |(WIN) 09:50 [3168] STARTUP: SPAWN_ENVIRON=1254, got[368], ppid=1412,pmode=1
 |(WIN) 09:50 [1412] >>>> dupsock(264,3168)=0 [2 1 6]
 |(WIN) 09:50 [1412] >>>> sent[0]
 |(WIN) 09:50 [1412] >>>> dupsock(332,3168)=0 [2 1 6]
 |(WIN) 09:50 [1412] >>>> sent[1]
 |(WIN) 09:50 [1412] >>>> dupsock(380,3168)=0 [2 1 6]
 |(WIN) 09:50 [1412] >>>> sent[2]
 |clsock=1728 nc=1696 2 1 6
 |(WIN) 09:50 [3168] [0] PPID=1412/1716 CLSOCK=[264->1696]
 |(WIN) 09:50 [3168] inheritSOCK -- closesocket(264)
 |(WIN) 09:50 [1412] spawn() = 432 [3168], children(alive=1,total=1)
 |(WIN) 09:50 [3168] -- SOCKET 1*(1696/ 5) opened fork()
 |(WIN) 09:50 [3168] PARENT=1412, PORT=1254, CLSOCK[0]=1696/5:1 [0.0.0.0]
 |(WIN) 09:50 [3168] >>>> recv[1] clsock=1724 nc=1684 2 1 6
 |(WIN) 09:50 [3168] [1] PPID=1412/1716 CLSOCK=[332->1684]
 |(WIN) 09:50 [3168] inheritSOCK -- closesocket(332)
 |(WIN) 09:50 [3168] -- SOCKET 1*(1684/20) opened fork()
 |(WIN) 09:50 [3168] PARENT=1412, PORT=1254, CLSOCK[1]=1684/20:1 [0.0.0.0]
 |(WIN) 09:50 [3168] >>>> recv[2] clsock=1720 nc=1672 2 1 6
 |(WIN) 09:50 [3168] [2] PPID=1412/1716 CLSOCK=[380->1672]
 |(WIN) 09:50 [3168] inheritSOCK -- closesocket(380)
 |(WIN) 09:50 [3168] -- SOCKET 1*(1672/21) opened fork()
 |(WIN) 09:50 [3168] PARENT=1412, PORT=1254, CLSOCK[2]=1672/21:1 [0.0.0.0]

This log shows that the socket 264 is duplicated with WSADuplicateSocket
and WSASocket successfully, but the address information of the socket
seems to be lost as [0.0.0.0] (why?)

 |03/29 21:09:50.04 [3168] 1+1: FATAL: get{host|peer}name(5) failed, errno=22

So the DeleGate fails to go.

There seems to be so many strange behavior I can't figure out.  So I
made and uploaded "8.11.2-pre4.zip".  It will give us more detailed log.

I tested the DeleGate on WindowsXP SP2, as an Administrator or a normal
user, and with or without "firewall" feature.  But I could not reproduce
the problem.

Cheers,
Yutaka
--
  D G   Yutaka Sato <y.sato@delegate.org> http://delegate.org/y.sato/
 ( - )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V