-1

I am writing a PinTool, which can manipulate certain register/memory value. However, after manipulation, one challenge I am facing now, is the deadloop.

In particular, due to the frequent manipulation of certain register value, it is indeed common to create deadloop in the execution trace. I am thinking to detect such case, and terminate the execution.

So here is my question, what is a good practice to detect a deadloop in a PinTool? I can come up with some naive solutions, say, record the executed instructions, and if certain instruction has been executed for a large amount of times, just terminate the execution.

Could anyone help me on this issue? Thank you.

lllllllllllll
  • 8,519
  • 9
  • 45
  • 80

1 Answers1

0

Detecting whether a program will terminate isn't a computable problem in general, so no, I don't think it's a good idea.

nitzanms
  • 1,786
  • 12
  • 35
  • I mean, as I am doing dynamic analysis, I can cut the execution when the processing time exceeds a pre-defined threshold.. Do you think it is a good idea? – lllllllllllll Mar 27 '16 at 13:32
  • How do you know that the predefined limit is due to an issue with the loop variable as opposed to a very long loop? – nitzanms Mar 29 '16 at 03:47