0

I have a python 2.7 application, which uses multiple threads. I currently run into a bug that there is some sort of infinite loop somewhere in one of the threads. Reading about this, I tried to run python with -m trace to trace where the loop is coming from (compare post).

When I run the application with -m trace I get an import error. If I run it without -m trace I do not get an import error. Any idea why and how else I should debug the application?

things I already tried for debugging:

  • stepping through the app with vs code debuggin. Does not work, because it hangs in some other thread.

  • using -m trace. Compare above

  • using prints. Might work, but is not a good solution, because the application is quite large

User12547645
  • 6,955
  • 3
  • 38
  • 69

1 Answers1

0

I was able to solve this by using strace and following all writing activity of my code. The exact command I used was strace -e trace=write my_script.py &> output.txt.

I would recommend to write the output to a file, because strace is quite verbose.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
User12547645
  • 6,955
  • 3
  • 38
  • 69