LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW created executable crashes after 2 weeks

For a project I use a cRIO-9030 controller with two analog input modules and a temperature module. It communicates with a PC for which I have created an executable using LabVIEW 2017. The PC gets the measured data form the cRIO via network shared variables and network streams, formats the data into something useful, displays this data and depending on user input will log some data. All not very exciting. The executable runs on a computer (Win10 64-bit) without the LabVIEW development environment (32-bit) but I have installed the RTE so it works. 

 

However, after almost two weeks of running this morning the following pop-up message was found on the screen

“Cardamon unexpectedly stopped working”.

The user interface was still visible but in Windows task manager the Cardamon.exe was gone. Closing the pop-up also closed the user interface.

 

I checked the Windows event viewer and found the following error logged. 

Windows Event ViewerWindows Event Viewer

The exception code 0xc0000374 means there is some sort of 'Heap Corruption Exception' generated by ntdll.dll but I have no idea what might cause this and how to debug this. 

 

If anyone has some advice or at least a direction I need to search in it would be highly appreciated. 

Is it also possible some other software program running on the PC could be the cause of this ?

0 Kudos
Message 1 of 5
(3,193 Views)

The starting point is monitoring the resource consumed by your application. Does the memory rises constantly in time? If it does, you have a memory leak, for example you continuously open some reference and never close it.

On the other side, it is quite unlikely if ever possible that a heap corruption is generated by another program.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 2 of 5
(3,172 Views)

Can you post your code?  Maybe someone on the forum can spot a memory leak.

 

 

aputman
Message 3 of 5
(3,156 Views)

Thanks for the replies.

 

I have monitored the resources used with the Windows 10 'task manager' and 'resource monitor' and I can see a steady increase in memory used but every now and again it gets cleaned up or something as the memory used reduces significantly, see below. 

 

Date\Time           CPU (%)  Mem (Mb)
-------------------------------------
14-03-2018 09:45       1.1    616.0
14-03-2018 19:35       1.4    711.2
15-03-2018 07:25       1.2   1072.6
15-03-2018 11:05       2.1   1207.0
15-03-2018 15:10       1.4    659.1
15-03-2018 17:10       1.4    730.4
15-03-2018 --:--       1.1    819.6
15-03-2018 21:35       1.1    407.7

 

I checked my code, its really a lot and likely not useful to post, with 'Analyze VI's' to maybe detect some obvious errors but there were no errors only a lot of suggestions and I couldn't see these as the source of the problem. So I also checked the code running with the Tools - Profile Performance and Memory.. function in LabVIEW 2017 but also no luck, can't see no memory increasing in any of the VI's

 

Profile Performance and Memory.PNG

 

Now I searched online and it seems that creating and modifying arrays in loops might cause memory issues but I cant seem to understand how I can improve my code without completely modifying it.

 

Next I used the LabVIEW Desktop Execution Trace Toolkit (DETT) but there were so many memory related 'things' in the log (allocate, resize and free) that it was very hard to check but again, it seemed that all memory that was allocated was also released I think.

 

The fact that the memory used by my LabVIEW executable increases and than somehow suddenly gets smaller, is that something normal ? Is the LabVIEW executable doing that or Windows ?

 

Hope someone can point me in the right direction, thanks.

Message 4 of 5
(3,116 Views)

Are there other Programmers that you trust around you?  If they know LabVIEW, that's even better.  Things like Memory leaks can be tricky to find -- you need to find where memory is allocated and where it is released (Arrays are good places to look, as are loop structures).  The Best Thing to do is to get some good LabVIEW Developers together and present your code to them (or let them have a good look at it and pick it to pieces without input from you, i.e. post everything (the entire Project, compressed into a Zip file) on the Forum).  However, presenting it to other Programmers (LabVIEW or not), letting them ask questions ("Why are you doing it this way?" or "What does this do?") often leads to "Well, this is supposed to ... oooh, I forgot to wire this! ...".

 

 

It can be very difficult to find subtle errors that you built into your code.  Explaining it (slowly) to someone else, particularly if you allow them to ask questions, can be very revealing.

 

Bob Schor

 

P.S. -- it takes some getting used to, but it is frequently easier to do your testing/verification as the code is being developed, as opposed to "after the fact" ...  I just beginning to learn this, myself.

Message 5 of 5
(3,108 Views)