PROBLEM: large auto variables cause segfault under 2.6

From: Andrei A. Voropaev
Date: Tue Oct 05 2004 - 08:27:23 EST


Declaring very large auto variables cause segfaults in the program under
2.6 kernel.

Take a look at this program.

int main( int argc, char **argv )
{
unsigned char bRet = 0;

char tst[67123456];


const char* pcSupportedParams = "d:t:lV:C:cP:h";

printf("pcSupportedParams = %s\n");
return 0;
}

When compiled it produces segfault under kernel 2.6.8.1. The problem is
with that large array. Under 2.4 kernel the program gets its memory
region automatically extended to accomodate for large auto variables.
Under 2.6 it gets segment violation signal.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/