4 ms·
> When printing very deep stacks, the runtime now prints the first 50 (innermost) frames followed by the bottom 50 (outermost) frames, rather than just printing
by KolmogorovComp 3y ago
> When printing very deep stacks, the runtime now prints the first 50 (innermost) frames followed by the bottom 50 (outermost) frames, rather than just printing the first 100 frames. This makes it easier to see how deeply recursive stacks started, and is especially valuable for debugging stack overflows.
This is a very nice QoL improvement, I wish more languages made the change.
- michaeljx 3y ago100+ frames deep? I am a python dev, is that normal in Go? Sounds atrocious
- eyelidlessness 3y ago“This makes it easier to see how deeply recursive stacks started, and is especially valuable for debugging stack overflows.” Mistakes are normal in any language. Debugging an infinitely deep recursion can be challenging in most.
- cryptos 3y agoYou will never hear something again from developers trying to hunt down errors in infinite recursion ;-)
- masklinn 3y agoPython will also do something like that, specifically it snips out repeated lines in self-recursive calls: https://github.com/python/cpython/issues/71010 https://github.com/python/cpython/issues/71010 >>> a() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 3, in a File "<stdin>", line 3, in a File "<stdin>", line 3, in a [Previous line repeated 894 more times] File "<stdin>", line 2, in a File "<stdin>", line 2, in b File "<stdin>", line 2, in c File "<stdin>", line 2, in c File "<stdin>", line 2, in c [Previous line repeated 97 more times] RecursionError: maximum recursion depth exceeded Sadly it's not smart enough to handle indirect recursion, so in those cases you get a thousand lines of garbage.
- geodel 3y agoWell its normal in Java and from what I have seen despite being advised against it a lot of folks coming from Java to Go have brought along Java style heavily abstracted code, framework first design patterns with them. This can definitely lead to very deep stack traces.
- deepsun 3y agoOr just devs started developing more and more complex systems, or libs with more and more extendability needs.
- ric2b 3y agoIt is normal in any language when you accidentally write an infinite recursion.