News for hackers. Stuff that matters.
Re:Error stack traces in Go with x/xerror by dhagz on Monday August 23, 2021 @07:56PM (#28283575)
Yep - my biggest gripe is seeing errors with no context around them - either a stack trace or...well...the context.Context.
Re:Error stack traces in Go with x/xerror by ollien on Monday August 23, 2021 @08:03PM (#28283618)
I've just started writing C++ for work, and I have to say, I miss stack traces so much. Even with Go errors the wrapping usually made it easy enough, but with how long it takes to get gdb to launch from core dumps (~1m30 on our binaries at work), I really do miss that extra context.
Re:Error stack traces in Go with x/xerror by bombela on Tuesday August 24, 2021 @04:35AM (#28286342)
100% Shameless plug. Stack capture and pretty printer for C++: https://github.com/bombela/backward-cpp
Re:Error stack traces in Go with x/xerror by ollien on Tuesday August 24, 2021 @12:41PM (#28291300)
This looks super neat. Thanks!
Re:Error stack traces in Go with x/xerror by gpderetta on Tuesday August 24, 2021 @10:11AM (#28289078)
It is not particularly hard to log stack traces in C++, for example from an abort signal handler or attaching them to exceptions.

There is no standard solution though, so you have to rely on 3rd party libraries or use platform specific solutions.

Re:Error stack traces in Go with x/xerror by jcelerier on Tuesday August 24, 2021 @06:51AM (#28287096)
why not just enable them ? there are plenty of minimally invasive and permissively licensed options... that's like -Werror=return-stack-address it's an entire no-brainer
Re:Error stack traces in Go with x/xerror by ollien on Tuesday August 24, 2021 @12:41PM (#28291297)
Well, namely it's not my decision to enable them for the entire codebase :) but I may very well try to talk some people into enabling this on debug builds.