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
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:
#ifdef debug
printf "%s entering %s", time(), GetRTStackInfo(1)
#endif
and so on....
February 2, 2022 at 03:38 am - Permalink
you could also look at the function profiling code that ships with Igor.
February 2, 2022 at 03:48 am - Permalink
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.
February 2, 2022 at 06:07 am - Permalink
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.
February 2, 2022 at 06:20 am - Permalink
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.
February 2, 2022 at 07:35 am - Permalink
The advice provided by others is good advice.
Aside from that, if Igor seems to be hung, you can do the following:
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.
February 2, 2022 at 08:53 am - Permalink
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 :)
February 2, 2022 at 11:07 am - Permalink
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
February 3, 2022 at 05:29 am - Permalink