Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# .net应用程序在process explorer中开始挂起时被阻止,内存为1 MB_C#_.net_Dump - Fatal编程技术网

C# .net应用程序在process explorer中开始挂起时被阻止,内存为1 MB

C# .net应用程序在process explorer中开始挂起时被阻止,内存为1 MB,c#,.net,dump,C#,.net,Dump,我有一个用C#编写的Windows窗体应用程序,它的目标是.net framework 4.8。 我在客户的PC上运行Windows 7 x86上的此应用程序。我的应用程序运行良好,但有时在发布时我会遇到一个神秘的问题。有时我的应用程序只是拒绝启动,但当我打开process explorer时,我会看到MyAplication.exe,它拥有1MB的RAM。似乎有什么东西阻止了我的申请。 我检查了windows事件日志,但没有错误。我还试图写入Program.cs第一行的日志文件,但根本没有发生

我有一个用C#编写的Windows窗体应用程序,它的目标是.net framework 4.8。 我在客户的PC上运行Windows 7 x86上的此应用程序。我的应用程序运行良好,但有时在发布时我会遇到一个神秘的问题。有时我的应用程序只是拒绝启动,但当我打开process explorer时,我会看到MyAplication.exe,它拥有1MB的RAM。似乎有什么东西阻止了我的申请。 我检查了windows事件日志,但没有错误。我还试图写入Program.cs第一行的日志文件,但根本没有发生。我杀死这个1MB进程并重新启动我的应用程序。它会打开并正常工作,否则我必须重新启动它几次。我的另一个WPF应用程序甚至外部供应商的.net应用程序都遇到过这种1MB RAM问题。我使用process explorer为我的应用程序创建了一个转储文件。 在Windows 10上的个人电脑上,我使用Windows应用商店中的WinDbg应用程序分析应用程序的转储文件。我看到以下情况:

FAULTING_THREAD:  000002a0
PROCESS_NAME:  MyApplication.exe
ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION}  Breakpoint  A breakpoint has been reached.
EXCEPTION_CODE_STR:  80000003
MISSING_CLR_SYMBOL: 0

STACK_TEXT:  
002be670 77176c04 ntdll!KiFastSystemCallRet+0x0
002be674 771765ac ntdll!NtWaitForSingleObject+0xc
002be678 77161db1 ntdll!RtlpWaitOnCriticalSection+0x13e
002be6dc 77161c95 ntdll!RtlEnterCriticalSection+0x150
002be704 76e5cc0f rpcrt4!PerformRpcInitialization+0x29
002be748 76e665fd rpcrt4!RpcStringBindingComposeW+0x15
002be758 72ab1ec0 DialogFilterProc!InitDialogFilterProc+0x32d
002be810 72ab18b3 DialogFilterProc!ReleaseDialogFilterProc+0x17d
002be828 72ab2157 DialogFilterProc!InitDialogFilterProc+0x5c4
002be844 72ab22be DialogFilterProc!InitDialogFilterProc+0x72b
002be8a4 771887cc ntdll!LdrpCallInitRoutine+0x14
002be8c4 77195adb ntdll!LdrpRunInitializeRoutines+0x26f
002be9b8 7718faf2 ntdll!LdrpLoadDll+0x472
002beb2c 77192105 ntdll!LdrLoadDll+0xaf
002beb64 7523b246 KERNELBASE!LoadLibraryExW+0x215
002bebac 772aefa4 user32!__ClientLoadLibrary+0x60
002bece0 77176b3e ntdll!KiUserCallbackDispatcher+0x2e
002bed7c 772b4f21 user32!NtUserMessageCall+0xc
002bed80 772e5d6e user32!CallNextHookEx+0x10b
002bedb0 6d460ef0 tiptsf!TabletCallWndProc+0x5f
002bedd0 772a7a02 user32!DispatchHookW+0x33
002bedec 772a4999 user32!fnHkINLPCWPSTRUCTW+0x52
002bee20 772ae952 user32!__fnINLPCREATESTRUCT+0x8b
002bee50 77176b3e ntdll!KiUserCallbackDispatcher+0x2e
002beec4 772aeb5c user32!NtUserCreateWindowEx+0xc
002beec8 772aeaf0 user32!VerNtUserCreateWindowEx+0x1a3
002bf16c 772aec1c user32!_CreateWindowEx+0x201
002bf218 772aec77 user32!CreateWindowExW+0x33
002bf254 7682633f ole32!InitMainThreadWnd+0x3e
002bf28c 768263fc ole32!wCoInitializeEx+0xef
002bf2a4 768209ff ole32!CoInitializeEx+0x2ee
002bf2c4 7124ab8f clr!Thread::SetApartment+0x13b
002bf310 7123e1b7 clr!SystemDomain::SetThreadAptState+0x92
002bf330 7123e892 clr!SystemDomain::ExecuteMainMethod+0x18c
002bf810 71242498 clr!ExecuteEXE+0x4c
002bf868 712425be clr!_CorExeMainInternal+0xdc
002bf8a8 7123def5 clr!_CorExeMain+0x4d
002bf8e4 7185fa84 mscoreei!_CorExeMain+0xd6
002bf91c 718e7f16 mscoree!ShellShim__CorExeMain+0x99
002bf92c 718e4de3 mscoree!_CorExeMain_Exported+0x8
002bf934 7616ef3c kernel32!BaseThreadInitThunk+0xe
002bf940 77193618 ntdll!__RtlUserThreadStart+0x70
002bf980 771935eb ntdll!_RtlUserThreadStart+0x1b

