[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tkgnats/142: Stack overflow

From: zhenchen
Subject: tkgnats/142: Stack overflow
Date: 7 Feb 2001 00:19:33 -0000

>Number:         142
>Category:       tkgnats
>Synopsis:       Stack overflow
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    rickm
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 06 16:24:00 PST 2001
>Originator:     address@hidden
>Release:        GUN CC 2.7.2
VxWorks RTOs, Tornado on Windows98. 
I am having a stack overflow problem when my C++ program is compiled and linked 
using GCC and ld.  The problem was not there when the same program is compiled 
using a different compiler.

The GCC version is 2.7.2
Compile and link with no errors.

Description of the problem:
When a class has a data member that is an array of another class (composition), 
the memory is reserved on the stack instead of heap when the class is 
constructed.  The size of the memory is equal to the size of the array * size 
of the class which is larger than the stack size.

As I understand that the data members that declared in the class header file 
will live in the heap,  and stack is a working storage for the task which backs 
up the register values and addresses if the interrupt occurs.  When the class 
is instantiated, stack should be empty.

Your help will be appreciated.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]