11-25-2008 10:03 AM
I'm building an application on LV using TABs, FPGA DLLs and DLLs that comunicate with CAN, GPIB and PCI devices.
The program apears to work properly but sometimes, and I can't see the patern, it crashes with the error "the application has encountered a problem and needs to close..."
Sometimes the error apears when I'm trying to exit the program, some other times it crashes before that.
I can't find the error because the program may work well for several hours and then crash or it crashes after 5 minutes of working with it.
Any clues on what is going wrong?
Regards,
Daniel Coelho
Solved! Go to Solution.
11-25-2008 10:45 AM
Hi, Daniel,
Such sporadical crashes usually are very hard for fixing. In most cases problems occurred in external DLLs (error in parameters transferred to DLLs, some memory issues - for example wrong pointer when relelasing memory, writing out of allocated memory, etc). In WindowsXP in some cases you can see which DLL caused crash (Details button as I remember).
Typical scenario for fix (if you don't know where exactly crash occurred) is following: remove parts of code step by step until your application will be OK. Then you will localize the problem. If there are some DLLs called in cycles with delays, then try to reduce delays - this "stress test" may give you exception faster. Also logging of the execution may be helpful. Refer to this thread, for example. This is "intrusive debugging" technique, but may give you immeiaditely the point where execution was interrupted.
Andrey.
11-25-2008 01:28 PM
I'm still going through the example, but since the error ocours sporadicaly this could take some time to pinpoint the error.
I was reviewing the code and I was wondering about some simple things, like:
- I have to many local variables, could this be causing somekind of an error?
- since I'm using DLLs on my code, are there a way to make sure that all DLLs are loaded and unloaded correctly?
My program has a TAB with a simple TestStand user interface and when I change TABs I close the teststand ui; when I use that user interface I load and unload the same DLLs that I use on the other TABs, i. e., when using the UI I load all the DLLs that comunicate with the devices and when I change TABs I unload all the DLLs because on each separate TAB I can control those devices indicidually.
It's a bit hard to explain but I think I managed 😛
Is there some truth on my questions? If so, what could I do?
01-19-2009 10:03 AM
Hi Andrey,
your post was helpful.
I read that thread and I tried that "intrusive debuging" and I managed do fing a thing or two.
Sorry for the delay.
Thanks.
Daniel Coelho