stack-overflow

How do you change default stack size for managed executable.net

无人久伴 提交于 2019-11-27 07:07:33
问题 We have discovered that one of our auto generated assemblies is throwing a StackOverflowException on new(). This class has (bear with me please) 400+ simple properties that are initialised (most by default(string) etc) in a constructor. We notice that its fine on 64 bits but on 32 bits it goes bang! We need to test if it's reasonable for our use case to create a larger default stack to give us breathing room while we reengineer the code generator. We would esp. interested in solutions that

Overloading Getter and Setter Causes StackOverflow in C#

£可爱£侵袭症+ 提交于 2019-11-27 07:02:05
问题 I am not sure what is causing the StackOverflowException when I try to overwrite a get and set function. When I just use the default get and set it works. enum MyEnumType { .... } public MyEnumType data { get; set; } But when I try to add additional data, it throws a StackOverflowException public MyEnumType data { get { return data; } set { data = value; } } Any ideas? When I do this for asp .net user control attributes there is no problem. I am wondering why it is causing a

Malloc segmentation fault

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 06:50:37
问题 Here is the piece of code in which segmentation fault occurs (the perror is not being called): job = malloc(sizeof(task_t)); if(job == NULL) perror("malloc"); To be more precise, gdb says that the segfault happens inside a __int_malloc call, which is a sub-routine call made by malloc . Since the malloc function is called in parallel with other threads, initially I thought that it could be the problem. I was using version 2.19 of glibc. The data structures: typedef struct rv_thread thread

How can I prevent my Ackerman function from overflowing the stack?

自作多情 提交于 2019-11-27 05:41:25
问题 Is there a way to keep my Ackerman function from creating a stack over flow is does it for relatively small numbers , i.e. (4,2). This is the error {Cannot evaluate expression because the current thread is in a stack overflow state.} private void Button1Click(object sender, EventArgs e) { var t = Ackermann(4,2); label1.Text += string.Format(": {0}", t); label1.Visible = true; } int Ackermann(uint m, uint n) { if (m == 0) return (int) (n+1); if (m > 0 && n == 0) return Ackermann(m - 1, 1); if

Java regex to match start/end tags causes stack overflow

[亡魂溺海] 提交于 2019-11-27 05:38:42
The standard implementation of the Java Pattern class uses recursion to implement many forms of regular expressions (e.g., certain operators, alternation). This approach causes stack overflow issues with input strings that exceed a (relatively small) length, which may not even be more than 1,000 characters, depending on the regex involved. A typical example of this is the following regex using alternation to extract a possibly multiline element (named Data ) from a surrounding XML string, which has already been supplied: <Data>(?<data>(?:.|\r|\n)+?)</Data> The above regex is used in with the

Why does reduce give a StackOverflowError in Clojure?

谁说我不能喝 提交于 2019-11-27 05:35:45
问题 I'm trying to concatenate a Seq of Seqs. I can do it with apply concat . user=> (count (apply concat (repeat 3000 (repeat 3000 true)))) 9000000 However, from my limited knowledge, I would assume that the use of apply forces the lazy Seq to be realised, and that doesn't seem right for very large inputs. I'd rather do this lazily if I can. So I thought that using reduce would do the job. user=> (count (reduce concat (repeat 3000 (repeat 3000 true)))) But this results in StackOverflowError

Why I'm getting StackOverflowError

安稳与你 提交于 2019-11-27 05:34:35
public class Category { private Category parentCategory; private Set<Category> childCategories; private String name; public Category() { childCategories = new HashSet<Category>(); } public Category getParentCategory() { return parentCategory; } public void setParentCategory(Category parentCategory) { this.parentCategory = parentCategory; } public Set<Category> getChildCategories() { return childCategories; } public void setChildCategories(Set<Category> childCategories) { this.childCategories = childCategories; } public String getName() { return name; } public void setName(String name) { this

android parcelable referencing another parcelable circular dependence

◇◆丶佛笑我妖孽 提交于 2019-11-27 03:27:11
问题 Rather simple scenario really, but I could not find anything related on Google so here goes: class ContainerClass implements Parcelable { List<ItemClass> _items; (...) public void writeToParcel( Parcel p, int args ) { p.writeList( _items ); (...) } } class ItemClass implements Parcelable { ContainerClass _containerRef; (...) public void writeToParcel( Parcel p, int args ) { p.writeParcelable( _containerRef ); (...) } } This will inevitably loop and overflow the stack. My question: How am I

Catching stack overflow

╄→尐↘猪︶ㄣ 提交于 2019-11-27 02:42:10
问题 What's the best way to catch stack overflow in C? More specifically: A C program contains an interpreter for a scripting language. Scripts are not trusted, and may contain infinite recursion bugs. The interpreter has to be able to catch these and smoothly continue. (Obviously this can partly be handled by using a software stack, but performance is greatly improved if substantial chunks of library code can be written in C; at a minimum, this entails C functions running over recursive data

java StackOverflowError when local and instance objects creation

女生的网名这么多〃 提交于 2019-11-27 02:18:49
Hi can anybody please explain me why is this code snippet giving me StackOverflowError I really appreciate if you can explain what is happening when instanceObj initializing and calling ObjectTest constructor and java.lang.Object constructor. It seems to me ObjectTest constructor loop over and over.But I don't know exact reason? So any suggestion... public class ObjectTest { public ObjectTest() { } ObjectTest instanceObj = new ObjectTest(); public static void main(String[] args) { ObjectTest localObj = new ObjectTest(); } } Colin Hebert Let's see what will be executed : main() create a new