Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by ycombobreaker on Saturday March 02, 2013 @11:28PM
(#5312526)
> 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.
Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by lobster_johnson on Sunday March 03, 2013 @07:36AM
(#5313519)
Apparently Go allocates the stack as a heap structure, as was pointed out in another comment: http://stackoverflow.com/questions/4226964/how-come-go-doesn...
Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by pjbrunet on Sunday March 03, 2013 @04:16AM
(#5313085)
"only a very fresh programmer would need to google it"
It's why this is a top story on Headquarters of Noobs. Not surprising. You mean Lenny Kravitz didn't write American Woman?
Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by sblom on Sunday March 03, 2013 @01:37PM
(#5314698)
What's HQoN?
Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by TazeTSchnitzel on Saturday March 02, 2013 @08:48PM
(#5312100)
I remember having seen "stack overflow" when I naïvely tried to allocate a 5MB array on the stack in Visual C++ 2010.
Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by lobster_johnson on Saturday March 02, 2013 @09:07PM
(#5312158)
Trying this with GCC gives me a segfault (although I had to go higher up to 8 MB).
#include <stdio.h>
int main(void) {
char x[8388608];
printf("%ld\n", sizeof(x));
return 0;
}
Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by TazeTSchnitzel on Saturday March 02, 2013 @09:09PM
(#5312164)
My point was that Visual C++ 2010 gives a different error, but it was running in debug mode.
Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by lobster_johnson on Saturday March 02, 2013 @09:20PM
(#5312189)
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.
Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by TazeTSchnitzel on Saturday March 02, 2013 @09:22PM
(#5312199)
Oh by the way, I'm not sure if it was exactly 5MB, it might actually have been 2MB. This particular case was 2 years ago, now.
Re:Stack Overflow ranks #2 for Google Search for "Stack Over...
by Evbn on Saturday March 02, 2013 @11:00PM
(#5312451)
Re go:
http://stackoverflow.com/questions/4226964/how-come-go-doesn...
Clever birds.
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.