stack-overflow

java.lang.StackOverflowError while doing deep recursion with Java 1.6 and Windows 7 OS

做~自己de王妃 提交于 2019-12-22 10:14:33
问题 I have a program which will run into a very deep recursion while executing. In middle of this, I am getting java.lang.StackOverflowError and my application freezes. I am using JDK 1.6 and Windows 7 OS. Strange thing here is, I am not getting this StackOverflowError with same code base while running my application with Java 1.5 and Windows XP. I understood that default stack size will differ from platform to platform and OS to OS. But with Java 1.5 and Windows XP, I set stack size of 256k

Stack Overflow of 8086 microprocessor

自古美人都是妖i 提交于 2019-12-22 09:55:52
问题 What'll be the behaviour of the 8086 Microprocessor when the stack is full and even then I push something into it? 回答1: On the 8086, a PUSH instruction or implicit stack push will decrement the SP register by two and store the appropriate quantity at SS:SP (i.e. 16*SS+SP). If the SP register was $0000, the data will go to SS:$FFFE. If the SP register was $0001, the MSB of the data will go to SS:$0000 and the LSB will go to SS:$FFFF. The processor will not take any special notice of the stack

Stack Overflow error vs. Infinite loop

[亡魂溺海] 提交于 2019-12-22 08:14:58
问题 I know what an Infinite Loop error is. Is a stack overflow error the same thing. If not, what is the difference? Can you give example code as well? 回答1: If, instead of infinite loop, you have infinite (or very deep) recursion (function invoking itself), then you will get stack overflow. Whenever a function is invoked, some part of stack memory is consumed. Once all the stack is exhausted, you get - stack overflow error. 回答2: These are not the same thing. Infinite loop error is dealing with

Will recursively calling a function from a callback cause a stack overflow?

你。 提交于 2019-12-22 05:05:52
问题 I want to invoke a function after an event gets fired then in the same call back call the function again. This is to create a sort of event listener when the function completes. You'll know what i'm trying to do when you see the code: "use strict"; var page = require('webpage').create(); var system = require('system'); function onStdReadLine(callback) { system.stdin.readLineAsync(function(err, line) { callback(line); onStdReadLine(callback); }); } onStdReadLine(function(line) { // do

Android StackOverflowError in ViewGroup.resetResolvedTextDirection

允我心安 提交于 2019-12-22 05:01:04
问题 I just went to android market to publish an update to my app and noticed there a few new errors reported from existing installs. While I can understand (and attempt to do something about) most of them, this one leaves me rather puzzled: java.lang.StackOverflowError at android.view.ViewGroup.resetResolvedTextDirection(ViewGroup.java:5131) at android.view.ViewGroup.resetResolvedTextDirection(ViewGroup.java:5131) at android.view.ViewGroup.resetResolvedTextDirection(ViewGroup.java:5131) at

save an object with a bidirectional relationship in mongodb using official c# driver

南笙酒味 提交于 2019-12-22 04:54:06
问题 I have two class like this: public Class Company { public IList<Employee> Employees; } public Class Employee { public Company WorkPlace; } when I want to save an object of class Company: MongoDatabase Database = MongoServer.GetDatabase("db"); var workPlace = new Company(); var employee = new Employee { WorkPalce = workPlace} workPlace.Employees = new List<Employee>{ employee }; Database.GetCollection<Company>("company").Save(workPlace); StackOverFlow Exception will be thrown. 回答1: This is

Subset-AVG - Finding a subset of List Which Matches Known Rational Number

别来无恙 提交于 2019-12-22 01:04:35
问题 I've asked this on math overflow and used comments to clarify/overstate my question. I hope it has the intended effect and doesn't come off as jarring. I'm attempting to find what subset of numbers reach a known average. I have a list of known values, negative and possible decimals. They look something like this {-.32,-.64,-.12,.08,-.54,-.43, ...} It's around 50 numbers in some cases, though this problem would be tested for other cases as well. The set mostly contains negative decimal numbers

Disabling stack protection in GCC not working

匆匆过客 提交于 2019-12-21 21:28:50
问题 I'm trying to recreate a stack buffer overflow using the classic overflow with strcpy using this function: #include <stdio.h> #include <string.h> void main(int argc, char **argv) { char buf[100]; strcpy(buf,argv[1]); printf("Done!\n"); } I have tried compiling with all the various flags in order to remove the stack protection gcc -o vuln vuln.c -fno-stack-protector -g -z execstack as well as removing ASLR with sudo echo 0 > /proc/sys/kernel/randomize_va_space . I can get my nop-shellcode

Arithmetic operation resulted in an overflow in unsafe C#

馋奶兔 提交于 2019-12-21 18:05:35
问题 Background We've been using some code copied verbatim from Joe Duffy's "Concurrent Programming on Windows" (page 149) in production for over a year. The code (below) is used in our Asp.Net web application to probe if there's enough stack space. Our site allows users to script out their own web pages and control logic in a simple proprietry scripting language - it's possible for a user to script something nasty and cause a stackoverflow exception, so we use Duffy's code example to stop

Arithmetic operation resulted in an overflow in unsafe C#

孤街浪徒 提交于 2019-12-21 18:03:06
问题 Background We've been using some code copied verbatim from Joe Duffy's "Concurrent Programming on Windows" (page 149) in production for over a year. The code (below) is used in our Asp.Net web application to probe if there's enough stack space. Our site allows users to script out their own web pages and control logic in a simple proprietry scripting language - it's possible for a user to script something nasty and cause a stackoverflow exception, so we use Duffy's code example to stop