LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Application crash

Sure sounds like a buffer over-run of some sort that is usually benign but occasionally causes problems, especially since the frequency went down with DEP turned off. 

 

Menchar

0 Kudos
Message 11 of 22
(2,206 Views)
Is there any useful information in the .dmp file?  We very rarely encountered crashes on the previous system, which was running Windows Server 2003.  DEP was probably turned off by default on that system, however.
0 Kudos
Message 12 of 22
(2,188 Views)

Hello -

 

I've gotten the .dmp, and have begun to look at it. The cause of the crash is clear (a result of the failed assertion mentioned in the log file), but why the run-time engine got into this state is still somewhat unclear.  I will continue to look at the crash dump, and let you know what I find. 

 

Troubleshooting these types of issues always becomes easier with more data points.  I know the crashes do not happen frequently, but if you could post the crash dump for any more of the crashes you see, that will help speed things along.

 

Thanks!

 

NickB

National Instruments 

0 Kudos
Message 13 of 22
(2,177 Views)

Just curious - from your crash dump, I can see that you are running multiple threads in your application.  Are you calling the Delay function from any threads besides the main UI thread?  We have recently realized that under some circumstances, the Delay function is not threadsafe.  This has been addressed for the upcoming CVI 2009 release.

 

However, if you are using Delay in threads other than the main UI thread, you could try replacing them with the Windows SDK sleep() function to see if this makes any difference.

 

NickB

National Instruments 

0 Kudos
Message 14 of 22
(2,170 Views)

Yes, I am calling Delay from two different threads.  I will try calling sleep instead and see if that has any effect.

0 Kudos
Message 15 of 22
(2,150 Views)
I'm including <windows.h> in my program and have added Kernel32.lib to my project, which are the required items to use sleep.  The program will not compile, however, squawking about a missing prototype for every call to sleep.  Is there some setting I am missing?
0 Kudos
Message 16 of 22
(2,137 Views)

I'm probably on the wrong track here but, just for confirmation, you are using Sleep() instead of sleep(), aren't you?

 

JR

0 Kudos
Message 17 of 22
(2,133 Views)
Yeah, I caught that right before your reply.  I have now successfully built the project.  I'd better get some caffeine at lunch.  
0 Kudos
Message 18 of 22
(2,128 Views)

Or SleepEx ()

 

To keep the GUI responsive it's convenient to Sleep() in increments and wake up periodically to process system events.

 

The NI Delay() function has been something of an enigma for years.  I never use it, it seems it always has some unexpected behavior.  And there was a guy on the forum a while back that was rather steamed about it Smiley Surprised

 

Sleep or SleepEx, on the other hand, are solid and part of Win32 API and I'm sure the Win64 API.

 

I don't think you need to explicitly link in a library for the Win32 API - just include windows.h (the NI version)  before any other includes.

 

Menchar

0 Kudos
Message 19 of 22
(2,127 Views)

Hi,

 

I've been having a very similar issue with my application and tried changing my Delay functions to Sleep.  I'm currently testing the software to determine if this fixes it but it's so intermittent that it may take some time. I just wanted to know if this fixed your issue...

 

Thanks

0 Kudos
Message 20 of 22
(1,614 Views)