LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview crash, 0xc0000005, mgcore_SH_26_1.dll

Solved!
Go to solution

I've been using Labview quite smoothly for the past 3 years but the recent week is a big disaster...

 

So my codes have been smooth and normal until Apr 6th, then when I tried to run it again on Apr 8th, it started to have problems. (strangely, nothing like a windows update has happened)

The program can run for a short bit of time, but then would crash and flash close with no apparent error message.

In task manager nothing was crazy/off. Just ~30% of CPU and memory were being used.

 

This computer is on windows10, and the labview I'm using is on 2023 Q1.

 

When I checked the event viewer, it seems that the crashing reason is:

Exception code:0xc0000005

And the file related to the crash is: C:\Program Files\National Instruments\LabVIEW 2025\resource\mgcore_SH_25_1.dll

 

I've tried the following things but none of them have worked:

1. Use "repair" in the NI package manager

2. Uninstall, and then reinstall.

3. I found the "uninstall" doesn't seem complete (I was first trying using NI package manager to uninstall other stuff, then in "add/remove program" to uninstall NI manager), and many folder were left on the computer, so I manually enter the safe mode to delete everything related to "National Instruments" in the following paths:

C:\Program Files

C:\Program Files (x86)

C:\ProgramData

C:\Users\<my user name>\Document

C:\Users\<my user name>\AppData\Local

C:\Users\<my user name>\AppData\Roaming

C:\Users\Public\Document

4. As for reinstall, I've tried the latest version 2025 Q1, or 2024 Q3, or 2023 Q1.

5. Some repeating combinations of "repair" "uninstall" "reinstall"

6. Besides this lab computer that I was using, I also tried my personal laptop, which is on windows11 and clean of any install. Surprisingly, the same crash issue occurs.

 

While I have not solved the crashing problem, some new problems arose as well: as of now, it seems that I couldn't normally download labview via the link from ni.com.

The error message for this:

"A error occurred while creating a process to run command: C:\Program Files (x86)\National Instruments\Shared\RegistrationWizard\Bin\RegistrationWizard.exe -rebootFirst .... "

 

So I found that in this path (C:\Program Files (x86)\National Instruments\Shared\), there is no folder named "RegistrationWizard".

 

Additionally, sometime there is also this error message:

"...\nimdnsNSP.dll" is blocked from loading into the local security authority

0 Kudos
Message 1 of 9
(485 Views)

The last message about the local security authority is covered extensively in this thread:

 

https://forums.ni.com/t5/LabVIEW/Local-Security-Authority-LabView-2024-Q3/td-p/4394721

 

Short version is that it's not a real problem, just a false positive, and it's fixed in the NI System Configuration 2025Q2 release.

 

"mgcore" appears to be a memory management DLL.  There's not a lot about it out there but there is this:

https://lavag.org/topic/17810-memory-deallocation-bug/page/2/

 

Since it's a memory management problem, it could indicate faulty RAM.  Perhaps try running the "Windows Memory Diagnostic" tool that will scan all the RAM on your PC for problems.

 

I'm not sure of the best way to reinstall, though.

 

Message 2 of 9
(456 Views)
Solution
Accepted by topic author anxious_labviewer

Thanks for pointing to the two threads! very helpful 😊

 

As a quick check, I followed what is discussed in the second link:

1. Cut mgcore_SH_25_0.dll, and save it elsewhere

2. renamed mgcore_25_0.dll to be mgcore_SH_25_0.dll

 

This is definitely improving - previously I can only run ~6 trials, now I'm at the 14th trial and the code has not crashed yet.

 

Will double check tmr and if it's really working safely I will call this as resolved!

0 Kudos
Message 3 of 9
(434 Views)

I am also facing random Labview crashes that lead to this dll. I analyzed the dump file and this is the summary: INVALID_POINTER_READ_c0000005_mgcore_SH_24_1.dll!Unknown

Does anybody know, is there some update from NI that fixes this issue?

 

I am using Labview 2024Q1 x64

Thanks!

0 Kudos
Message 4 of 9
(117 Views)

The mgcore DLL is basically the Manager Core library containing all the low level manager APIs in LabVIEW including the memory management library. A crash in here is almost never the problem of this library but something else your application does. While bugs in any part of LabVIEW can be the culprit, my estimate is that in far the most cases, it is something that the actual user LabVIEW program does.

A very popular cause is anything that tries to interface to DLLs through the Call Library Node. This is where bugs easily can slip in since LabVIEW has no way of verifying that the Call Library Node configuration is correct, nor that the shared library that is called is not doing some nasty things. And any error here can do anything from an immediate crash, to damaging some memory location that will later cause a crash in a completely unrelated part of the application, to seemingly do nothing but in reality damage some memory that contains your measurement values. Interfacing to .Net or ActiveX can also cause trouble if that component is buggy but it is much more difficult to do something wrong in the interface configuration since most happens automatically. No such automatism exists for standard DLLs, since that was not part of the design when DLLs were invented.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 9
(107 Views)

Thanks rolfk, thanks for the info.

The problem is that we did not have these issue with LV2019 and windows 7. 

But last year we upgraded to LV24 and windows 10 and this is when we started to get these LV crashes. 

Another awkward thing is that the same code is not crashing every time. I run the same thing over and over with no crash, and then randomly the crash is happening.

At the moment i am waiting for the thing to crash and get the full dump for analyze.

 

I even had a service ticket active at NI, which i will probably need to open again, because of this issue. The dump file was analyzed and it was leading to Waveform Min Max.vi. I am calling this VI in a for loop, using parallel iterations. can this cause the memory corruption?

I don´t think the Waveform Min Max.vi itself is the issue, but combined to this parallel iterations might lead to unexpected behavior and LV crashing.

Marian_G_0-1752570419639.png

 

0 Kudos
Message 6 of 9
(99 Views)

I could reproduce the crash after 3 hours of running the code.

now i am generating full dmp files. 

But it looks like i can only fully debug the dmp file if i have the labview symbols which come in some.pdb files. 

Anybody knows where i can find these files?

Thanks!

0 Kudos
Message 7 of 9
(85 Views)

You can't. These pdb files are considered proprietary information as they give fairly deep insight into the LabVIEW source code architecture. Only members of the LabVIEW developer team have access to them.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 9
(75 Views)

that´s too bad...but understandable. 

0 Kudos
Message 9 of 9
(65 Views)