Invalid Parameter warning possible in tcp.py

[email protected] Tue, 01 Sep 2009 14:32:48 -0000
Newsgroups gmane.comp.python.twisted.bugs
Message-ID <[email protected]>
New submission from my8bird <None>:

We are using wokkel (which uses twisted.words) to write an xmpp chat client.  However, when we disconnect a client from its xmpp (tcp) connection the whole thing appears to crash.  But it does not really crash instead what is happening is that google breakpad is catching an invalid parameter being passed to an os write function.  

The attached patch file shows where the issue is and a possible solution.  This solution can generate a OpenSSL.SSL.ZeroReturnError exception which can be handled either locally or by the user.

Below is a description of the method breakpad is using on windows to register to catch the invalid parameter.

MSDN - _set_invalid_parameter_handler
http://msdn.microsoft.com/en-us/library/a9yf33zb%28VS.80%29.aspx

Excerpt from MSDN:
Many C run-time functions check the validity of arguments passed to them. If an invalid argument is passed, the function can set the errno error number or return an error code. In such cases, the invalid parameter handler is also called. This function allows that handler to be set to another function. Only one function can be specified as the invalid argument handler at a time.


----------
Type     : defect
Component: core
Keywords : 
Priority : normal
Nosy     : 
----------
http://twistedmatrix.com/trac/ticket/3994