Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.
0 votes
1 answer
105 views

How much stack space is required for saving the function context in Go 1.24?

How much stack space is required for saving the function context in Go 1.24? I wrote an go demo like this: func getStackUsage() { var recurse func(int) recurse = func(n int) { tmp := n ...
Kevin's user avatar
  • 47
1 vote
1 answer
31 views

Why eta-reduced of genericShow-based show definition overflows stack for recursive types

Consider the following recursive data type: data Chain a = End | Link a (Chain a) By deriving a Generic instance for this recursive type, show can be defined in terms of genericShow: derive instance ...
jfMR's user avatar
  • 25k
0 votes
0 answers
93 views

Does a local constexpr variable occupy the stack space? [duplicate]

constexpr int f(int idx) { constexpr auto arr = std::array<int, 1'000'000'000>{}; // stack overflow? return arr[idx]; } int main() { return f(1024); } Does arr occupy the stack ...
xmllmx's user avatar
  • 44.2k
0 votes
0 answers
51 views

Is there a way to make a suspension type that is stack safe in a strict language?

Suppose I were trying to build lazy datastructures in a lazy language (Im currently using Typescript, but the specific language matters little). The obvious implementation is class Lazy<T> { ...
JSONMagic's user avatar
0 votes
1 answer
141 views

Why is my vector<uint8_t>[4096] being treated like a pointer and causing a stack overflow? [closed]

I'm trying to create a simple Memory class in C++ which simulates 4096 bytes of memory using a vector<uint8_t> array. I wrote an addToMemory function that copies the contents of a vector<...
mists_of_the_unknown's user avatar
-4 votes
2 answers
211 views

Why does my recursive pow(x, n) implementation cause a stack overflow for large n? [duplicate]

I'm trying to implement a recursive power function in C++, but it fails with large n due to stack overflow. Here's the code: class Solution { public: double myPow(double x, int n) { long ...
Riya Kumari's user avatar
1 vote
1 answer
170 views

Unsolvable Stack Overflow Error in Java Spring Boot

I have this issue where, upon sending ANY request from my frontend web app (Next.js) to my backend application in Spring Boot, I get a Stack Overflow Error, and not only that, but my application ...
Sleepless's user avatar
17 votes
2 answers
2k views

Is it safe to catch stack overflows? Can it leave objects in messy/intermediate states?

I've been reviewing ways to kill threads in Java, and the overwhelming conclusion is that it is never safe to stop code at arbitrary points - doing so may leave resources in messy intermediate states. ...
Edward Peters's user avatar
4 votes
1 answer
73 views

If one thread uses a lot of stack frames, could that cause stack overflow on an "innocent" thread?

For context, I have a situation where less-than-trusted user code needs to run on a shared system. The code is subject to various static analysis passes and quality assurances, and some ways it can ...
Edward Peters's user avatar
1 vote
2 answers
133 views

Multidimensional array stack overflow in Delphi 11.3

Suddenly we faced the following problem that the allocation of the multidimensional array consumes more memory than it is required for the array itself. Minimal code to reproduce: type TConfig1 = ...
Z.B.'s user avatar
  • 1,235
19 votes
1 answer
151 views

How to implement a destructor for an n-ary graph node that won't cause a stack overflow?

I'm working on modernizing an older C++ code base that contains a simple graph structure. It originally looked like the following: struct node_value_t { ... }; struct dag_node { std::vector<...
Magnus Man's user avatar
0 votes
1 answer
49 views

What is the appropriate value of the jvm -Xss parameter?

How does the -Xss play a key role in java program? The size of the stack directly affects the program running. As I know -Xss decides the thread stack size of jvm, includ local variables, operand ...
MoXi's user avatar
  • 1
0 votes
1 answer
43 views

Assistance With Understanding Stack Over Flow Errors (Julia - GLMakie Package)

Below is my code: using GLMakie #Creation of constants a = 2 b = 5 c = 7 d = 9 # Creaiton of observables RadTheta2_2 = Observable(.523) RadTheta3_12 = Observable(-1.288) RadTheta4_12 = Observable(-2....
Volarus's user avatar
1 vote
1 answer
62 views

A lambda continuation with a generic type does not produce a stack overflow, but when I specify the type it results in a stack overflow. Why?

In a program I'm writing, I'm faced with a recursive type that I want to go through recursively (it seems necessary). Out of curiosity, I wanted to try and write a tail recursive version of my code, ...
Foxy's user avatar
  • 1,280
0 votes
1 answer
56 views

Stack Overflow on Quicksort with a first element pivot in Java

For this assignment I'm supposed to test my quicksort class using a variety of different pivots and a variety of ArrayLists in different arrangements. The class works fine with a random pivot, or a ...
Drake's user avatar
  • 19

15 30 50 per page
1
2 3 4 5
284