[PD] What exactly is a "stack overflow" ?

Martin Peach martin.peach at sympatico.ca
Mon Dec 17 20:44:41 CET 2007


The stack is a block of memory that is reserved by the cpu for saving the 
location of the next instruction to execute and register contents before 
jumping to a subroutine or interrupt handler.
It is also used to save the parameters of a function call.
When the subroutine is completed the program continues where it left off, by 
retrieving the most recently added address and register contents from the 
stack.
The cpu signals an overflow whenever the stack space runs out (the program 
tries to access the stack beyond its boundaries)
This usually occurs when the program repeatedly calls the same subroutine 
from within (recursion) and doesn't return.
In pd it usually means you have a loop somewhere, so that the output of an 
object is feeding its own input: each time a new output is calculated a new 
input is generated, so the process never ends and eventually the stack 
overflows.

Martin

David Schaffer wrote:
>To: "pd list" <pd-list at iem.at>
>Subject: [PD] What exactly is a "stack overflow" ?
>Date: Mon, 17 Dec 2007 19:47:22 +0100
>
>Can anyone explain me what a "stack overflow" error is (at least what it 
>means in Pd) and what I can do about it?! Thank you
>
>                                                                            
>                                                                            
>                       D.S
>
>
>http://www.flickr.com/photos/schafferdavid/
>http://audioblog.arteradio.com/David_Schaffer/


>_______________________________________________
>PD-list at iem.at mailing list
>UNSUBSCRIBE and account-management -> 
>http://lists.puredata.info/listinfo/pd-list






More information about the Pd-list mailing list