From: Alexey Verkhovsky Date: 2006-01-23T07:45:11+09:00 Subject: Re: Debugging endless loops Eero Saynatkari wrote: >>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? >> >> >Can you do ruby -rdebug program.rb instead of running it normally? > > By the conditions of our imaginary problem, we only reproduce our endless loop in the production environment, and -rdebug makes a typical Ruby code two orders of magnitude slower, so this wouldn't do. Florian Groß wrote: > This might work and give you a remote debugging back door. I'm just not sure if it will survive deadlocks: > require 'breakpoint' ... > You can then connect to your application with breakpoint_client. Hi, Florian, Remote 'breakpointer' might be a workable idea. But when I am in IRB, how do I get stack traces for all currently running threads? Rest assured, I do know where to find 'breakpoint' library - I keep telling about it to everyone pissed off or puzzled by the absence of a decent debugger in the Ruby world. Alex