Questions tagged [stackoverflow]

Stack overflow is a situation when the stack is full and any item that is pushed onto it will not be incorporated and will cause stack overflow to occur. This is NOT about the website StackOverflow.com.

Filter by
Sorted by
Tagged with
-2
votes
0answers
122 views

Why integer overflow not cycling? [on hold]

Imagine we have 8-bit integer. So we can store integers from -128 to 127. so if we append 2, it will cause Arithmetic operation '127 + 2' (on type 'Int8') results in an overflow. Since the very left ...
2
votes
2answers
351 views

How do I prevent stack overflows from happening in this command structure with callbacks?

I have a set of jobs that I need executed. The entity that manages these jobs is responsible for composing the jobs and starting them. When a job is finished, the job uses a callback function to ...
6
votes
2answers
627 views

Ensure that callbacks registration and triggering don't cause infinite recursion

I just spent a long, miserable week debugging a stack-overflow in a C++/Qt application. The fundamental problem was that I had a function that accepted a callback, and in certain cases the callback ...
15
votes
4answers
14k views

How much stack usage is too much?

Lately when I've been writing C or C++, I'll declare all my variables on the stack just because it's an option, unlike with Java. However, I've heard that it's a bad idea to declare large things on ...
-2
votes
1answer
1k views

stack based vs heap based overflow [closed]

Why is it more difficult to perform a heap based buffer overflow than a stack based? (regarding x86 architecture) I thought it could be the fact that heaps are allocating memory dynamically. But is ...
3
votes
1answer
1k views

Structure of stack of a function call

I've been reading Aleph One's paper on Smashing the Stack for Fun and Profit. I wrote down example1.c from his paper, modified it a bit to see what the stack looks like on my system. I'm running ...
1
vote
1answer
2k views

What happens when both heap and stack are full?

Suppose I am using a very heavy applications(or you can say that it is a very bad code which keeps on allocating memory on heap and won't free it and also uses recursion) Now after some point of time ...
13
votes
4answers
2k views

When there's no TCO, when to worry about blowing the stack?

Every single time there's a discussion about a new programming language targetting the JVM, there are inevitably people saying things like: "The JVM doesn't support tail-call optimization, so I ...
27
votes
2answers
6k views

Is it *ever* okay to catch StackOverflowError in Java?

I used to think that it's not, but yesterday I had to do it. It's an application that uses Akka (an actor system implementation for the JVM) to process asynchronous jobs. One of the actors performs ...
4
votes
6answers
10k views

Heap overflow vs stack overflow

So as a general rule to avoid a stack overflow, big objects should be allocated to the heap (correct me if I am wrong). But, since the heap and the stack expand towards each other, wouldn't this cause ...
15
votes
3answers
6k views

How many are too many nested function calls?

Quoted from MSDN about StackOverflowException: The exception that is thrown when the execution stack overflows because it contains too many nested method calls. Too many is pretty vague here. How ...
23
votes
1answer
2k views

How often is seq used in Haskell production code?

I have some experience writing small tools in Haskell and I find it very intuitive to use, especially for writing filters (using interact) that process their standard input and pipe it to standard ...