Article ID: 000085301 Content Type: Troubleshooting Last Reviewed: 02/13/2006

Why do I get a "stack overflow" error when running my ported version of the JamTM Standard Test and Programming Language (STAPL) Player or Jam STAPL Byte-Code Player?

Environment

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Description If you get a "stack overflow" run-time error, you must tell the compiler used to compile the Jam Player source code how large the stack needs to be. Both the Jam STAPL Player, and the Jam STAPL Byte-Code Player must store at least 50,000 bytes on the stack. Some compilers make their default stack sizes smaller than this, which results in the ensuing run-time error.

Whenever any program runs, the system must provide a certain amount of physical memory, with some of this physical memory allocated for the stack. This stack memory is typically used to store the values of different program variables. Operating systems handle stack memory allocation in either of two ways: fixed stack size or dynamically allocated stack size.

In systems with a large amount of memory (e.g., systems running on Windows NT/95/98/2000 or UNIX environments), the system will usually dynamically allocate memory for the stack. Therefore, you do not need to specify the amount of the available physical memory allocated for the stack.

However, in systems with less memory (such as DOS or embedded processors with less than 64K of addressable memory), the operating system has limited memory space with which to work. Therefore, you must specify the size of the physical memory allocated for the stack, only specify what is needed for the stack. This direct specification allows you to specify only what is needed for the stack, thereby getting the best utilization of the limited memory space.

The provided PC-based and UNIX-based 32-bit implementations of the Players can dynamically allocate stack memory. The PC-based 16-bit implementation of the Players must have the stack size specified because the 16-bit DOS and Windows 3.x operating systems cannot expand the application's stack space on demand. When porting the Jam STAPL Player or Jam STAPL Byte Code Player to a specific microprocessor, compile the code with the appropriate stack memory settings.

Related Products

This article applies to 1 products

Intel® Programmable Devices