From: "Florian Groß" Date: 2006-01-23T06:24:49+09:00 Subject: Re: Debugging endless loops Alexey Verkhovsky 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? > > But what do I do if it's Ruby? This might work and give you a remote debugging back door. I'm just not sure if it will survive deadlocks: require 'breakpoint' Breakpoint.activate_drb Thread.new do Thread.current.priority = 100 loop do begin breakpoint rescue Exception end end end You can then connect to your application with breakpoint_client. You'll need the ruby-breakpoint library which is available from http://ruby-breakpoint.rubyforge.org/ -- http://flgr.0x42.net/