This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients bryangeneolson, eryksun, neologix, paul.moore, pitrou, python-dev, serhiy.storchaka, steve.dower, tim.golden, vstinner, zach.ware
Date 2015-07-27.21:46:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438033582.74.0.585198275518.issue24732@psf.upfronthosting.co.za>
In-reply-to
Content
> According to hg bisect: (...)
> summary:     Issue #23834: Add sock_call() helper function

Oh, I'm not too surprised. I had to modify _deeply_ socketmodule.c to implement the PEP 475. I stressed the code on Linux, but on Windows I only ran Python test suite and asyncio test suite.

The surprising part is that the bug was not detected by any test :-(

We need at least one more unit test for it.

> The problem starts earlier in sock_accept_impl. This function checks whether SOCKET_T ctx->result is non-negative to determine whether the accept call succeeded, but SOCKET_T is unsigned on Windows.

Thanks, good analysis. I checked accept() documentation and Python 3.4 source code: yeah, we must check for INVALID_SOCKET. It's a dummy copy/paste failure. I copied the code from another sock_xxx_impl() function, and I didn't notice that the error condition is different for accept(). The code fails in some cases on Windows, but not always. Maybe only on 64-bit?

> My system according to Python:
> ...
> '3.5.0b3 (default, Jul  5 2015, 07:00:46) [MSC v.1900 64 bit (AMD64)]'

My Windows is also 64-bit but my Visual Studio version (2010 Express) was limited to 32-bit :-(

Right now, I cannot develop on Windows: Visual Studio 2010 doesn't want to compile Python anymore (issue #24737). I'm downloading Windows 8.1 and I will try Visual Studio 2015. So I pushed a fix without being able to test it :-(
History
Date User Action Args
2015-07-27 21:46:22vstinnersetrecipients: + vstinner, paul.moore, pitrou, tim.golden, neologix, python-dev, zach.ware, serhiy.storchaka, eryksun, steve.dower, bryangeneolson
2015-07-27 21:46:22vstinnersetmessageid: <1438033582.74.0.585198275518.issue24732@psf.upfronthosting.co.za>
2015-07-27 21:46:22vstinnerlinkissue24732 messages
2015-07-27 21:46:22vstinnercreate