Add-Ons & Services

socket closed twice

Please post support and help requests here.
Posts: 14
Joined: 23 Nov 2011, 00:39

socket closed twice

Postby jengle » 10 Aug 2012, 06:51

I'm running an application using HTTPServer and SecureServerSocket on Windows and have Application Verifier turned on. It's balking about trying to close an invalid socket handle. It looks like there are two copies of the same socket descriptors kept, one in the SecureSocketImpl member, which gets closed by the dtor, followed a little later by ServerSocketImpl closing.

In the debugger, I see first this:

SecureSocketImpl calls close on a SocketImpl at address 0x095fb6b0, the _sockfd member is address 0x095fb6b8 with a value of 2976

Later in the same stack as the dtors are unwinding, I see

ServerSocketImpl dtor calling SocketImpl dtor, address of this in for the SocketImpl is address 0x09604f80, _sockfd has address 0x09604f88 and again a value of 2976

App Verifier then balks with an invalid handle close exception.

So, it looks like the raw socket descriptor is being copied.

Posts: 1180
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: socket closed twice

Postby guenter » 10 Aug 2012, 07:19

Will be fixed in 1.4.4. As a workaround, explicitely close() the socket. You can also add a call to reset() to the destructor of SecureServerSocketImpl and SecureStreamSocketImpl.

Posts: 14
Joined: 23 Nov 2011, 00:39

Re: socket closed twice

Postby jengle » 10 Aug 2012, 23:12

Cool, thanks. I'll look at the workaround.

Return to “Support”

Who is online

Users browsing this forum: No registered users and 2 guests