Bug #14558

"Backtrace in reverse order" always upsets my brain!

Added by gfx (Goro FUJI) over 2 years ago. Updated 4 months ago.

Target version:
ruby -v:
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]


A Ruby 2.5.0 feature "backtrace in reverse order", issued in, is confusing in developing Rails applications because I can't expect the order: it sometimes "reversed", sometimes "non-reversed". It just sucks.

Please revert this feature, or provide a way to disable it.

Updated by mrkn (Kenta Murata) over 2 years ago

it sometimes "reversed", sometimes "non-reversed"

Is it acceptable that the backtrace is always new, 2.5-style order?

Updated by gfx (Goro FUJI) over 2 years ago

mrkn (Kenta Murata) wrote:

it sometimes "reversed", sometimes "non-reversed"

Is it acceptable that the backtrace is always new, 2.5-style order?

Might be acceptable, or at least it's better than the current "random" order.

Why not provide a way to customize it, for example RubyVM.backtrace_reverse_order = -> (io) { true }, where -> (io) { io.tty? } is the algorithm that 2.5.0 has.

Updated by shevegen (Robert A. Heiler) over 2 years ago

I think I understand what Goro Fuji refers to.

It sometimes takes me a while as well to adjust to the change, too.

What I found in particular hard is when it is a long backtrace AND
when the .rb file names are long and deeply branched on the local
filesystem, for example:


Then it becomes quite difficult for me to see where the error is
because it is overflowing on my console output. This leads to a
situation where the error reported number is on the right side,
but the error is often on the next line overflow on the left
side, which actually makes the intent of the change a bit moot
since it may take me longer than before to find the error. :D

I think the suggestion to customize it would be best. Then people
could use what they prefer in regards to the order style in use.

I don't mind the changed tracking order so much as such, but I think
it really would be best if there is some way to customize it, either
at run-time, or settable at compile-time via a configure switch
or both ways (but "run-time" is probably best, as Goro Fuji showed
in his example).

Updated by vo.x (Vit Ondruch) over 2 years ago

I wish the original backtrace order is back. If at least the order was consistent. I must agree that the current situation is unbearable.

Updated by jeremyevans0 (Jeremy Evans) 4 months ago

  • Status changed from Open to Closed

The backtrace order was switched back in 39365b46e250162f278cb36aa148bc2a92b1b84a.

Also available in: Atom PDF