0

My C# application throws Null reference exception, I tried to collect the user mode dump and check the call stack, no obvious clue I can find. The partial call stack is as follows:

ntdll!RtlDispatchException+197     0000054`00000000     0007fff`e43f0000     0000054`e3bae230     0007fff`e4526154    
ntdll!RtlRaiseException+18d     0000000`00000068     0000000`00000000     0000000`00000000     0000000`00000101    
KERNELBASE!RaiseException+68     0000000`00000000     0000000`00000000     0000000`00000000     0007fff`7f8476d0    
clr!NakedThrowHelper2+9     0000000`00000000     0000054`e3bae850     0000054`e3bae8a0     0000000`00000000    
clr!NakedThrowHelper_RspAligned+1e     0007fff`7f8476fe     0000054`e3bae8c0     0007fff`d017547e     0000054`e5c899e8    
clr!NakedThrowHelper_FixRsp+5     0000054`e3bae8c0     0007fff`d017547e     0000054`e5c899e8     0000000`00000004    
DomainBoundILStubClass.IL_STUB_ReversePInvoke(Int64, Int64)+2e     0000000`0045015e     0000000`00000000     0000054`e3bae8f0     0007fff`de97222e    
clr!UMThunkStub+6e     0000000`00000000     0000000`00000000     0000054`e3baeb60     0007fff`e3f62522    
user32!DispatchHookW+56     0000054`e3baea48     0000000`00000000     0000054`e3baea28     0000000`00000000    
user32!_fnHkINLPKBDLLHOOKSTRUCT+3e     0000000`00000000     0000000`00000000     fffffab`1c1d9800     0007fff`e3f62463    
ntdll!KiUserCallbackDispatcherContinue     0007fff`e3f62ae6     0000000`00000000     0007fff`de974e65     0000054`e5c66078    
user32!NtUserPeekMessage+a     0000000`00000000     0007fff`de974e65     0000054`e5c66078     0007fff`de974e65    
user32!PeekMessageW+f6     0000000`00000000     0000054`e3baeb60     0000054`e3baebc0     0007fff`cfa56aba    
System_Windows_Forms_ni!DomainBoundILStubClass.IL_STUB_PInvoke(MSG ByRef, System.Runtime.InteropServices.HandleRef, Int32, Int32, Int32)+9b     0000054`e5c66078     0000054`e3baebd0     000cdf0`1cdb5a1c     0000054`e3baeb60    
System_Windows_Forms_ni!System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)+240     0000054`e5cb54f0     0000054`e5d2ff60     0000054`e5d2ffa0     0000000`00000000    
System_Windows_Forms_ni!System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)+1c7     0000054`e5c66078     0000054`ffffffff     0000054`e5c8f7f0     0000000`00000002    
System_Windows_Forms_ni!System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)+52     0000054`e5cd1a70     0000000`00000000     0000054`e3dba820     0000054`e3d736f8    
test.Program.Main()+7b     0007fff`de977060     0007fff`7f324148     0000000`00000000     0007fff`00000000    
clr!CallDescrWorkerInternal+83     0000054`e3baf088     0007fff`de9773bc     0007fff`de981800     0000000`06000097    
clr!CallDescrWorkerWithHandler+4e     0000054`e3baf088     0000054`e3baf118     0000054`e3baef88     0000000`00000000    
clr!MethodDescCallSite::CallTargetWorker+102     0000054`e3baeed0     0000000`00000000     0000000`00000000     0007fff`7f325af0    
clr!RunMain+25f     0000000`00000000     0000000`00000001     0000000`00000000     0000000`00000000    
clr!Assembly::ExecuteMainMethod+b7     0000054`e3d90ab0     0000054`e3baf4f0     0000054`e3d90ab0     0000054`e3dd75a0    
clr!SystemDomain::ExecuteMainMethod+643     0000000`00000000     0000054`e3a50000     0000000`00000000     0000000`00000000    
clr!ExecuteEXE+3f     0000054`e3a50000     0000054`e3bafb70     0000000`00000000     0000000`00000000    
clr!_CorExeMainInternal+b2     0000000`00000000     0007fff`deaacd90     0000000`00000000     0000000`00000000    
clr!CorExeMain+14     0000000`00000000     0007fff`00000091     fffffff`00000000     0000054`e3bafac8    
mscoreei!CorExeMain+112     0007fff`df50e990     0007fff`deaacd90     0000000`00000000     0007fff`df50e990    
mscoree!CorExeMain_Exported+cb     0007fff`df450000     0000000`00000000     0000000`00000000     0000000`00000000    
kernel32!BaseThreadInitThunk+22     0007fff`e24013f0     0000000`00000000     0000000`00000000     0000000`00000000    
ntdll!RtlUserThreadStart+34 

How can I find which one is null?

lusu
  • 1
  • 1
  • 2
    If it's a .NET exception, attach a .NET debugger to the program? – AKX Jul 30 '20 at 08:29
  • I use visual studio to perform a remote debug and it cannot break at the meaningful line although I set the exception settings in visual studio – lusu Jul 30 '20 at 08:31

0 Answers0