stack-overflow

stack-protect equivalent in clang compiler?

北慕城南 提交于 2019-12-05 20:17:21
Most of the mature compilers appear to have good support for stack variable clobbers. GCC: -fstack-protector xlC: -qstackprotect intel: -fstackprotector windows: /RTC For clang I've found -fsanitize=safe-stack , but it doesn't support shared libraries, which makes it pretty much useless for me. It looks like that sanitizer is implemented as an add-on? Does anybody know if clang has any sort of alternate (built-in?) anti stack-smashing support that doesn't have the no shared library restriction, or if there are plans to generalize the existing limited safe-stack implementation to catch up to

Overriding equals/hashCode on cross referencing classes in Java causes StackOverflowError

天大地大妈咪最大 提交于 2019-12-05 20:10:48
I have two classes that represent two different database entities. Their relationship is 1:m in db and it is represented in class structures something like this: public class Company { private List<Employee> employees; public List<Employee> getEmployees() { return employees; } public void setEmployees(List<Employee> employees) { this.employees = employees; } } public class Employee { private Company company; public Company getCompany() { return company; } public void setCompany(Company company) { this.company = company; } } Now I want to override equals/hashCode on these classes. Eclipse

Smashing the stack example3.c confusion

风格不统一 提交于 2019-12-05 20:01:06
问题 This question was migrated from Information Security Stack Exchange because it can be answered on Stack Overflow. Migrated 7 years ago . Article can be found here. I'm reading up on smashing the stack and have found myself to be getting stuck on example3.c. 0x80004a3 <main+19>: call 0x8000470 <function> 0x80004a8 <main+24>: addl $0xc,%esp 0x80004ab <main+27>: movl $0x1,0xfffffffc(%ebp) 0x80004b2 <main+34>: movl 0xfffffffc(%ebp),%eax The author indicates that we want to skip from 0x80004a8 to

Stack overflow in unmanaged: IP: 0x26eb76, fault addr: 0xbf808ffc

匆匆过客 提交于 2019-12-05 18:48:57
问题 My Mono application crashes on Mac with this message (Full log): $ mono --debug bin/Debug/SparkleShare.app/Contents/MonoBundle/SparkleShare.exe [...] Stack overflow in unmanaged: IP: 0x26eb76, fault addr: 0xbf808ffc [...] "in unmanaged" implies that the stack overflow is not in my code (I only have managed code) but rather in a library I embed (SQLite, DotCmis, NewtonSoft.Json) or in Mono's code. Even though I compile and run in Debug mode, all I get is these two hexadecimals. QUESTION: How

Stack Overflow error vs. Infinite loop

和自甴很熟 提交于 2019-12-05 18:25:12
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? 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. These are not the same thing. Infinite loop error is dealing with iterative loops (no recursion), where as most stack overflow errors are dealing with recursion. You should google

Haskell foldl and stack overflow?

我与影子孤独终老i 提交于 2019-12-05 14:33:23
I read a posting claims foldl may occur stack overflow easily. And the posting sample code was: maximum [1..1000000] The code doesn't overflown in my machine. However it can vary by environment. I increased number like this: maximum [1..1000000000] it caused hard disk swapping, so I have to stop evaluation. Sample code is not important. Is it really occur stack overflow? Or just an old days story? Some points Recursive function take stack space in each call, so deeply nested calls will cause overflows Tail-recursive function can be optimized to iterations and therefore don't overflow foldr is

PHP doesn't handle stack overflow?

天涯浪子 提交于 2019-12-05 13:36:45
I was surprised when I just tried the following PHP code: function foo() { foo(); } foo(); I expected to get "500: Internal server error". Instead the connection was closed immediately (no bytes received), and the log files show that apache segfaulted. WTF? Is this a known bug in PHP? Are there some configuration options that I'm missing? Because a crashed process for every accidental stack overflow is, well... pretty unacceptable, I think. Lizard PHP is not able to deal with this, it will just go into an infinite loop and produce a segmentation fault. http://bugs.php.net/bug.php?id=49823 also

Implementing Binary Tree in Ruby

非 Y 不嫁゛ 提交于 2019-12-05 11:54:19
I've been trying to implement BinaryTree class in Ruby, but I'm getting the stack level too deep error, although I don't seem to be using any recursion in that particular piece of code: 1. class BinaryTree 2. include Enumerable 3. 4. attr_accessor :value 5. 6. def initialize( value = nil ) 7. @value = value 8. @left = BinaryTree.new # stack level too deep here 9. @right = BinaryTree.new # and here 10. end 11. 12. def empty? 13. ( self.value == nil ) ? true : false 14. end 15. 16. def <<( value ) 17. return self.value = value if self.empty? 18. 19. test = self.value <=> value 20. case test 21.

Are programs in functional languages more likely to have stack overflows?

青春壹個敷衍的年華 提交于 2019-12-05 10:32:28
I am starting to learn ocaml, and am really appreciating the power of recursion in the language. However, one thing that I am worried about is stack overflows. If ocaml uses the stack for function calls, won't it eventually overflow the stack? For example, if I have the following function: let rec sum x = if x > 1 then f(x - 1) + x else x;; it must eventually cause a stack-overflow. If I was to do the equivalent thing in c++ (using recursion), I know that it would overflow. So my question is, is there built in safeguards to prevent functional languages from overflowing the stack? If not, are

Linq to SQL throwing a StackOverflowException

萝らか妹 提交于 2019-12-05 06:23:17
I'm executing a pretty simple query using Linq to SQL. I'm creating the expression and then passing it to the Where() extension method. The Linq internals are throwing a StackOverflowException when I attempt to actually execute the query. Here is the code: int expectedCount = 4; Expression<Func<Thing, bool>> expression = ...; //Expression looks like (LocaleID = 1 && GenderID ==1 && (TimeFrameID == 2007 || TimeFrameID == 2008)) using (XYZDataContext context = new XYZDataContext()) { int count = context.Things.Where(expression).Count(); //... } And here is the DebugView of the expression: