I maintain the Fedora Clisp package. We were recently asked to compile all of our packages with what will soon be GCC 4.7, in order to find bugs. Clisp built, but failed a socket test on 32-bit x86. The current code uses a get_hostname() macro in socket.d that is unsafe. It creates a character array on the stack, saves a pointer to the first element of the array, exits the scope in which the array is defined, then accesses the (now out of scope) array via the pointer. A C compiler is free to reuse the stack space of out of scope variables, and it appears that GCC 4.7 does in fact do so, at least on 32-bit x86. This is the patch I applied to the Fedora build of Clisp in order to address this issue.
Log in to post a comment.