Debugging help needed

I have an odd problem I'm stumped on how to debug. I'm running Rails
2.3.5 under rvm. I'm doing a new test that *should* work but it does
not. My test is I clear my database so it is empty and then start a
request. Its a complex application that interacts with another legacy
server fetching things, putting them into the database, and then
presents a final rendering.

I make the request and I see my ruby process (using top) consume cpu of
varying degrees (16% up to 50%). Then it goes to 100% and sits there.
At that point, my log file stops growing. The last few entries are:

Cached fragment miss: views/PEDZ,S,165,405-1301358353.887364-qs (0.3ms)
Rendered retain/qs/_qs_row (990.1ms)
Rendered layouts/shared/_doctype (0.3ms)
Rendered layouts/shared/_header (1.6ms)
Rendered layouts/shared/_body (0.8ms)

But I do not have the Completed entry that usually ends each request.
So it is stuck somewhere after most of the rendering, perhaps in the
sending stage. And that is what I need help with. How do I find where
it is getting stuck at?

Thank you,
pedz

I have an odd problem I'm stumped on how to debug. I'm running Rails
2.3.5 under rvm. I'm doing a new test that *should* work but it does
not. My test is I clear my database so it is empty and then start a
request. Its a complex application that interacts with another legacy
server fetching things, putting them into the database, and then
presents a final rendering.

I make the request and I see my ruby process (using top) consume cpu of
varying degrees (16% up to 50%). Then it goes to 100% and sits there.
At that point, my log file stops growing. The last few entries are:

Cached fragment miss: views/PEDZ,S,165,405-1301358353.887364-qs (0.3ms)
Rendered retain/qs/_qs_row (990.1ms)
Rendered layouts/shared/_doctype (0.3ms)
Rendered layouts/shared/_header (1.6ms)
Rendered layouts/shared/_body (0.8ms)

But I do not have the Completed entry that usually ends each request.
So it is stuck somewhere after most of the rendering, perhaps in the
sending stage. And that is what I need help with. How do I find where
it is getting stuck at?

Remember that tests run inside a transaction by default so you can't see changes they've done to the database unless you fiddle with transaction isolation levels.

One thing you can do is use gdb to attach to the process and then call rb_backtrace to get the ruby backtrace for what's executing (there's other stuff you can do too - there are a few ruby/gdb blog posts floating around if my memory is correct.

Fred

Thank you very much for the pointers. I found the blogs and it made
life very simple!