StackOverflowException even after increasing stack size

I have a C # WinForm application that I run with x86 mode. It works great with x86 mode. The problem occurs when I run this application in any processor mode. I get the following error:

An unhandled exception of type "System.StackOverflowException" occurred in XXXXXX.dll

I know this can be caused by infinite loops, and in this case in x86 mode the same error should occur. I know that this is not due to endless iterations. This has something to do with stack overflow.

After a series of studies, I increased the stack size with Editbin

from

Editbin.exe / Stack: 14000000 "$ (TargetDir) MyProject.exe"

to

Editbin.exe / Stack: 14000000 "$ (TargetDir) MyProject.exe"

Any idea what could be the reason and what directions I should deal with?

+5
4

.

.

, . .

.

, ! , !


, , , .

, , . .

, - , x86 .

. , .

, ?

, . , .

, .

, . 64- , 32- , , .

- . .

+35

- . .

+7

, , - , .

, x64, x86, , , x64, . , x86, - , , .

, , . , , . - 10 100 , , , 10000000 , .

+3
source

Can I view the stack trace?

You can read this property: Environment.StackTrace.

If stacktrace has reached the specified threshold, you can return the function. You can also try replacing some recursive functions with loops. (A StackOverflowException cannot be caught by a try-catch block if .net 2.0 or later)

+2
source

All Articles