This looks to be a problem of Linux 3.12 and later commit 1661bf364ae9c506bc8795fef70d1532931be1e8 Author: Dan Carpenter <dan.carpenter / oracle.com> Date: Thu Oct 3 00:27:20 2013 +0300 net: heap overflow in __audit_sockaddr() I'm inclined to believe Ruby is incorrect for using a gigantic placeholder value. Ruby started using a gigantic buffer since r39529 (so no stable releases). * ext/socket/rubysocket.h (union_sockaddr): make it longer for SunOS and Darwin. The following is a dirty workaround, but I don't think it's sufficient since SunOS and Darwin could be affected by the same heap overflow in which was in Linux. --- a/ext/socket/rubysocket.h +++ b/ext/socket/rubysocket.h @@ -194,7 +194,9 @@ typedef union { struct sockaddr_dl dl; /* AF_LINK */ #endif struct sockaddr_storage storage; +#ifndef __linux__ char place_holder[2048]; /* sockaddr_storage is not enough for Unix domain sockets on SunOS and Darwin. */ +#endif } union_sockaddr; #ifdef __APPLE__