fix for ei mishandling of writev iovec buffers

Steve Vinoski vinoski@REDACTED
Sat Sep 11 08:13:43 CEST 2010


This patch fixes a data corruption problem with ei where it mishandles
iovec buffers on platforms that support writev. When writing to the
socket blocks, ei tries to adjust its iovecs based on how much data
it's already successfully written so it can pick up where it left off
when the socket is write-ready again, but it forgets to adjust one
particular pointer. The result is that the same data gets written
multiple times, corrupting what the cnode sends. This only occurs when
the message size is much greater than the amount of data ei can write
to the socket without blocking. I detected the problem when sending
large binaries from a cnode to a regular node.

git fetch git://github.com/vinoski/otp.git ei-writev

I hope it's not too late for inclusion into R14B, especially given
that the fix is so simple and obvious.

--steve


More information about the erlang-patches mailing list