-1

Possible Duplicate:
What is a stack overflow error?

Well, I have heard its the most common error that one experiences while writing a program... I am very new to programming, just 2 years coding and I have never actually come across this error! So, at the risk of sounding very stupid, I would like to ask... What is stackoverflow and what is bufferoverflow?

Is stackoverflow somehow related to bufferoverflow?

A wiki link will literally not help me coz I have gone through it and am did not understand it. So if you could dumb it down.... How would you put it?

9
  • 2
    He is also asking about buffer overflows. Commented Oct 11, 2010 at 12:46
  • 4
    Note: this does not belong on meta as it's about "stack overflow" the runtime error, not "Stack Overflow" the web application. Commented Oct 11, 2010 at 12:46
  • 2
    Definitely not an exact duplicate! Edited the question.. Please vote to reopen! Commented Oct 11, 2010 at 12:49
  • 1
    I assume they have been answered as separate questions and not as a dumbed out comparison of the two.. I assumed this to be a unique question.. Unless you can give me a link for what I ask... Thanks Commented Oct 11, 2010 at 12:57
  • 2
    Exact duplicate of stackoverflow.com/questions/1120575/…! Have a look at your linked question.. Its a combination of a couple of more questions that what you could individually surf the site to get... Commented Oct 11, 2010 at 13:03

2 Answers 2

6

Most operating system hold program information in data stuctures called a stack and a heap.

A StackOverflow occurs when one has added more information to the stack than it is allowed to hold (many times this can happen with a recursive function the doesn't have a termination clause).


A buffer is a set of memory locations (normally contiguous) that is used to hold temporary data. A buffer overflow occurs when trying to write into memory beyond the end of the buffer. This has security implications, as sometimes the memory beyond the buffer is not protected and code inserted after it may get executed.

Sign up to request clarification or add additional context in comments.

Comments

2

A StackOverflow is what happens when you run out of stack space for you programme to execute in.

I got one the other day with some poorly written event code, where one event would trigger another event causing the original event, and so on, until the stack overflowed with method calls.

A buffer overflow or buffer overrun is what happens when you try to write data past the end of an array. For example

char* s = "hello";
s[7] = 'g';

There is no knowing what writing 'g' to the location 7 in the string will do. This technique can be used by nefarious programmers to execute arbitrary code on a system.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.