Debug Infinite Loop?

S

Stuart D. Gathman

I have a multi-threaded background program in Python
(http://www.bmsi.com/python/milter.html). Rarely, several threads will
get themselves into an infinite loop. The system continues to run - but
with more and more of the CPU eaten by the looping threads. stderr is
connected to a logfile, and exceptions print stack traces to the logfile -
so debugging them is easy. However, I haven't been able to find a way to
cause a looping thread to terminate with a stack trace. I am on RedHat
7.2. Sending SIGINT to the looping thread doesn't do anything. The
situation may be complicated by the fact that the application uses
libmilter - a C library which does signal handling in its own C thread
(initiating an orderly shutdown on SIGTERM). This may be interfering
with reception on SIGINT by python threads.

I am looking for the best way to get a stack trace from a looping
Python background thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top