[erlang-patches] fix for ei mishandling of writev iovec buffers

Björn-Egil Dahlberg <>
Mon Sep 13 08:39:20 CEST 2010

Hi Steve,

Looks like a good and valid patch.

I'll try to sneak it past Björn and into the release (the deadline was a 
week ago).


On 2010-09-11 08:13, Steve Vinoski wrote:
> 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
> ________________________________________________________________
> erlang-patches (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:

More information about the erlang-patches mailing list