The problem is that tcp_recv() can return -1 if the buf allocation (line
4518) fails, which happens when I try to read megabytes of data through the
socket, using binaries.
I don't have a patch available, but I suspect that adding a test for
tcp_recv would be a fix, as well as the appropriate error/clean-up handler.
I can provide test cases if requested (erlang and python). Also, I'm
referring to the latest source code R7B-1.