stack-overflow

How to change stack size of a console application? [duplicate]

梦想与她 提交于 2019-12-11 01:47:35
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to change stack size for a .NET program? I want to change the stack size for the following console application: using System; using System.IO; class Test { static int n; static bool[] us; static int[,] matr; static void dfs(int a) { us[a] = true; for (int b = 0; b < n; b++) { if (!us[b]) { dfs(b); } } } static void Main() { StreamReader input = new StreamReader("input.txt"); StreamWriter output = new

Regex for multiline string literals produces `StackOverflowError`

孤者浪人 提交于 2019-12-11 00:55:28
问题 I want to match strings enclosed in triple " -quotes which may contain line breaks, and which don't contain any """ -substrings except at the very beginning and in the very end. Valid example: """foo bar "baz" blah""" Invalid example: """foo bar """ baz""" I tried using the following regex (as Java String literal): "(?m)\"\"\"(?:[^\"]|(?:\"[^\"])|(?:\"\"[^\"]))*\"\"\"" and it seems to work on short examples. However, on longer examples, like on a string consisting of thousand lines with hello

First experiments with buffer overflow

左心房为你撑大大i 提交于 2019-12-11 00:47:40
问题 I've started reading about buffer overflow and how hackers use it to execute custom code instead of the regular compiled one and now I'm trying to reproduce some basic situations, with a vurnerable function that copy data into a char array with the unsafe strcpy. The point is that when I change the return address with one of an assembly instrution of a function defined in the program it works fine, while when I inject code directly in bytes it returned SEGMENTATION FAULT. I'm using the Kali

Error: C stack usage is too close to the limit in Windows environment

你。 提交于 2019-12-11 00:35:30
问题 I'm doing geostatistical interpolations in R on a 5600 x 5700 matrix and, despite having available memory, I'm getting the error "C stack usage is too close to the limit." There are a few SO questions related to this issue including this one and this one. These sources and others I've seen online suggest changing the stack size often resolves this issue. Some suggested this change: R_CStackLimit = (uintptr_t)-1 in the file "Rinterface.h". However I am on Windows 7 (x64), using R 2.15.3 (x64)

What is Cassini's (aka VS Dev Server) stack limit?

回眸只為那壹抹淺笑 提交于 2019-12-11 00:12:27
问题 I'm running into a StackOverflowException (please don't ask, it's not my fault) in IIS6/2k3 which has a limit of 256k, but the exception doesn't happen in the VS debugger. As a matter of understanding I'd love to know, but have failed to google what the stack limit of Cassini is...if indeed it has one? 回答1: Have you tried stack-overflowing Cassini on purpose to see at what point it crashes? I'd imagine the stack is immense, though I would expect Cassini to replicate IIS as closely as possible

Stack overflow exception without infinite loop (as far as I can tell)

﹥>﹥吖頭↗ 提交于 2019-12-11 00:10:10
问题 I have a stack overflow error, and I'm fairly sure I don't have any kind of infinite recursion (at least I've stared at the error for a few hours now and I can't imagine how its looping infinitely). Here is the code: public decimal? Amount { get { if (!string.IsNullOrEmpty(_savedWork.Amount)) return decimal.Parse(_savedWork.Amount); else return null; } set { if (value.HasValue) { _savedWork.Amount = value.Value.ToString(); Percent = null; } else _savedWork.Amount = ""; OnPropertyChanged(

Weak head normal form and order of evaluation

旧巷老猫 提交于 2019-12-10 19:52:15
问题 I've read lots on weak head normal form and seq. But I'm still have trouble imagining the logic behind Haskell's order of evaluation A common example demonstrating when and how to use but I still don't understand how the common example foldl (+) 0 [1..5000000] can result in a stack overflow. While another fold definition using seq doesn't foldl' _ a [] = a foldl' f a (x:xs) = let a' = f a x in a' `seq` foldl' f a' xs foldl' (+) 0 [0..5000000] From explanations of seq that I've read, authors

Android Studio StackOverFlowError: null

≯℡__Kan透↙ 提交于 2019-12-10 19:46:13
问题 After updating to version 2.3 today, my Android Studio stopped working. null java.lang.StackOverflowError at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.lang.ClassLoader.defineClass(ClassLoader.java:642) at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:272) at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:268) at com.intellij.util.lang.UrlClassLoader.findClass

How can I debug this StackOverflowException in my WinForm application?

孤人 提交于 2019-12-10 19:37:53
问题 I have a winform application. Every few seconds I check some log files, read in any new data and insert any new data into a DB. When I run the application for around an hour 1/2, I get a StackOverflowException . There was no new data in the log files for that entire period, so nothing new was added to the DB. The code errored here... if (pictureBox == null) { continue; } if (pictureBox.InvokeRequired) { var toolTip = new ToolTip(); GameServer tempGameFile = gameServer; pictureBox.Invoke(new

Why does this Show instance in Haskell (Hugs) cause a stack overflow error?

别来无恙 提交于 2019-12-10 18:29:50
问题 The following is a polymorphic data type in Haskell, interpreted by Hugs. I am trying to create an instance of Show for Equality. The instance declaration says that if a type "a" is in Show, then Equality a is in Show. It should print the two arguments to the constructor Equals a b in the form "a = b". data Equality a = Equals a a instance (Show a) => Show (Equality a) where show (Equals a b) = a ++ " = " ++ b Yet, typing something into Hugs like "(Equality 9 9)" yields: ERROR - C stack