-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard-to-understand order of lines in backtrace #99560
Comments
@rustbot label +D-confusing |
@rustbot label: +A-panic |
I personally read backtraces the other way around. I start from the place where the panic happened and work my way back to the main function. In other words from top to bottom. Thus order is generally the most useful for me as towards the main function there is often a lot of irrelevant functions like all the functions that form the tokio runtime, while near the panic site is likely the code that is in the end responsible for the bug. |
@bjorn3, it seems you didn't read my report properly. Current order is not "top to bottom" nor it is "bottom to top". It is simply absolutely alien. Let me explain again in simple terms (using images!). Let's assume that
Here is another possible good backtrace:
Both backtraces above can be easily read by eye.
Or in verbatim form:
As you can see, the backtrace is absolutely impossible to read. Now let me show you the same using images. At these two images we see actual backtrace. Red arrows show how you should move your eyes to follow " |
UPD: See this comment #99560 (comment) for possibly better explanation what is wrong with current backtrace (with images!)
Rust backtraces are hard to read. Let's consider this example ( https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=e171ae87e31ca0f91a502a619f2070ee ):
How I would pronounce backtrace in my own words? I would say: "Entered
main
, then executed until we reachedmain.rs:10
, then enteredf
, then got tomain.rs:6
and calledg
...". In other words, I first pronounce name of functionf
, then I pronounce place wheref
callsg
and then I pronounceg
. But rust backtrace gives us instead something completely different (I tested locally):So I have to dechiper this output using my eyes when reading this! I have to move my eyes to
4: oo::f
, then toat ./oo.rs:6:5
, then to3: oo::g
. I propose the following backtrace instead:Alternatively, we can simply reverse order of frames, i. e.:
The text was updated successfully, but these errors were encountered: