stack-overflow

Nested JSF Composite Components leading to a Stack Overflow exception

江枫思渺然 提交于 2019-11-27 09:28:22
The problem When I attempt to nest a Composite Component within itself, with some logic to end the infinite recursion I receive a stack overflow exception. My understanding is that <c:xxx> tags run at view build time so I was not expecting to have an infinite view build as I presume has been the case. This is the composite component simpleNestable.xhtml <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:h="http://java.sun

Increase stack size when compiling with mingw?

旧街凉风 提交于 2019-11-27 09:18:19
I'm writing a recursive flood-fill algorithm to find connected components in an image, my code compiles and runs well with MSVC 2008 compiler; but the mingw-compiled binary crashed at runtime. After I converted the algorithm to non-recursive with std::stack, everything goes well. But what if I must use recursive algorithm in some case, and mingw cannot handle it? How can I increased stack size of a binary, is there any compilation options? Thanks Use gcc -Wl,--stack,N where N is stack size. E.g. gcc -Wl,--stack,4194304 probably the best bet is to use pthreads to start a new thread and run your

Why does this method print 4?

不羁的心 提交于 2019-11-27 09:16:58
问题 I was wondering what happens when you try to catch an StackOverflowError and came up with the following method: class RandomNumberGenerator { static int cnt = 0; public static void main(String[] args) { try { main(args); } catch (StackOverflowError ignore) { System.out.println(cnt++); } } } Now my question: Why does this method print '4'? I thought maybe it was because System.out.println() needs 3 segments on the call stack, but I don't know where the number 3 comes from. When you look at the

Unusual stack overflow when inserting nodes in binary tree

佐手、 提交于 2019-11-27 08:29:56
问题 CLISP Version: 2.49 Leaf Node (value (NIL) (NIL)) Non-Leaf Node (value (value (NIL) (NIL)) (NIL)) Code ("format" for debug only) ; (nil) means NULL (defun binary-insert (root obj <) (if (null (cdr root)) (progn (format t "In Null [~A] => " root) (setf (car root) obj) (format t "mid [~A] => " root) (setf (cdr root) '((nil) (nil))) (format t "[~A]~%" root)) (if (funcall < obj (car root)) (progn (format t "In Left [~A] => " root) (binary-insert (nth 1 root) obj <) (format t "[~A]~%" root)) ;

Create objects without causing a stack overflow error?

只谈情不闲聊 提交于 2019-11-27 08:28:41
问题 So, I have my main class that calls private Secondary secondary = new Secondary(); when it runs. In the Secondary class, at the top I have code that says private Main main = new Main(); . How will I be able to use all of the methods and variables from the Secondary class and vice versa without causing a stack overflow error? Note: they are not in the constructor 回答1: Your Main class is creating a Secondary instance, which is creating a Main instance..., and this is causing the stack overflow

How can I avoid a stack overflow when Fortran produces a large, internal, temporary array?

放肆的年华 提交于 2019-11-27 08:21:11
问题 I have some Fortran code that calls RESHAPE to reorder a matrix such that the dimension that I am now about to loop over becomes the first varying dimension (Column-major order in Fortran). This has nothing to do with C/Fortran interoperability. Now the matrix is rather large and when I call the RESHAPE function I get a seg fault which I am very confident is a stack overflow. I know this because I can compile my code in ifort with -heap-arrays and the problem disappears. I do not want to

Fatal Python error: Cannot recover from stack overflow. During Flood Fill

独自空忆成欢 提交于 2019-11-27 07:48:57
问题 I've come to a dead end, and after excessive (and unsuccessful) Googling, I need help. I'm building a simple PyQt4 Widget where it lies out a grid of 60x80 squares, each initialized to None . If the user clicks on that box it changes color based on how many times left-clicked, defined by this list: self.COLORS=[ (0, 0, 255), #WATER (255, 210, 128), #SAND (0, 128, 0), #GREEN (255, 255, 0), #YELLOW (255, 165, 0), #ORANGE (255, 0, 0) #RED ] If the user right clicks, it flood fills an area, using

Why does the count of calls of a recursive method causing a StackOverflowError vary between program runs? [duplicate]

谁说我不能喝 提交于 2019-11-27 07:47:57
This question already has an answer here: Why is the max recursion depth I can reach non-deterministic? 4 answers A simple class for demonstration purposes: public class Main { private static int counter = 0; public static void main(String[] args) { try { f(); } catch (StackOverflowError e) { System.out.println(counter); } } private static void f() { counter++; f(); } } I executed the above program 5 times, the results are: 22025 22117 15234 21993 21430 Why are the results different each time? I tried setting the max stack size (for example -Xss256k ). The results were then a bit more

Stack overflow exception in c# setter

南笙酒味 提交于 2019-11-27 07:36:32
问题 This is simple to explain: this works using System; using ConstraintSet = System.Collections.Generic.Dictionary<System.String, double>; namespace ConsoleApplication2 { class test { public ConstraintSet a { get; set; } public test() { a = new ConstraintSet(); } static void Main(string[] args) { test abc = new test(); Console.WriteLine("done"); } } } this does not using System; using ConstraintSet = System.Collections.Generic.Dictionary<System.String, double>; namespace ConsoleApplication2 {

How can I increase the maximum call stack size in Node.js

别等时光非礼了梦想. 提交于 2019-11-27 07:24:34
This is different to other questions regarding an error message in Node that reads RangeError: Maximum call stack size exceeded in that I know exactly why I'm getting this error message. It's happening because I'm recursing, recursing quite a lot in fact. Thanks. From node --help : node --max-stack-size=val Update: as the comments indicate, even though the help text still lists the --max-stack-size option, in node v0.10.x you need to use --stack-size instead. node --stack-size=val In node version 5 and 6, I have verified that the option to set maximum stack size is "--stack_size" (with an