stack-overflow

Segmentation fault in C

末鹿安然 提交于 2021-01-27 12:50:26
问题 I need to fill 2-d array with 0s. But compiled program falls with this error. What's wrong? int main() { int vert[1001][1001]; int hor[1001][1001]; int dudiag[1416][1416]; int uddiag[1416][1416]; int n, k, m; int row, col; int i, j; int answer = 0; for(i = 0; i <= 1000; i++){ for(j = 0; j <= 1000; j++){ vert[i][j] = 0; hor[i][j] = 0; } } ... } When cycle is commented out, it works properly. 回答1: The problem is that you are trying to allocate too much memory in the automatic store (AKA "on the

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

爱⌒轻易说出口 提交于 2021-01-27 12:26:55
问题 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 fact. Thanks. 回答1: From node --help : node --max-stack-size=val Update: as the comments indicate, even though the help text still lists the --max-stack-size option, in node v0.10.x you need to use --stack-size instead. node --stack-size=val 回答2:

Order of variable declaration in asm x86?

試著忘記壹切 提交于 2021-01-27 05:42:14
问题 Here the piece of code : int main() { char buffer[64]; int check; ... As you can see, check is declared AFTER buffer , so in the stack, we must have check ABOVE buffer in the stack right? However, when I disassembly (x86) it with gdb, this is what I got : --> check at 0xbffff4f8 --> buffer at 0xbffff4b8 My question : is there a specific order in the stack for local variable? Also, I have to tell you that I tried the same thing on another computer (x86 too, same gcc compilation options, but

Is there a way to increase the stack size in c#?

核能气质少年 提交于 2021-01-21 07:52:05
问题 I'm coming back to programming after having done none for several years, and created a Sudoku game to get my feet wet again. I've written a recursive function to brute-force a solution, and it will do so for simple board states, but runs into a stack overflow most of the time for more complicated board states. I know that this could be averted using loops or a more efficient algorithm, but since this is for the sake of learning I want to know how to allocate more memory to the stack

Is there a way to increase the stack size in c#?

烈酒焚心 提交于 2021-01-21 07:51:32
问题 I'm coming back to programming after having done none for several years, and created a Sudoku game to get my feet wet again. I've written a recursive function to brute-force a solution, and it will do so for simple board states, but runs into a stack overflow most of the time for more complicated board states. I know that this could be averted using loops or a more efficient algorithm, but since this is for the sake of learning I want to know how to allocate more memory to the stack

How to extend stack size without access to JVM settings?

那年仲夏 提交于 2021-01-01 08:16:24
问题 I do not have access to the JVM settings since I am submitting code to be run elsewhere, so I can't follow the other Stack Overflow answers about extending stack size. Is there any way to do it from inside my Java file? The reason I want to do this (not really important): I am using recursion on a tree with 10^5 nodes. The average case is ok, but there is no guarantee on the shape of the tree. I am dealing with an edge case where the tree is just one long line. I get a StackOverflowError, but

How to extend stack size without access to JVM settings?

天涯浪子 提交于 2021-01-01 08:15:12
问题 I do not have access to the JVM settings since I am submitting code to be run elsewhere, so I can't follow the other Stack Overflow answers about extending stack size. Is there any way to do it from inside my Java file? The reason I want to do this (not really important): I am using recursion on a tree with 10^5 nodes. The average case is ok, but there is no guarantee on the shape of the tree. I am dealing with an edge case where the tree is just one long line. I get a StackOverflowError, but

How to extend stack size without access to JVM settings?

北城以北 提交于 2021-01-01 08:13:53
问题 I do not have access to the JVM settings since I am submitting code to be run elsewhere, so I can't follow the other Stack Overflow answers about extending stack size. Is there any way to do it from inside my Java file? The reason I want to do this (not really important): I am using recursion on a tree with 10^5 nodes. The average case is ok, but there is no guarantee on the shape of the tree. I am dealing with an edge case where the tree is just one long line. I get a StackOverflowError, but

How to extend stack size without access to JVM settings?

纵饮孤独 提交于 2021-01-01 08:13:22
问题 I do not have access to the JVM settings since I am submitting code to be run elsewhere, so I can't follow the other Stack Overflow answers about extending stack size. Is there any way to do it from inside my Java file? The reason I want to do this (not really important): I am using recursion on a tree with 10^5 nodes. The average case is ok, but there is no guarantee on the shape of the tree. I am dealing with an edge case where the tree is just one long line. I get a StackOverflowError, but