[issue8524] SSL sockets do not retain the parent socket's attributes

Antoine Pitrou report at bugs.python.org
Mon Apr 26 23:47:53 CEST 2010

Antoine Pitrou <pitrou at free.fr> added the comment:

> Well, at the risk of stating the obvious, perhaps the dup() thing
> should be eliminated.  The justification for it seems less than clear,
> and apparently it causes some problems.

I've just found another problem while investigating the cause of some
sporadic Windows failures:

I've reproduced it on an XP VM and the explanation is that, sometimes,
just after a dup() of a socket, calling getpeername() on the child
socket fails (while getpeername() on the parent succeeds). It seems very
timing-sensitive: if I insert enough code after the dup(), the call to
getpeername() succeeds.

I will fix the buildbot issue by using a different logic (simply, call
getpeername() on the parent rather than the child), but this seems to
confirms that dup() may not be a good idea.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list