SYMBOL_NAME:  DialogFilterProc!InitDialogFilterProc+32d
MODULE_NAME: DialogFilterProc
IMAGE_NAME:  DialogFilterProc.dll

STACK_COMMAND:  .ecxr ; kb ; dt ntdll!LdrpLastDllInitializer BaseDllName ; dt ntdll!LdrpFailureData ; ** Pseudo Context ** Pseudo ** Value: 88f6c30 ** ; kb

FAILURE_BUCKET_ID:  BREAKPOINT_80000003_DialogFilterProc.dll!InitDialogFilterProc
OSPLATFORM_TYPE:  x86
OSNAME:  Windows 7
IMAGE_VERSION:  1.0.299.0
FAILURE_ID_HASH:  {e56a1c21-26f9-3e25-d015-b9f79339b457}
Followup:     MachineOwner
附言:我禁用了防病毒和windows defender,但这并没有解决我的问题。 我无法在客户的PC上访问internet。不确定这是否会对我的问题产生影响


有人能帮我解决这个神秘的问题吗?任何想法都非常感谢

让我们读取调用堆栈

clr!_CorExeMain
clr!_CorExeMainInternal
达到管理代码的主要方法(SystemDomain::ExecuteMainMethod)

主方法上很可能有一个STAThread单元属性,因为 有一个COM装置状态设置为Thread::SetApartment

clr!Thread::SetApartment
COM初始化(CoInitializeX)

COM需要一个隐藏窗口来传输消息(CreateWindowExW)

在本例中,tiptsf已将(DispatchHookW)挂接到窗口创建中,以注入其自身的功能(TabletCallWndProc)。我怀疑这是微软墨水公司的

tiptsf!TabletCallWndProc
user32!CallNextHookEx
user32!NtUserMessageCall
ntdll!KiUserCallbackDispatcher
user32!__ClientLoadLibrary
这将加载一些扩展dll

KERNELBASE!LoadLibraryExW
ntdll!LdrLoadDll
ntdll!LdrpLoadDll
ntdll!LdrpRunInitializeRoutines
ntdll!LdrpCallInitRoutine
现在我们初始化DialogFilterProc,它在

在我的Win10机器上找不到此DialogFilterProc。这是Windows7机器吗?这一个根本没有文档记录,所以这里几乎没有关于这一个尝试做什么的信息。据报道,这似乎是一个系统服务,可以被禁用,因此挂起

DialogFilterProc!InitDialogFilterProc
DialogFilterProc!InitDialogFilterProc
DialogFilterProc!ReleaseDialogFilterProc
DialogFilterProc!InitDialogFilterProc
DialogFilter调用明显挂起的。从文件中 我可以看到它处理进程间通信。 COM单元尚未完全初始化,导致此RPC方法挂起,或者无法建立远程连接。 例如,参见使用此方法的示例

rpcrt4!RpcStringBindingComposeW
rpcrt4!PerformRpcInitialization
ntdll!RtlEnterCriticalSection
ntdll!RtlpWaitOnCriticalSection
ntdll!NtWaitForSingleObject
ntdll!KiFastSystemCallRet
如果第一个问题是Microsoft Ink的过早加载,您可以尝试禁用它,并检查它是否能够解决您的问题。如果问题仍然存在,可以尝试在主方法上设置[StatThread]或[MTAThread]属性。也许另一种公寓模式也能解决你的僵局。 或者,如果这确实是一个对话框过滤器,它试图调用一个确实崩溃或未运行的服务,那么您需要重新启动该服务,以使您的UI弹出。 正如我可以(希望)向您展示的那样,通过任何方法都可以很容易地发现它在做什么,以及如何关闭它。基于此,您现在应该有很多进一步的选择来探索实际的根本原因或找到肮脏的解决方法

加法 您的DialogFilterProc.dll的版本为1.0.299.0,似乎比2012年修订版中的版本1.0.542.0旧。安装古老的修复程序可能是解决问题的方法

> File name File version    File size   Date    Time    Platform
> Dialogfilterproc.dll  1.0.542.0   13,312  24-Jul-12   17:11   x86

哇!我真的有很多东西要测试。我会尝试一下并给你反馈。非常感谢你!Windows 7 PosReady的窗口修复程序解决了我的问题(.NET基于框架的应用程序,使用对话框过滤器功能,在运行Windows Embedded PosReady 7或Windows瘦PC的计算机上冻结)
DialogFilterProc!InitDialogFilterProc
DialogFilterProc!InitDialogFilterProc
DialogFilterProc!ReleaseDialogFilterProc
DialogFilterProc!InitDialogFilterProc
rpcrt4!RpcStringBindingComposeW
rpcrt4!PerformRpcInitialization
ntdll!RtlEnterCriticalSection
ntdll!RtlpWaitOnCriticalSection
ntdll!NtWaitForSingleObject
ntdll!KiFastSystemCallRet
> File name File version    File size   Date    Time    Platform
> Dialogfilterproc.dll  1.0.542.0   13,312  24-Jul-12   17:11   x86