stack-overflow

How to debug stack-overwriting errors with Valgrind?

北城余情 提交于 2021-02-07 06:32:10
问题 I just spent some time chasing down a bug that boiled down to the following. Code was erroneously overwriting the stack, and I think it wrote over the return address of the function call. Following the return, the program would crash and stack would be corrupted. Running the program in valgrind would return an error such as: vex x86->IR: unhandled instruction bytes: 0xEA 0x3 0x0 0x0 ==9222== valgrind: Unrecognised instruction at address 0x4e925a8. I figure this is because the return jumped to

Another Quicksort stackoverflow

送分小仙女□ 提交于 2021-02-05 06:38:25
问题 So I've been trying to implement a quicksort myself, just to learn something from it, but it also generates a stackoverflowexception, but I can't seem to find what the cause is. Can someone give me a clue? public void Partition(List<int> valuelist, out List<int> greater, out List<int> lesser) { lesser = new List<int>(); // <-- Stackoverflow exception here! greater = new List<int>(); if (valuelist.Count <= 1) return; pivot = valuelist.First(); foreach (int Element in valuelist) { if (Element <

Stack Overflow Error in the constructor of a subclass [duplicate]

僤鯓⒐⒋嵵緔 提交于 2021-02-04 21:07:27
问题 This question already has answers here : Java : recursive constructor call and stackoverflow error (5 answers) Closed 2 years ago . My Superclass is: public abstract class MarketProduct { private String name; public MarketProduct(String productName) { name = productName; } public final String getName() { return this.name; } public abstract int getCost(); public abstract boolean equals(Object o); } And my subclass (up until its constructor) is: public class Egg extends MarketProduct { private

why does a function with setTimeout not lead to a stack overflow

人盡茶涼 提交于 2021-02-04 16:45:38
问题 I was writing a test for handling huge amounts of data. To my surprise, if I added a setTimeout to my function, it would no longer lead to a stack overflow (how appropriate for this site). How is this possible, the code seems to be really recursive. Is every setTimeout call creating it's own stack? Is there way to achieve this behavior (handle a huge array/number asynchronous and in order) without increasing the needed memory? function loop( left: number, callbackFunction: (callback: () =>

Circular Dependency in classes and StackOverflow Error

☆樱花仙子☆ 提交于 2021-02-04 08:41:11
问题 Though the practice that I have been following could be inappropriate. Still looking for a fix to my problem here : I'm getting a StackOverflowError :: java.lang.StackOverflowError at com.my.package.pages.Selendroid.HomePage.<init>(HomePage.java:11) at com.my.package.pages.Selendroid.LoginPage.<init>(LoginPage.java:14) at com.my.package.pages.Selendroid.HomePage.<init>(HomePage.java:11) AppiumBasePage :: public class AppiumBasePage { protected AppiumDriver driver; HomePage :: public class

StackOverFlow in recursive function C#

喜欢而已 提交于 2021-01-29 09:10:22
问题 I have this code, but there is an recursive function and i can't optimize it, that's why i always have StackOverFlow exception. Can you help me to optimize it? I use this void to get all info or to try again if some errors are found. public void Parse(byte[] data) { Socket skt = new Socket(SocketType.Dgram, ProtocolType.Udp); skt.ReceiveTimeout = 1000; skt.Connect(Encryptor.GetNextIP(), port); skt.Send(data); try { //a lot of actions to get the opcode switch (opCode) { case 0x01: p = new

Java Inconsistent Stack Overflow

流过昼夜 提交于 2021-01-28 20:06:03
问题 I've been working on my final project for my AP Computer Science class and am modifying the AP Picture Lab to do it (all of the source code is available at https://github.com/jvperrin/ap-picture-lab). For one portion of my project, I implement a depth first search to get adjacent pixels to the target pixel that are black. However, it seems like every other time I run the program I either get a stack overflow error or the program works perfectly. Is there a reason I'm getting this problem?

Concat causes stack overflow if called multiple times

断了今生、忘了曾经 提交于 2021-01-28 12:12:46
问题 Application accidentally crashed with stack overflow error. After research I found that the reason of crash is following code: foreach (var item in items) { result = result.Concat(item.Data); } This is concatenation of multiple IEnumerable s. Application crashed when items contained 10,000 elements. SelectMany fixed this issue. But still... Why Concat extension causes stack overflow here? 回答1: Remember that the result of Concat is not a collection - it's a query . So your "result" is

How to get the full stacktrace of a StackOverflowError without restarting the application

╄→гoц情女王★ 提交于 2021-01-28 11:14:31
问题 I currently hava a running Java application, which has a bug. I don't know how to fully reproduce it and it didn't happen for weeks until now. When it occurs one times, I can reproduce it over and over again easily until I restart the application. The bug causes a StackOverflowError because of a recursion and I don't know how this happens. The printed stacktrace of the StackOverflowError isn't helpful because it contains only the repeating part, but not the more insteresting initial part,

Reasons why resources in c3p0 cannot get checked out?

吃可爱长大的小学妹 提交于 2021-01-27 20:30:23
问题 So I was looking into the c3p0 API to debug one of our production issues which was resulting in a stack overflow error while checking out a connection. I found below comments in BasicResourcePool class's checkoutResource method: /* * This function recursively calls itself... under nonpathological * situations, it shouldn't be a problem, but if resources can never * successfully check out for some reason, we might blow the stack... * * by the semantics of wait(), a timeout of zero means