Igor program freezes, trying to troubleshoot

Hi, 

My Igor program gets stuck for long periods of time (an hour or more). Kindly see the image below. I have built a panel to analyze data. Now many a time the program randomly freezes when I click to save or perform any operations and saves after a long time. Other times, it saves perfectly fine without hiccups. I am trying to understand why this may be happening and how to troubleshoot my codes. What can cause this sort of freezing of the program? What should I look for to correct my codes? At this point, I am sitting at probably 8-10k lines of code in this panel so it's kinda hard to run through the whole thing line by line.. 

Kindly advise. This really hinders my work because an attempt to save has turned into a gamble. If I try to save in the middle of the day, the program may randomly freeze for 2-3 hours with me ending up losing time before it finally finishes saving and becomes usable again. So I just want to know what to investigate in my codes to troubleshoot this problem. 

I should also note that I am hosting this IGOR file on an external hard drive that is never disconnected from the computer. Could it be causing this issue?

Sincerely, 

Peeyush

Example image of the frozen program

Maybe add some debugging code to your functions.

Set a debugging option, maybe by defining a symbol that can later be commented out of the code:

#define debug

Then add code to your functions to help pinpoint the problem area:

function func1()
   
#ifdef debug
   printf "%s entering %s", time(), GetRTStackInfo(1)
#endif

and so on....

you could also look at the function profiling code that ships with Igor.

My experience is, that these freezes/slowdown are nearly always caused by disk errors or, for external drive, communication errors (bad USB cable for example). Especially, if the slowdown happens when you expect to read or write to disk. If Igor and your code worked before, try first checking disk using disk tools OS application and other hardware troubleshooting.  

If this Igor experiment is large, try moving it to another external disk, preferably SSD connected through USB3.1 or faster connection and see, if it helps. 

Even if you have thousands of lines of code, you seem to have a defined entry point to the problem (pressing "save" etc.). Just set a break point in the button code and click your way through until you hit the hanging part. You can narrow things down from there. I am sure that you can quickly pinpoint the problem down to a few tens of lines of code.

Our network administrators encourage storage on networked drives. I learned many years ago that the latency of such drives caused never-ending problems e.g. "IgorPro is not responding". More recently I encountered problems using my local USB SSD after trying to save a very large pxp. It seems that somehow the file got corrupted, most likely because the long save procedure was interrupted. I since have paid particular attention to the SSD activity light, and when saving a file, make doubly sure to wait until all blinking has ceased.

The advice provided by others is good advice.

Aside from that, if Igor seems to be hung, you can do the following:

  1. Open the Windows Task Manager
  2. On the Processes tab, find the Igor Pro process (make sure you select the one that is hung if you have multiple instances of Igor Pro running at the same time).
  3. Right click on the process and select "Create dump file". Windows will collect some information and display a dialog that shows you where the file was saved.
  4. Before you dismiss that dialog, open Windows Explorer and go to that location on disk and make sure you see the dump file.
  5. Send that dump file, and the contents of the Help->System Information dialog (for the version of Igor you are/were using) to support@wavemetrics.com.

It's often useful if you can collect 2 or 3 dump files. That way we can make sure that we're identifying the actual bottleneck.

Once we get the dump file we can usually identify what code is executing at the time of the hang. This may allow us to help you pinpoint the slow calls in your Igor procedures.

Sometimes we get complaints of slow saving from folks who have worked in an experiment file for a long time. Often the cause is a huge amount of text in the history. You can delete the text from the history if you don't need it. If you need only recent history, there is a Misc setting to limit the amount of history text that is saved.

This problem could appear like erratic behavior because it might affect one experiment file and not another.

Just shooting in the dark here :)

This is super helpful! Thank you so much for all your responses! I will try out all the advice :) 

@aclight: Thanks a lot, I will create a few dump files next time this happens and email them for your review. 

 

Again, thanks a ton, all! Really appreciate this. 

Sincerely, 

Peeyush