Bug 64271

Summary: Executable compiled with gcc 3.1-0.25 segfaults
Product: [Retired] Red Hat Raw Hide Reporter: Peter Klotz <peter.klotz99>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-05-01 08:18:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Klotz 2002-05-01 08:17:58 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0rc1)
Gecko/20020417

Description of problem:
The attached program compiles without warnings under gcc 3.1-0.25 but the
executable segfaults immediately.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.gcc -W -Wall overflow.cpp -o overlflow
2../overflow
3.
	

Actual Results:  Segmentation fault

Expected Results:  An error during compile time about exceeding the maximum size
of local variables.

Additional info:

void f()
{
	int i[3000000];
	i[0]=3;
}

int main(void)
{
	f();
	return 0;
}

Comment 1 Jakub Jelinek 2002-05-01 11:51:14 UTC
Er, what maximum size? It is a runtime thing, how can the compiler even guess
it? Retry your program after ulimit -s 16384 and see how it works...