This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

getsockname / recvfrom bug (?)


Having changed the socket code to use recvfrom, I've now found an
apparent bug whereby recvfrom will fail with WSAEINVAL.  This was
already a problem in cygwin (AFAICT) but my change to make all
reads use recvfrom has made it potentially more troublesome.
(Interestingly, I see the same problem with getsockname but not,
e.g., with recv, or send, or sendto even).

Anyhow the problem occurs if you dup(2) a socket and then operate
on the duplicate copy w/o closing the original socket and without
forking; i.e. it's unlikely that anything will be affected since
dup'ing a socket is normally followed by one or both of those two
actions, and then the bug doesn't show.

I'm just writing a raw winsock2 program to check what's going on
but I thought I'd bring it to Chris and Corinna's attention
particularly, in case they'd rather not release that last patch of
mine until I've found some workaround.  As I said, it's not a new
bug and it's only exposed under slightly wierd circumstances, but
I've made it a little more likely to happen.

As soon as I've any more information on this, I'll get back to the
list.  BTW, if this is a "well known" problem, I'd be interested
in that information too (and yes, I''ve checked the mailing list
archives to no avail as yet).

Cheers,

// Conrad




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]