Share via

Faulting module ntdll.dll error in net10

Bevan Thomas 0 Reputation points
2026-03-12T10:43:08.6966667+00:00

I have an application which has both its 32-bit and 64-bit variant.I recently retargetted it to net10 from net8.64-bit application works fine.But the 32-bit application crashes with following error -:

Faulting module name: ntdll.dll, version: 10.0.19041.6456, time stamp: 0x5f1a1fa5

Exception code: 0xc0000374

Fault offset: 0x000f4b53

Faulting process id: 0x8f8

Faulting application start time: 0x01dcb207f3ab8556

The error happpens where we call managed code from unmanaged code.

Developer technologies | .NET | .NET Runtime

1 answer

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 16,040 Reputation points Microsoft External Staff Moderator
    2026-03-13T03:41:53.3233333+00:00

    Hi @Bevan Thomas ,

    Thanks for reaching out.

    Looking at this more closely, the exception code 0xc0000374 usually indicates heap corruption, meaning memory was likely misused earlier and Windows only detected it later. When the crash appears in ntdll.dll, it often means the operating system noticed the corrupted memory there rather than it being the original source.

    What stands out to me is that the problem only happens in the 32-bit build, while the 64-bit version runs without crashing, and it occurs during unmanaged-to-managed calls. With that in mind, I’d lean toward reviewing the interop boundary between native and managed code, since small differences in memory layout can show up only in x86.

    Some areas that might be worth checking include struct layouts, pointer representations, and calling conventions. Also, if unmanaged code stores a pointer to a managed delegate, it’s possible the delegate could be collected by the garbage collector unless a reference is kept on the managed side.

    Since heap corruption is usually detected after the actual problem occurs, enabling Page Heap with gflags can help catch invalid memory writes closer to the source. Microsoft documents this approach here:

    https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/enable-page-heap

    https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/gflags-and-pageheap

    If you found my response helpful or informative in any way, I would greatly appreciate it if you could follow this guidance provide feedback. 

    Thank you.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.