Would a person struggling with a stack overflow actually google "stack overflow", though? Surely only a very fresh programmer would need to google it, and only if he/she knew what the concept was. But here's what an infinite recursion in a C program prints if I run it:
Segmentation fault: 11
Well, that's C for you. If I try Ruby:
test.rb:2: stack level too deep (SystemStackError)
Ok, still not the same nomenclature. Python:
RuntimeError: maximum recursion depth exceeded
Nope. How about Go? ... Actually, an infinitely recursing function in Go never completes on my machine. I wonder why. Perhaps it's not using the stack the way I expect.
If you do the same thing in Java:
Exception in thread "main" java.lang.StackOverflowError
Ok, there it is.
But if do you get that, would you not google "StackOverflowError", as opposed to "stack overflow"?
(Then again, my Google searches are perhaps uncommonly precise. If a function "foobar()" in library "libfoo" overflowed when processing HTTPS URLs, I would probably google for "foobar stack overflow libfoo https url".)
The Wikipedia entry for stack overflow (the concept) is the fourth hit on a search for "stack overflow". Should be acceptable to a newbie.
> Actually, an infinitely recursing function in Go never completes on my machine.
Maybe your function is tail-recursive? Try to use the return value from the recursive call in a nontrivial way, so that stack storage is necessary to store some local variable.
And my point was that GCC was not as helpful in that case. :-) With the GNU C library you will have to install your own signal handlers and jump through a lot of hoops to get anything more sensible than a "segmentation fault" error. You would think our tools would be a bit more modern by now.
If you do the same thing in Java:
Ok, there it is.But if do you get that, would you not google "StackOverflowError", as opposed to "stack overflow"?
(Then again, my Google searches are perhaps uncommonly precise. If a function "foobar()" in library "libfoo" overflowed when processing HTTPS URLs, I would probably google for "foobar stack overflow libfoo https url".)
The Wikipedia entry for stack overflow (the concept) is the fourth hit on a search for "stack overflow". Should be acceptable to a newbie.