posix_memalign doesn't seem to work with malloc canaries in some allocations. This appears to be what caused the issue malloc canary failure in ruby when the page size was accidentally set to high. Example:
#include <stdlib.h>
char *malloc_options = "C";
int main(int argc, char** argv){
void *v;
posix_memalign(&v, 8192, 8192-40);
free(v);
exit(0);
}
