Is it possible to predict a stack overflow in C on Linux?
问题 There are certain conditions that can cause stack overflows on an x86 Linux system: struct my_big_object[HUGE_NUMBER] on the stack. Walking through it eventually causes SIGSEGV . The alloca() routine (like malloc() , but uses the stack, automatically frees itself, and also blows up with SIGSEGV if it's too big). Update: alloca() isn't formally deprecated as I originally stated; it is merely discouraged . Is there a way to programmatically detect if the local stack is big enough for a given