c++,linked-list,stack-overflow,mergesort
So you have three recursive functions. Let's look at the maximum depth of each with the worst case of a list of 575000 elements: merge(): This looks to iterate over the entire list. So 575000 stack frames. split(): This looks to iterate over the entire list in pairs. So ~250000...
You have a StateListDrawable i.e. a drawable selector resource that seems to refer to itself and hence cause infinite recursion when inflated.
Nothing seems wrong with your code but bear in mind that this is a recursive function and most languages have a limited-depth stack which you are bound to get to if you have an input large enough. For Java, see: What is the maximum depth of the java call stack?...
You forgot the return result; in this piece of code: // if there is only one element arr= {1} if (low == high) { result.min = arr[low]; result.max = arr[high]; return result; } ...
The cause of Stack overflow is in the 1st line: private void getNextTrack() { int currentTrack = new Random().Next(1, 30); // <- That's the cause if (playlist.Contains(currentTrack) ...) getNextTrack(); you re-create Random each time you call the method and since Random initializes from the system timer it returns the same...
c#,entity-framework,stack-overflow
As @Ben suggested, you have a circular reference: ClientDto contains a collection of ReservationDto's, each of them, in turn, contains back reference to its ClientDto owner. You may check out this question for some ideas on how to deal with circular references with Automapper....
php,forms,session,stack-overflow
Many different methods of storing values in that manner where they can be retrieved at many times. Most of them differ on which case you are using them. Let me list a few of my favorites: Could be cookies, as cookies can be implemented in both JS and practically any...
Looks like this was due to my misunderstanding of AbstractList.SubAbstractList (subList). A subList returns a view of the list, not a new list. I was performing this operation on different subLists obtained from the same full list.
c#,.net,stack-overflow,.net-4.5.2
I assume this code tries to collect the ItemOrder values of Page objects starting from the bottom of a tree or path and working up to the root The code is buggy though and will fail if there are any circles in the path, ie the path A -> B...
c,linux,gcc,recursion,stack-overflow
You can change the stack size with ulimit on Linux, for example: ulimit -s unlimited On Windows with Visual Studio, use /F option....
try { var _run = new Run() } catch (Exception ex) { //serialize your erorr } finally { //impossible but still if (_run != null) { //serialize _run } } If you object fails to created you cannot serialize null object....
c++,loops,recursion,structure,stack-overflow
PROBLEMDon't create runner r1; inside constructor it would lead to infinite recursion. SolutionYou can make r1 as static or a reference to already existing object. runner &r1 = *this; for example....
stack,fortran,heap,stack-overflow,reshape
The Fortran standard does not speak about stack and heap at all, that is an implementation detail. In which part of memory something is placed and whether there are any limits is implementation defined. Therefore it is impossible to control the stack or heap behaviour from the Fortran code itself....
This is a bit of a bug, the problem is that the child still is present in the MDIParent1.MdiChildren collection when the FormClosed event fires. In other words, the FormClosed event fires a little too soon. So when you close the parent, it will try to close the child again....
java,image-processing,processing,stack-overflow
If you're just asking if there's a way to set the stack size, then google is your friend. Processing is written in Java, so googling things like "java set stack size" would be a good place to start. In fact, the question has been asked on StackOverflow multiple times: How...
java,recursion,iteration,stack-overflow
You can always avoid a recursion by using a Stack : instead of making a recursive call to searchNeighboringPixels(x, y, arr), put the point (x,y) in a Stack. wrap your 4 conditions with a while loop, which runs until the Stack is empty. each iteration pops the top of the...
c++,runtime-error,stack-overflow,delete-operator
Your original version does not assign i to an address. It allocates a new int on the heap and initializes its value to 5, then copies that value into i which is on the stack. The memory that you allocated (new'ed) is inaccessible and gets leaked. The reference version works...
Because you force the evaluation to the recursive fibonacci call immediately. In other words you need to create a lazy generator instead, either by using a method such as continually or by mapping on the tail. Scaladoc actually have a good example for how to create a fibonacci stream here:...
you are recursing without putting the current array cell to null, which leed to an infinite recursion. you should mark the current cell as visited before doing floodFill(X, Y); Also you better track the visited cell with another array markVisited, rather than making the current cell to null Here is...
c#,visual-studio,stack-overflow,html-agility-pack,stack-frame
There is no apparent feature as to restrict the stack size of the CLR application or increase Visual Studio's tracked stack frame count. As a solution I'll just give up on HtmlAgilityPack to extract the text (things like this aren't really solutions) and write myself an old fashioned HTML to...
java,recursion,bukkit,stack-overflow
It looks like s.hasPlayer() is always true, making it so: if(s.hasPlayer()){ spawnPlayer(p); } gets executed inside of the spawnPlayer(Player) method, which therefor causes the method to run infinitely, causing the StackOverflowError. To fix this, you could wait before calling spawnPlayer(p): if(s.hasPlayer()){ long timeToWait = 20L;//set the time to wait to...
security,stack-overflow,exploit,seh,hacking
It depends what is the vulnerability and what are the exploit conditions. If you can overwrite the RET and build a full blown exploit than you are correct and overwriting the SEH would is unnecessary. But this is not always the case .. In some cases RET overwrite protections will...
c#,asp.net,stack-overflow,dispose
You are calling the same method from inside the Dispose method. This will indeed cause a StackOverflowException. I do wonder if you really need to implement IDisposable and if you understand its purpose... If you really need to: Give a meaningful implementation of Dispose, free unmanaged resources, etc; Use using...
The first instruction jumps to the call at the end of the code which calls back to the second instruction that pops the return address placed on the stack by the call. Thus esi points to the string at the end. As you can see, the next 3 instructions write...
It seems that the Java regular expression engine is recursion-based. That means that the regular expression has to be optimized to produce fewer backtrackings. Yet I cannot see which backtracking produces this call stack. Following proposals work for larger comments: Pattern.compile("(/\\*.*?\\*/)", Pattern.DOTALL) (matches only /* .. */) Pattern.compile("(/\\*([^\\*]|(\\*(?!/))+)*+\\*+/)|(//.*)") Explanation: (.|...
java,recursion,stack-overflow,path-finding
It's hard to say with the given code, but three things come to mind: Did you make sure to add C and all the other data? Are those extra spaces around " C" and "# " supposed to be there? Why did you convert [] to + and then to...
c#,xaml,silverlight,controls,stack-overflow
I stumbled upon that splendid effect myself, and as it turned out: You can't instantiate an object derived from UIElement (your line <local:Control1/> tries exactly this) in a ResourceDictionary (and generic.xaml is one), because all objects in said dictionary must be shareable. Documented here. Relevant section: Shareable Types and UIElement...
Enums won't cause a stack overflow. But this will: get { return Class; } Your getter for Class returns Class. Which is an infinite recursion. You probably want to store the value in a backing variable: private Class _class; public Class Class { get { return _class; } set {...
c++,segmentation-fault,stack-overflow
Sort Tables[20]; most probably exceeds your available stack size with N = 30000. You may try to allocate an appropriate vector from the heap instead: std::vector<Sort> Tables(20); ...
java,inheritance,jpanel,stack-overflow
In main() your creating instance of class OtherThing. Default constructor of class OtherThing gets invoked, where your creating instance of class OtherOtherThing. EDIT public class OtherOtherThing extends OtherThing { public OtherOtherThing() { super();//Added by compiler, invokes constructor of OtherThing } } So for each new instace of OtherOtherThing a new...
c#,.net,stack-overflow,dllimport
__declspec(dllexport) int __cdecl NativeTestFunction(int a, char* b, int c, int d) Note the type of b. It is char*. Then in the C# code you write: [DllImport("Native.dll", EntryPoint = "NativeTestFunction"), SuppressUnmanagedCodeSecurityAttribute] static extern int NativeTestFunctionSuppressed(int a, int b, int c, int d); Here you declare b to be int. That...
This is produces a stack-overflow, because there is a recursive call on the hour, when you try to get it. Here t.hour, you try to get the value of hour. This we call the getter, which returns hour / 3600. This will call again the hour and so on and...
java,constructor,stack-overflow
I suspect you have member variables declared in which List constructs an ST and ST also constructs a List. Even though your List constructor doesn't show the creation of an ST, if it's a member variable which creates an ST, it is effectively added to the top of the constructor....
javascript,node.js,recursion,stack-overflow,async.js
I feel like I need to design some sort of solution to this problem using tail recursion, but I'm not sure if v8 will even optimize for this case, or if it's possible given the problem. The continuation-passing-style you are using is already tail recursive (or close to anyway)....
entity-framework,azure,code-first-migrations,stack-overflow
This is identified as a bug in Microsoft Visual Studio 2013 Update 4. As a temporary work around disable "Lazy Initialization" under IntelliTrace Settings -> IntelliTrace Events. We are investigating fixing this bug in a future update for Visual Studio 2013.
EDIT: Added break, in case no condition is true. Instead, rewrite the function using a loop. Additionally, you can simplify your logic somewhat. Note: the assumption that both leftIndex and rightIndex are greater than 0 persists. private void ShowDiff(int leftIndex, int rightIndex) { while(leftIndex > 0 && rightIndex > 0)...
The problem with your code is that an expression like repeat' 3 will be evaluated like this repeat' 3 ++ [3] repeat' 3 ++ [3] ++ [3] repeat' 3 ++ [3] ++ [3] ++ [3] leading to a blowup of stack space. The reason why it is evaluated like that...
You didn't define the methods of the instance. The default for show uses showPrec (via shows) and the default for showPrec uses show. So you have a cyclic definition which will clearly overflow the stack eventually. Perhaps you intended to derive an instance? Prelude> data ImNewToHaskell = AndWhatIsThis deriving (Show)...
image,upload,stack-overflow,posting
In order to add an image to a question follow the steps below: Click the Insert Image toolbar button which I circled with a red line Select an image from your computer, or the web Click Add picture ...
You have a field initialization code which is automatically added to the constructor body by javac compiler. Effectively your constructor looks like this: private Reluctant internalInstance; public Reluctant() throws Exception { internalInstance = new Reluctant(); throw new Exception("I’m not coming out"); } So it calls itself recursively....
insert,stack-overflow,binary-search-tree
Have you searched on Stack Overflow? :p Just kidding. The issue probably is the recursive call. A function call uses the stack to store register values, which are only removed from there if the called function ends and control is returned to the calling function. For recursive calls, all those...
jsf,jstl,stack-overflow,composite-component,nesting
The problem was in the context of the #{cc} and the statefulness of the composite attribute. The #{cc} in any attribute of the nested composite references itself instead of the parent. The attribute being stateful means that the #{cc} was re-evaluated in every child which in turn ultimately references itself...
stack-overflow,automapper,azure-mobile-services
The stackoverflowexception is caused by a recursive loop, that is two navigation properties referring to each other. I had the same problem in my many to many relationseship. I fixed it by removing the navigation property (list) on one of the entities and instead did the many to many mapping...
c++,multithreading,stack-overflow,daemon
while (true) { func1(); boost::this_thread::sleep(boost::posix_time::seconds(3)); func2(); boost::this_thread::sleep(boost::posix_time::seconds(3)); } Would be the simplest thing that comes to mind...
That's what happens when a method calls itself recursively infinite number of times. Each call creates a new stack frame, until the stack overflows.
c#,properties,stack-overflow,bubble-sort,generic-list
public List<Person> TheList { get { return TheList; } set { TheList = value; } } This setter refers to itself. Any attempt to read or write to it will cause an infinite recursion....
haskell,recursion,stack-overflow,guard
Function application has higher precedence than many other operations, so foo 3 * x + 1 is actually calling foo 3, then multiplying that result by x and adding 1, which looks like where your infinite loop might be. Changing it to the following should fix that: | odd x...
According to MSDN: Starting with the .NET Framework 2.0, you can’t catch a StackOverflowException object with a try/catch block, and the corresponding process is terminated by default. Consequently, you should write your code to detect and prevent a stack overflow. In this case, it means you should actively prevent the...
java,recursion,stack-overflow,maze
I think there is no bug as such (not that I can see) but you are recursing way too much which caused this issue. I am not sure what values are you feeding into the program, but I was able to notice the issue with initializing the above program with...
c,memory,heap,stack-overflow,hacking
There are two main approaches for finding stack buffer overflows: Black box testing The key to testing an application for stack overflow vulnerabilities is supplying overly large input data as compared to what is expected. However, subjecting the application to arbitrarily large data is not sufficient. It becomes necessary to...
javascript,node.js,recursion,stack-overflow,tail-recursion
If you had a function that called itself synchronously, say, 200k times, the code will exit with error due to the stack being too deeply nested. process.nextTick avoids that similar to the way setTimeout(fn,0) will by clearing the callstack on each iteration. It simply defers the execution of the passed...
methods,palindrome,stack-overflow
Complementing Ransom's point, the comparison s.charAt(n-1) == s1.charAt(n-1) will always return true. Try to construct the recursive algorithm like this: check(s){ // insert code: if length is 0 or 1, always return true; if(s.chatAt(0) == s.charAt(s.length-1)) return check(s.subString(1,length-1)) } The key points are: For a recursive algorithm, you cannot put...
java,swing,graphics,stack-overflow,imageicon
The problem is that you have infinite recursion in your constructors. Layout() calls addKeyListener(new Move());, and Move extends Layout, so Move's constructor also calls Layout(), which in turn calls Move(). You need to refactor your code to avoid that. A simple approach would be making Move not extend Layout, and...
I fixed the error by removing all the runOnce stuff in the testing class and change the button clicked code to testing s = new testing(); s.setVisible(true); setVisible(false);
equals method of Vertex class contains : if(!(this.pointers.get(i).equals(newVertex.getPointers().get(i)))) where this.pointers.get(i) is a Connector, so equals of Vertex calls equals of Connector. equals of the Connector class contains : return ((this.getStart().equals(newConnector.getStart())) && (this.getEnd().equals(newConnector.getEnd())) && (this.getElement().equals(newConnector.getElement()))); And since getStart() and getEnd() are of type Vertex, this means equals of Connector is calling...
c#,multithreading,exception,stack-overflow
Listen() is calling itself which will eventually result in a stack overflow. Simply remove the call to Listen() at end of the while loop....
r,segmentation-fault,stack-overflow,cox-regression
I am able to make a Poisson model with that dataset. (I've got a large dataset that I'm unwilling to risk a probable segfault on.) fit <- glm( I(status == 0) ~ litter +offset(log(time)), data = data, family=poisson) > fit Call: glm(formula = I(status == 0) ~ litter + offset(log(time)),...
java,recursion,stack-overflow,binary-search
} else if (sArray.get(mid).compareTo(key) > 0) { return bSearch(sArray, key, lowIndex, mid + 1); } else { return bSearch(sArray, key, mid - 1, highIndex); } This would stuck when key cannot be found. It should be } else if (sArray.get(mid).compareTo(key) > 0) { return bSearch(sArray, key, lowIndex, mid - 1);...
android,math,methods,stack-overflow
Your code is going into an infinite loop because you are changing the text when afterTextChanged() is called, which causes afterTextChanged() to be called again and so on until eventually you overflow your call stack. You can stop this by only setting the text inside updateVincite() and updateContanti() if it...
httprequest,stack-overflow,bandwidth,diskspace
^---Is this the number of times the website is visited overall in a day? That means there's literally 148 million visits to the site in a day? No, that's the total amount of requests. Take into account that a single page normally performs many requests (css files, js files,...
java,recursion,iteration,stack-overflow
In Java, each method call puts an activation record on the stack until it is completed. Recursion incurs as many activation records as method calls are made. Thus, a recursive algorithm cannot run indefinitely deep, as compared to an iterative design which under the hood essentially uses goto statements; thus...
Stack overflows I'll make it easy for you; but this is actually quite complex... Note that I will generalize quite a bit here. As you might know, most languages use the stack for storing call information. See also: https://msdn.microsoft.com/en-us/library/zkwh89ks.aspx for how cdecl works. If you call a method, you push...
Your recursion does not appear to have a termination condition. It looks like you may want to pass strength as an argument to findEscapeSpace(), and when that method recurses for it to pass a value one less than the one passed to it. Other than that, your algorithm looks fairly...
postgresql,triggers,stack-overflow,postgis
The problem here is that you have a BEFORE UPDATE trigger on a table that has a statement to update the same table: recursion. After a while there are so many triggers waiting for the EXECUTE statement to finish (each invoking the same trigger function) that the stack is filled...
java,class,instance,stack-overflow
You have class CalculatorGUI { KeyHandler keyboard = new KeyHandler(); } class KeyHandler { CalculatorGUI elo = new CalculatorGUI(); } Creating a new CalculatorGUI creates a new KeyHandler, which creates a new CalculatorGUI, which creates a new KeyHandler, which creates a new CalculatorGUI, which creates a new KeyHandler, which creates...
java,android,stack-overflow,logcat
Yout problem is here: @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main_activity_actions, menu); return onCreateOptionsMenu(menu); //<--- conflicting line } Change return onCreateOptionsMenu(menu); to return true; Hope it helps...
java,stack-overflow,binary-search-tree
The reason that you encountered a StackOverflowError is that you inserted your items in an order that was already sorted. Let's see what happens in this case. I'll use integers, even though you have more complicated objects, for simplicity in seeing what happens. After inserting 1: Root(1) After inserting 2:...
python,logging,rotation,handler,stack-overflow
I found the error, actually the emit is called by the logger so you just need to add the handler using streamlogger.addHandler. The updated code __author__ = 'Girish' import logging import sys import traceback import logging.handlers class StreamToLogger(object): def __init__(self, logger, log_level, std): self.logger = logger self.log_level = log_level self.linebuf...
c++,runtime-error,stack-overflow,destructor,unhandled-exception
new Element called, therefore owned by List, so only List can delete Element. List_iter doesn't require a destructor because it only contains a pointer.
Why, if there is not significant overload of CIL's stack for second example, does it crash "faster" than the first one? Note that the number of CIL instructions does not accurately represent the amount of work or memory that will be used. A single instruction can be very low...
c++,recursion,stack,heap,stack-overflow
If you must use recursion, then put those recyclable variables inside a struct, and pass that reusable struct instance (instantiated at the outermost layer of recursion) by reference to your recursive calls.
This thread on the Syncfusion support forum suggests that the issue is caused by having unobtrusive validation enabled. If you can disable it, that might be your best bet. Otherwise, they propose this rather verbose workaround: @(Html.EJ().Schedule("Schedule1") .Width("100%") .Height("525px") .CurrentDate(new DateTime(2014, 6, 1)) .ScheduleClientSideEvents(even=>even.CellClick("onCellQuickWindowClose").AppointmentClick("onAppQuickWindowClose")) .CategorizeSettings(Fields =>...
You wrote the address of the function hello to the stack of foo 90 times beyond the amount of space you reserved with buf. When foo tried to return, it loaded (one of) the first extra address(es) of hello into the program counter, popped it, and "returned" to it. The...
java,image,exception,awt,stack-overflow
The StackOverFlowError is caused by the recursive call (which isn't even necassary). The cause for the error is pretty simple: for every element in the stack, the algorithm makes another recursive call. If the area of black pixels is large enough, the number of adjacent black pixels will exceed the...
java,stack-overflow,jvm-arguments
Try using RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); List<String> args = runtime.getInputArguments(); This should give you the arguments that were passed to the JVM when it was created....
java,connection,stack-overflow,connection-pooling,c3p0
So, although it's a reasonable guess, mere pool exhaustion (what happens if you leak or forget to close() Connections) won't lead to the stack overflow. The stack overflow occurs when checkoutResource(...) finds a Connection available to check out, and "preliminarily" checks it out; then something goes wrong, indicating that the...
javascript,asynchronous,callback,settimeout,stack-overflow
I think what you need to do is call the reload function inside the callback function itself. If you're using jQuery for the ajax function, the code could look something like this: function loadContent(){ $.getJSON("yourURL", callback) } function callback(data){ /*do something with the data*/ /*call loadContent at an interval */...
java,algorithm,data-structures,stack-overflow,quicksort
In your partition method you sometimes use a element outside the range: String string1 = data.get(firstIndex); String string2 = data.get((firstIndex + (numberToPartition - 1)) / 2); String string3 = data.get(firstIndex + numberToPartition - 1); (firstIndex + (numberToPartition - 1)) / 2 is not index of the middle element. That would...
recursion,clojure,stack-overflow
One solution I have for this problem is to use gensym to get a new symbol for each version of the macro, this would work by modifying the getfn as follows: (defmacro getfn [namestr children] `(let [fn-name# (gensym)] (fn fn-name# [] (println "Recursing" ~namestr) (doall (map (fn [child#] (child#)) ~children)))))...
Actually , I was creating cyclic dependency in files which resulted into this.For a better explanation see here.
import,neo4j,runtime-error,stack-overflow,spring-data-neo4j-4
SDN 4 isn't really intended to be used to batch import your objects into Neo4j. Its an Object Graph Mapping framework for general purpose Java applications, not a batch importer (which brings its own specific set of problems to the table). Some of the design decisions to support the intended...
java,recursion,stack-overflow,stackframe
I understand that this is mostly theoretical question but it is valid question. You are right in your estimates. Except stack goes to Xms but local variables go to Xmx. So, based on real data what you use on each iteration and real size of available RAM depth of tree...
How do you know that perms [1..] is nonempty?
assembly,stack,stack-overflow,8086
If you're not allowed to modify the code then search for a 0CBh or 0CAh byte anywhere in the code segment. These are far return instructions, but they don't actually have used for that purpose by the code. You just need to find a byte with either of these values....
c++,multithreading,stack-overflow,intel,tbb
It is blocking-style parallelism plus heavy use of stack for matrices which result in the stack overflow. So, each your task reserve some stack for its data and then calls spawn_root_and_wait_for_all which in turn executes another instance of the same task which recursively keeps growing the stack. Use continuation-style programming...
c#,path-finding,stack-overflow
A* does not have a recursive step. You should be pulling work items out of a priority queue. Your code is tail recursive. There is no need for recursion here. Just wrap the entire method in a while (true) loop: private void aStar(int x, int y) { while (true) {...
java,regex,exception,stack-overflow
I believe the problem is because the Java implementation of Pattern uses up a stack for each repetition of a group because of backtracking. The solution might be to either change your approach as others have answered or to make all quantifiers possessive : ^\s*(\S+\s+){0,300}+\S*$ or ^\W*(?:\w+\b\W*){0,300}+$ For more info,...
c#,timer,stack-overflow,doevents
Your StackOverflowException is possibly caused by repeated presses of the button. That would cause the BeginMonitoringClick() method to be called recursively, which would eventually overflow the stack. Without seeing the rest of the code, it's impossible to know for sure. In code where DoEvents() is used once, it's not uncommon...
c#,.net,stack-overflow,biginteger,fibonacci
You can use BigInteger without recursion: public static int FibHugesUntil(BigInteger huge1, BigInteger huge2, int reqDigits) { int number = 1; while (huge2.ToString().Length < reqDigits) { var huge3 = huge1 + huge2; huge1 = huge2; huge2 = huge3; number++; } return number; } static void Main(string[] args) { Console.WriteLine(FibHugesUntil(BigInteger.Zero, BigInteger.One, 1000));...
c#,stream,stack-overflow,mscorlib
StackOverflowException is expected with this code: public readonly Stream Null=new NullStream() because calling NullStream constructor will call Stream constructor(the parent class)which must initialize Null field which then call NullStream().... but hey it's static ! initialization of static fields are done just once and before any object is created, calling NullStream()...
java,tcp,bufferedreader,stack-overflow,message-loop
Don't call run() within run(). This is not a recursive function. If you want to keep reading until some condition, wrap this in a while loop. By calling the method you are executing while you are executing it, you are creating another stack frame. What you really want is just...
There are some problems with your generated code, but the deeper problem lies in the JIT engine tl;dr Every new operator in a function requires a DWORD at the stack, even new object(), that will be present regardless of optimization and release/debug mode! This effectively means that you are limited...