stack-overflow

Android: Increase call stack size

我们两清 提交于 2019-11-27 14:45:50
I have an application with very complex UI, containing many layouts nested one in another. While Creating another layout, I've caught a StackOverflowError Wondering, I've created two test examples: 1) Hello world application with following xml for main Activity <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" > <FrameLayout android:layout_width="fill_parent" android:layout

Explanation of R: options(expressions=) to non-computer scientists

十年热恋 提交于 2019-11-27 13:55:45
I have written a recursive function of the form foo=function(vars,i=2){ **do something with vars** if(i==length(vars)){ return(**something**) }else{ foo(vars,i+1) } } length(vars) is around 1500. When I execute it, I got the error Error: evaluation nested too deeply: infinite recursion / options(expressions=)? Error during wrapup: evaluation nested too deeply: infinite recursion / options(expressions=)? Fair enough, so I increased options(expressions=10000) Then it works. But when I read the help doc of options regarding expressions= , i just don't understand what it is saying. Furthermore, it

What is a stack overflow?

纵然是瞬间 提交于 2019-11-27 13:53:04
What is a stack overflow error? What type of programs/programming languages is it likely to occur in? Is it unlikely to occur in web application code? victor hugo From Wikipedia : In software, a stack overflow occurs when too much memory is used on the call stack. In many programming languages, the call stack contains a limited amount of memory, usually determined at the start of the program. The stack is a data structure that keeps record of the point the subroutines of a program should return control to when they finish executing. The return addresses are pushed in the stack as the

ES6 Tail Recursion Optimisation Stack Overflow

半世苍凉 提交于 2019-11-27 13:06:09
Having read Dr Rauschmayer's description of recursive tail call optimisation in es6, I've since been trying to recreate the 'zero-stack' execution of the recursive factorial function he details. Using the Chrome debugger to step between stack frames, I'm seeing that the tail optimisation is not occurring and a stack frame is being created for each recursion. I've also tried to test the optimisation by calling the function without the debugger, but instead passing 100000 to the factorial function. This throws a 'maximum stack' error, which implies that it is, in fact, not optimised. Here is my

How do I increase the stack size for Apache running under Windows 7?

白昼怎懂夜的黑 提交于 2019-11-27 11:49:54
I think I am getting stack overflows running a cakePHP application on an Apache server under Windows 7. This problem happens more often on Windows platform, because of smaller Apache's default stack size. There is 1 MB default stack size on Windows, unlike 8 MB on Unix/Linux platforms. It could be a reason, why some for example PHP scripts works properly on Linux, but cause crash of Apache on Windows. Furthermore, the crash is silent ( segmentation fault ), there is no error message, Apache just stops responding and the child process is restarted. Browser gets no data and renders a blank page,

Stack Overflow Exploit in C

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 11:49:29
问题 The question is actually about stack overflows in C. I have an assigment that I can not get done for the life of me, I've looked at everything in the gdb and I just cant figure it. The question is the following: int i,n; void confused() { printf("who called me"); exit(0); } void shell_call(char *c) { printf(" ***Now calling \"%s\" shell command *** \n",c); system(c); exit(0); } void victim_func() { int a[4]; printf("[8]:%x\n", &a[8]); printf("Enter n: "); scanf("%d",&n); printf("Enter %d HEX

Chrome/jQuery Uncaught RangeError: Maximum call stack size exceeded

大兔子大兔子 提交于 2019-11-27 11:37:22
I am getting the error "Uncaught RangeError: Maximum call stack size exceeded" on chrome. here is my jQuery function $('td').click(function () { if ($(this).context.id != null && $(this).context.id != '') { foo($('#docId').val(), $(this).attr('id')); } return false; }); Note that there are tens of thousands of cells in the page. However, I generally associate stack overflows with recursion and in this case as far as I can see there is none. Does creating a lambda like this automatically generate a load of stuff on the stack? is there any way round it? At the moment the only workaround I have

Why is it possible to recover from a StackOverflowError?

淺唱寂寞╮ 提交于 2019-11-27 11:16:14
I'm surprised at how it is possible to continue execution even after a StackOverflowError has occurred in Java. I know that StackOverflowError is a sublass of the class Error. The class Error is decumented as "a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch." This sounds more like a recommendation than a rule, subtending that catching a Error like a StackOverflowError is in fact permitted and it's up to the programmer's reasonability not to do so. And see, I tested this code and it terminates normally. public class Test { public

Large 2D array gives segmentation fault

耗尽温柔 提交于 2019-11-27 10:57:53
I am writing some C++ code in Linux where I have declared a few 2D arrays like so: double x[5000][500], y[5000][500], z[5000][500]; During compilation there is no error. When I execute it says "segmentation fault". Wen I reduce the size of the array from 5000 to 50, the program runs fine. How can I protect myself against this problem? If your program looks like this ... int main(int, char **) { double x[5000][500],y[5000][500],z[5000][500]; // ... return 0; } ... then you are overflowing the stack. The fastest way to fix this is to add the word static . int main(int, char **) { static double x

runtime error (stack overflow)

为君一笑 提交于 2019-11-27 09:51:28
I've got this code in C language: char *options[100000]; int k[100000]; char *param[100000]; int n; int i,j; ... scanf("%d",&n); for (i=0;i<n;i++) { scanf("%s%d",&options[i],&k[i]); param[i]="On"; } ... just as the programm reaches this point: scanf("%s%d",&options[i],&k[i]); I get the runtime error (stack overflow). The input here should be like this: word1 number1 word2 number2 and so on. I've got no idea why is this happening. What's the problem? Ok... so I thought someone would provide an answer to your stack overflow problem but so far everybody only mentioned a problem you actually have