stack-overflow

AdaptRecursive StackOverflowError

半世苍凉 提交于 2020-02-25 06:35:59
问题 While compiling my project I get: The system is out of resources. Consult the following stack trace for details. java.lang.StackOverflowError at com.sun.tools.javac.code.Type$WildcardType.isSuperBound(Type.java:435) at com.sun.tools.javac.code.Types$1.visitWildcardType(Types.java:102) at com.sun.tools.javac.code.Types$1.visitWildcardType(Types.java:98) at com.sun.tools.javac.code.Type$WildcardType.accept(Type.java:416) at com.sun.tools.javac.code.Types$MapVisitor.visit(Types.java:3232) at com

StackOverflow in .NET unit testing when references are circular

做~自己de王妃 提交于 2020-01-24 13:17:18
问题 I was testing something else for circular reference resistance when I noticed: public class Foo { private Bar myBar = new Bar(); } public class Bar { private Foo myFoo = new Foo(); } [Fact] public void CircularReferenceTest() { var foo = new Foo(); var bar = new Bar(); } resulted in XUnit runner halt and console log: The active test run was aborted. Reason: Process is terminated due to StackOverflowException. I tested it on MStest and had same result. Is there a way around this? Is it a bug,

Call Stack limitation in C# [duplicate]

偶尔善良 提交于 2020-01-24 05:21:09
问题 This question already has answers here : Stack capacity in C# (5 answers) Closed 4 years ago . i wonder how much calls we can perform in stack in c# before we get stack overflow exception so i decided to write the following code static void Method2(int Calls) { if(!Calls.Equals(0)) Method1(--Calls);//if more calls remain call method1 and reduce counter } static void Method1(int Calls) { if (!Calls.Equals(0))//if more calls remain call method2 and reduce counter Method2(--Calls); } static void

Why am I getting a StackOverflow error in a long method?

匆匆过客 提交于 2020-01-23 01:05:09
问题 I have a small read-only database (based on data from services). The load time is critical so data can't be extracted from DB, XML and so on. I use the direct construction of data in the generated C# file: void Load(){ var aa = new A[ 100500 ]; aa[0] = new A( ... ); ... aa[100499] = new A( ... ); AA = aa; } There are no recursion here, stackallocks and so on. But I have got a StackOverflow error. Looking in Disassembler window I found that JIT converts this code into: var aa = new A[ 100500 ]

java stackoverflowerror thrown in infinite loop

空扰寡人 提交于 2020-01-22 02:15:30
问题 I have the following function that starts a jsvc daemon for receiving UDP messages: @Override public void start() throws Exception { byte[] buf = new byte[1000]; DatagramPacket dgp = new DatagramPacket(buf, buf.length); DatagramSocket sk; sk = new DatagramSocket(1000); sk.setSoTimeout(0); byte[] rcvMsg = null; run(sk, dgp, rcvMsg); } With a timeout of 0, the socket blocks until a another message comes in. This is what triggers the continuous run through the following while loop:

How is a StackOverflowException detected?

旧时模样 提交于 2020-01-19 06:42:10
问题 TL;TR When I asked the question I assumed a StackOverflowException is a mechanism to prevent applications to run infinitely. This is not true. A StackOverflowException is not being detected. It is thrown when the stack does not have the capacity to allocate more memory. [Original question:] This is a general question, which may has different answers per programming language. I am unsure how languages other than C# process a stack overflow. I was going through exceptions today and kept

How to bypass stack canary when exploit a stack-overflow vulnerability in user mode?

萝らか妹 提交于 2020-01-16 08:13:11
问题 In linux , there are many ways to bypass security mechanisms( like NX, ASLR) except canary. Actually, I find the stack canary is generated by the Linux kernel in /arch/arm/include/asm/stackprotector.h/boot_init_stack_canary() function.The random number is generated by extract_entropy function at last, and it's related to the environment noises such as the keyboad, the time interval of interruption. Are there any ways to bypass canary security mechanism when exploit a stack-overflow

How to avoid stack space overflows?

僤鯓⒐⒋嵵緔 提交于 2020-01-12 03:58:17
问题 I've been a bit surprised by GHC throwing stack overflows if I'd need to get value of large list containing memory intensive elements. I did expected GHC has TCO so I'll never meet such situations. To most simplify the case look at the following straightforward implementations of functions returning Fibonacci numbers (taken from HaskellWiki). The goal is to display millionth number. import Data.List # elegant recursive definition fibs = 0 : 1 : zipWith (+) fibs (tail fibs) # a bit tricky

Find the exact address of variable Buf

那年仲夏 提交于 2020-01-11 21:24:58
问题 As reference, I'm using the following code: #include <stdio.h> #include <string.h> int main (void) { char buf[100]; // ------> How do I find the address in gdb? printf ("Buffer is at memory location: %08x\n", &buf); strcpy (buf, "some random text"); printf ("Text is [%s]\n", buf); return 0; } How can I get gdb to show me the address of the buf variable? 回答1: (gdb) p &a if you need the address of variable a . A variable might be cached in a register though, in which case GDB would tell you

Find the exact address of variable Buf

冷暖自知 提交于 2020-01-11 21:17:47
问题 As reference, I'm using the following code: #include <stdio.h> #include <string.h> int main (void) { char buf[100]; // ------> How do I find the address in gdb? printf ("Buffer is at memory location: %08x\n", &buf); strcpy (buf, "some random text"); printf ("Text is [%s]\n", buf); return 0; } How can I get gdb to show me the address of the buf variable? 回答1: (gdb) p &a if you need the address of variable a . A variable might be cached in a register though, in which case GDB would tell you