stack-overflow

libsigsegv and responding to a stack overflow

自作多情 提交于 2019-12-04 07:17:00
We are attempting to test student code, and in an effort to automate the process, we'd like to detect if a student's code overflows the stack. I've met with some success using the libsigsegv library and its corresponding stackoverflow_install_handler. It works brilliantly, until the student's code blows the stack twice. For example, here's some sample output: [# ~]$ ledit ./interpreter -> (use solution) -> (fun 1 2) *** Stack overflow detected *** -> (fun 1 2) Signal -10 [# ~] The initial " * Stack overflow detected * " is the desirable output. After blowing the stack for the second time, all

Which versions of GCC, or flags, should I use when studying buffer overflows?

最后都变了- 提交于 2019-12-04 06:04:05
Recently, I've been studying buffer overflows as an undergraduate student in Computer Engineering. Simply out of interest, I began researching and studying buffer overflows, but have gotten stuck when attempting to implement them in my own C programs on my computer, compiled with GCC 4.9.1 (in Debian Jessie). I've heard that there are sorts of stack overflow protection in newer compilers, so I'm thinking that my issue is that my compiler version is too new. Either that, or I'm not compiling with the correct flags (none). So are there good versions of GCC for me to obtain to test buffer

JPA: java.lang.StackOverflowError on adding toString method in entity classes

大兔子大兔子 提交于 2019-12-04 05:17:17
Everything worked fine until I added toSting() in my entity classes. After which I start getting the following error in runtime: Exception in thread "main" java.lang.StackOverflowError at java.lang.AbstractStringBuilder.append(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at java.lang.StringBuilder.<init>(Unknown Source) at entity.Guide.toString(Guide.java:51) at java.lang.String.valueOf(Unknown Source) at java.lang.StringBuilder.append(Unknown Source) at entity.Student.toString(Student.java:45) ... @Entity public class Teacher { @Id @GeneratedValue(strategy=GenerationType

Why do i get an stackoverflow error when using jackson even though using @JsonIgnoreProperties

不打扰是莪最后的温柔 提交于 2019-12-04 05:01:54
问题 I am trying to serialize a DefaultMutableTreeNode oject with jackson into a json string. Therefore i need to use a mix-in abstract class that is kind of a proxy to the DefaultMutableTreeNode class. This is probably because of self-reference fields but i am not able to recognize them. Mix-in class: @JsonIgnoreProperties(ignoreUnknown = true) public abstract class DefaultMutableTreeNodeMixIn { @JsonCreator public DefaultMutableTreeNodeMixIn(@JsonProperty Object userObject) {}; @JsonCreator

Stackoverflow exception in VS 2015 but not in VS2010 how?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 04:44:45
There is a webservice project written in VS2010 few years ago and the problem is all code exactly same (same PC , Tested with vs2010 and 2015 with the same code) but in vs2015 it gives error on debug mode. Options > "Projects & Solutions" settings are all same. I took this error and definition of it; An unhandled exception of type 'System.StackOverflowException' occurred in System.Runtime.Serialization.dll System.StackOverflowException was unhandled Message: An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll Anyone have idea about it , I'm really glad to

Java circular references

社会主义新天地 提交于 2019-12-04 04:37:19
问题 In the project im working on, people wrote services class to access DAO. Almost every business object has it's own service which use it's own DAO. On some services, we are using references to other services. At the moment, people are instantiating needed services inside the constructor. But now, I have trouble because service A needs service B and service B needs service A so a call to either constructor results in stack overflow ... Example (pseudo-code) : //Constructor of OrderService

StackOverflowException with DataGridView

爱⌒轻易说出口 提交于 2019-12-04 04:15:36
This is an odd one. I have a DataGridView . I'm setting its DataSource with a List containing objects of my own custom class. There are about 50,000 items in the list. I defined all of the columns I wanted to be visible in the Designer and set AutoGenerateColumns to false. As soon as I set the DataSource to my list, it is immediately populated correctly. I can scroll up and down, select different rows. Everything is good. But when I scroll all of the way down and then let the window containing the DataGridView lose focus everything freezes up and after a short while the stack overflows as such

How do I avoid changing the Stack Size AND avoid getting a Stack Overflow in C#

感情迁移 提交于 2019-12-04 04:11:17
I've been trying to find an answer to this question for a few hours now on the web and on this site, and I'm not quite there. I understand that .NET allocates 1MB to apps, and that it's best to avoid stack overflow by recoding instead of forcing stack size. I'm working on a "shortest path" app that works great up to about 3000 nodes, at which point it overflows. Here's the method that causes problems: public void findShortestPath(int current, int end, int currentCost) { if (!weight.ContainsKey(current)) { weight.Add(current, currentCost); } Node currentNode = graph[current]; var sortedEdges =

What is the difference between STATUS_STACK_BUFFER_OVERRUN and STATUS_STACK_OVERFLOW?

廉价感情. 提交于 2019-12-04 04:10:00
I just found out that there is a STATUS_STACK_BUFFER_OVERRUN and a STATUS_STACK_OVERFLOW. What's the difference between those 2? I just found Stack overflow (stack exhaustion) not the same as stack buffer overflow but either it doesn't explain it or I don't understand it. Can you help me out? Regards Tobias Consider the following stack which grows downward in memory: +----------------+ | some data | | +----------------+ | growth of stack | 20-byte string | V +----------------+ limit of stack A buffer overrun occurs when you write 30 bytes to your 20-byte string. This corrupts entries further

Programmatic button click throws 'System.StackOverflowException' exception

本小妞迷上赌 提交于 2019-12-04 03:52:29
I have written a WinForms program in C#.Net to click a button programmatically within a password form. Form1 loads and shows Form2 as a dialogue box. The application will close if DialogResult is anything other that DialogResult.OK. So far I have a button click event, which is coded as follows: if (txtpass.Text == "") { MessageBox.Show("You need to enter a password", "Password", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); txtpass.Focus(); } else { if (txtpass.Text == "1234") { radButton1.DialogResult = DialogResult.OK; radButton1.PerformClick(); } else { MessageBox.Show("Password Incorrect