Alexey Verkhovsky wrote: > Hi all, > > Say, we have a Ruby app going into an endless loop (or perhaps a > thread deadlock) mode. Let us further assume that it happens in > production and you don't know how to reproduce it anywhere else. How > would you debug this? > > Debugging these conditions in Java is trivial because of the "thread > dump" feature of JVM (where you send a kill -3 signal to a JVM process > and it spits out stack tracces of all threads to stdout). In any > environemnt where you can attach a debugger to a running app, it is > not heinously difficult either (although it may be problematic to > attach a debugger to a productiuon environment). > > But what do I do if it's Ruby? You can write a singnal handler that outputs current thread states. set_trace_func may help here also. Kind regards robert