Type-level Bounded Recursion in Rust
9 points by calvin
9 points by calvin
Even backtrace-on-stack-overflow, which does what the name implies, aborts immediately after printing the backtrace and comes with a note saying that it’s “unsuited for being enabled in production”.
While unwinding the stack on stack overflow (calling drops, etc) is indeed tricky to get right, I do think that printing a backtrace can be done relatively painlessly, and I strongly wish that Rust’s stack overflow handler did print backtrace by default. I wasted a lot of time chasing stack overflows!
That does require some degree of debug symbols be present (exported symbols are obviously discoverable , but internal symbols are not).
Also in general I find stopping in a debugger is often more useful if it’s just the backtrace that I care about, because then you can simultaneously check background state.
On macOS and windows you should also get crash dump info that includes stack trace (windows used to include a mini heap dump as well I don’t know if it still does - back when I worked on a windows app when we got the first error dumps we were horrified at how much data was included - passwords, history, and similar,because you know, it included heap data). Side note: including notes in crash logs is useful - they are read by engineers if a crash is common. I once managed to find a repro case because the logs largely consisted of swearing in Swedish.
Ha! “Our macro implementation means we can’t take generic parameters”
C++ already has this! Score 1 for c++ :D