Questions tagged [callstack]

A stack that stores details of the functions called by a program in sequence, so that each function can return on completion to the code that called it.

A call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, control stack, run-time stack, or machine stack, and is often shortened to just "the stack".

A call stack is used for several related purposes, but the main reason for having one is to keep track of the point to which each active subroutine should return control when it finishes executing. An active subroutine is one that has been called but is yet to complete execution after which control should be handed back to the point of call. Such activations of subroutines may be nested to any level (recursive as a special case), hence the stack structure.

Source: Wikipedia (Call Stack)

For errors relating to overflowing the call stack use .

1119 questions
81
votes
5 answers

"RangeError: Maximum call stack size exceeded" Why?

If I run Array.apply(null, new Array(1000000)).map(Math.random); on Chrome 33, I get RangeError: Maximum call stack size exceeded Why?
Fabrizio Giordano
  • 2,941
  • 4
  • 20
  • 16
77
votes
7 answers

How to print call stack in Swift?

In Objective-C, you can print the call stack by doing the following: NSLog(@"%@", [NSThread callStackSymbols]); How do you do this in Swift without using Foundation class?
Boon
  • 40,656
  • 60
  • 209
  • 315
74
votes
8 answers

How can I get a call stack listing in Perl?

Is there a way I can access (for printout) a list of sub + module to arbitrary depth of sub-calls preceding a current position in a Perl script? I need to make changes to some Perl modules (.pm's). The workflow is initiated from a web-page thru a…
slashmais
  • 7,069
  • 9
  • 54
  • 80
73
votes
2 answers

GAS: Explanation of .cfi_def_cfa_offset

I would like an explanation for the values used with the .cfi_def_cfa_offset directives in assembly generated by GCC. I know vaguely that the .cfi directives are involved in call frames and stack unwinding, but I would like a more detailed…
void-pointer
  • 14,247
  • 11
  • 43
  • 61
66
votes
4 answers

What are the ESP and the EBP registers?

I found that the ESP register is the current stack pointer and EBP is the base pointer for the current stack frame. However, I don't understand these definitions (I am just starting to learn how to code in assembler). What I understand is that ESP…
Lucas Alanis
  • 1,208
  • 3
  • 15
  • 30
65
votes
2 answers

How can I increase the maximum call stack size in Node.js

This is different to other questions regarding an error message in Node that reads RangeError: Maximum call stack size exceeded in that I know exactly why I'm getting this error message. It's happening because I'm recursing, recursing quite a lot in…
thomas-peter
  • 7,738
  • 6
  • 43
  • 58
56
votes
4 answers

Why does the stack address grow towards decreasing memory addresses?

I read in text books that the stack grows by decreasing memory address; that is, from higher address to lower address. It may be a bad question, but I didn't get the concept right. Can you explain?
Jestin Joy
  • 3,711
  • 4
  • 19
  • 14
51
votes
2 answers

explanation about push ebp and pop ebp instruction in assembly

i used stack in assembly but i didn't got idea about push ebp and pop ebp. .intel_syntax noprefix .include "console.i" .text askl: .asciz "Enter length: " askb: .asciz "Enter breadth: " ans: .asciz "Perimeter = " _entry: push…
bunty
  • 2,665
  • 8
  • 30
  • 27
45
votes
4 answers

What is the difference between Call Stack and Stack Trace?

What is the difference between the terms "Call Stack" and "Stack Trace" ?
pencilCake
  • 51,323
  • 85
  • 226
  • 363
44
votes
3 answers

Does Chrome have a built-in Call Stack?

From Visual Studio, I'm accustomed to a call stack showing up at any breakpoint. Does Chrome have a call stack feature where I can see what functions preceded my breakpoint? If not, is there a substitute (3rd party solution that works with Chrome?)…
Danny
  • 3,670
  • 12
  • 36
  • 45
42
votes
5 answers

What is the use of -fno-stack-protector?

I have written an application in C, and I'm trying to understand what is the purpose of the -fno-stack-protector command when compiling. For my specific application, it makes no difference if I use this command or not in terms of protecting against…
touvlo2000
  • 505
  • 1
  • 5
  • 9
41
votes
2 answers

What is the purpose of the _chkstk() function?

I recently used the /FAsu Visual C++ compiler option to output the source + assembly of a particularly long member function definition. In the assembly output, after the stack frame is set up, there is a single call to a mysterious _chkstk()…
Daniel Trebbien
  • 38,421
  • 18
  • 121
  • 193
39
votes
2 answers

How to filter call stack in Eclipse debug view for Java

While debugging, the Debug view in Eclipse shows the call stack. Which is great. But I'd love to be able to filter out all the call that I definitely don't care about, such as Spring and the JUnit runner. Here's an example of my call stack right…
espinchi
  • 9,144
  • 6
  • 58
  • 65
35
votes
7 answers

Checking stack usage at compile time

Is there a way to know and output the stack size needed by a function at compile time in C ? Here is what I would like to know : Let's take some function : void foo(int a) { char c[5]; char * s; //do something return; } When…
shodanex
  • 14,975
  • 11
  • 57
  • 91
34
votes
10 answers

Why does the Mac ABI require 16-byte stack alignment for x86-32?

I can understand this requirement for the old PPC RISC systems and even for x86-64, but for the old tried-and-true x86? In this case, the stack needs to be aligned on 4 byte boundaries only. Yes, some of the MMX/SSE instructions require 16byte…
Allen Bauer
  • 16,657
  • 2
  • 56
  • 74
1
2
3
74 75