LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to resolve and debug access violation Error.

Solved!
Go to solution

Hello

 

I'm stucked with an access violation error which forces my exe build to shut down. I tried also from development environment but its the same there. The error happens after 5-60minutes.

I played around with disabling a part of the program where it was possible and I think I'm now able to accuse the vi "gastimer.vi". But since this vi leads through the measurement procedure, there are some commands outgoing which I was not able to map one to one.

 

My question is: what can cause such access violation errors? I have no dll calls, no third party library, actually the hardware communication is done serial by COM ports. The architecture principle is something adapted from producer consumer loop, except that i have often more than one consumer, so I called them like controller loop - multiple task. The communication within this loops (tasks) are done by queue cluster with an enumerator and variant.

 

The indicted vi "gastimer.vi" was transfered from an older and more simply architecture. This vi works with sequence structure and a lot of local variables.

 

Since I'm testing sensor on their response to gas concentration I have 10 comports to which I'm listening in parallel.

 

What styles or archtiecture are prone to access violations? Where can they happened? where should I look more carefully in the code?

How can I use the desktop execution trace toolkit to get more information about the cause of the access violation?

 

Attached are two different lvlog but I guess with the same error source. In the second lvlog are two vi's named. What have they to do with the access violation error? What kind of information can i get from these lvlog files?

 

Last attachement shows a runtime fatal error which happens quite a bit frequently in the recent time when working with this project. Might there be a connection, propably a crashed vi, typedef or whatever?

 

Thanks for any help

U. Siegenthaler

Download All
0 Kudos
Message 1 of 10
(7,635 Views)

Hi urssieg,

 

I found a KB which should help you:

 

LabVIEW Internal Errors (Failure in XXX.c / XXX.cpp at line YYY)

http://digital.ni.com/public.nsf/allkb/01B186B5CEB1D07786256747000F4319

If you have still question on this feel free to ask, but I would recommend that you first look through the KB.

 

Best Regards

 

Matijas

0 Kudos
Message 2 of 10
(7,582 Views)

Are you still having problems ? 

 

Best regards

 

Matijas

0 Kudos
Message 3 of 10
(7,536 Views)

Hi Matijas

 

Yes, still having access violation problems. Your KB is more about fatal internal errors, but the fatal internal errors are not the problem. I thought they could be a possible cause to receive access violations.

 

So, I'm still receving Access Violation 0xC0000005 errors when running the application from exe or from development system.

 

I'm using two dll calls which are from NI vi's. Those are from savitzky-golay filter and Levenberg-Marquart algorithm

 

best regards

Urs

0 Kudos
Message 4 of 10
(7,511 Views)

 Have you checked your code to try to isolate any areas of possible memory leaks? I was able to find some discussion forums with similar problems. Check out the links below to see if any of these resources can be of assistance to you. 

"Exception: Access violation (0xC0000005) at EIP=0xFDD76383" 
http://forums.ni.com/t5/LabVIEW/Exception-Access-violation-0xC0000005-at-EIP-0xFDD76383/m-p/2257502 

"Exception: access violation (0xc0000005) at EIP=0x00BD0984 " 
http://forums.ni.com/t5/LabVIEW/Exception-access-violation-0xc0000005-at-EIP-0x00BD0984/m-p/2303864 

"Access violation (0xC0000005)" 
http://forums.ni.com/t5/LabVIEW/Access-violation-0xC0000005/m-p/2269694 

Let me know what you find and if you have any other questions. 

 


Best regards

 

Matijas

0 Kudos
Message 5 of 10
(7,505 Views)

I checked all areas of possible memory leaks, but I'm not aware of any memory leak. How can I verify that i have no memory leak? How can I use the execution trace toolkit for that?

 

I checked all this discussions, but their problem seems to be not the same as my. In all these discussions they have either a camera setup or are calling some external code from labview. I do not have any camera and I'm not aware of any external driver sources.

 

 

0 Kudos
Message 6 of 10
(7,496 Views)

Could this KB help you ? 

http://digital.ni.com/public.nsf/allkb/CE69D2C55480900486257B6A0037C327?OpenDocument

I know it says that this only happens at the EXE but you could try it and then post back if it doesn't work

 

 

Regards,

 

Matijas

0 Kudos
Message 7 of 10
(7,484 Views)

Hi Matijas

 

This is not a option for me because I do not have a dll library call from my own vi's. I have only two dll calls and these are from a National Instrument vi. Furthermore due to my investigation with disabling code I would say that the error does not happen when the application is calling these libraries.

 

what are other causes for a access violation aside from third party libraries call, tdms vi?

 

 

0 Kudos
Message 8 of 10
(7,477 Views)
Solution
Accepted by topic author urssieg

I solved the problem. The crash did not occur anymore.

 

I found a bug in my queue reference maintainance. I have a register where I register queue Reference and delete them again from this register. The bug was that under certain conditions I deleted the wrong queue reference from the register. This bug had the consequence that there was a queue reference in the register which should had be deleted. The application tried now to enqueue an element on this queue Ref where in the same time somewhere else in the application a process tried to release this queue reference. Apparently, if those two events occure at the same time or at a special timing this gives an access violation crash.

 

My suggestion for all of you with an access violation crash: Have a look at your queue reference maintaince and check whether you are releasing queues in the same time as you are enqueuing elements.

 

Best Regards and thanks for the help

urs

0 Kudos
Message 9 of 10
(7,432 Views)

Glad to hear that 🙂

 

Best regards

 

Matijas

0 Kudos
Message 10 of 10
(7,427 Views)