Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UseReleaseStack hangs at DestroyCleanupThread when registering COM dll on Win 2016 server #65

Open
algalg opened this issue Dec 12, 2018 · 1 comment

Comments

@algalg
Copy link

algalg commented Dec 12, 2018

When I try to register a COM Dll compiles with FastMM 4.992 with the UseReleaseStack option enabled then registration using tregsvr hangs. Also adding the dll into a COM+ application hangs as well as registration using regsvr32.

The callstack created from a process dump point to FastMM4.DestroyCleanupThread

.  0  Id: 1158.ee8 Suspend: 0 Teb: 00000000`00298000 Unfrozen
Child-SP          RetAddr           Call Site
00000000`0014f7f8 00007fff`5e3c3ebf ntdll!NtWaitForSingleObject+0x14
*** WARNING: Unable to verify checksum for ValidateUser.dll
00000000`0014f800 00000000`021a1029 KERNELBASE!WaitForSingleObjectEx+0x8f
00000000`0014f8a0 00000000`021a1072 ValidateUser!FastMM4.DestroyCleanupThread+0x29
00000000`0014f8d0 00000000`021a112e ValidateUser!FastMM4.FinalizeMemoryManager+0x12
00000000`0014f900 00000000`0218d29a ValidateUser!FastMM4.Finalization+0x1e
00000000`0014f930 00000000`0218dc24 ValidateUser!System.FinalizeUnits+0x6a
00000000`0014f990 00000000`0218d4a3 ValidateUser!System.Halt0+0xc4
00000000`0014f9d0 00000000`02195662 ValidateUser!System.StartLib+0x123
00000000`0014fa20 00000000`024bbaa8 ValidateUser!SysInit.InitLib+0x92
00000000`0014fa90 00007fff`61c3389f ValidateUser!ValidateUser.ValidateUser+0x38
00000000`0014fb30 00007fff`61c26c89 ntdll!LdrpCallInitRoutine+0x4b
00000000`0014fb90 00007fff`61c28700 ntdll!LdrpProcessDetachNode+0xf5
00000000`0014fc60 00007fff`61c4a0b3 ntdll!LdrpUnloadNode+0x40
00000000`0014fcb0 00007fff`61c4a034 ntdll!LdrpDecrementModuleLoadCountEx+0x6b
00000000`0014fce0 00007fff`5e3a02cd ntdll!LdrUnloadDll+0x94
*** ERROR: Module load completed but symbols could not be loaded for tregsvr.exe
00000000`0014fd10 00000000`00543f8c KERNELBASE!FreeLibrary+0x1d
00000000`0014fd40 00000000`0054524c tregsvr+0x143f8c
00000000`0014fe40 00000000`0054ed47 tregsvr+0x14524c
00000000`0014fed0 00007fff`5f798364 tregsvr+0x14ed47
00000000`0014ff60 00007fff`61c7e851 kernel32!BaseThreadInitThunk+0x14
00000000`0014ff90 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   1  Id: 1158.165c Suspend: 0 Teb: 00000000`0029a000 Unfrozen
Child-SP          RetAddr           Call Site
00000000`0089fb58 00007fff`61c39e4e ntdll!NtWaitForWorkViaWorkerFactory+0x14
00000000`0089fb60 00007fff`5f798364 ntdll!TppWorkerThread+0x76e
00000000`0089ff60 00007fff`61c7e851 kernel32!BaseThreadInitThunk+0x14
00000000`0089ff90 00000000`00000000 ntdll!RtlUserThreadStart+0x21

   2  Id: 1158.a4 Suspend: 0 Teb: 00000000`0029c000 Unfrozen
Child-SP          RetAddr           Call Site
00000000`02a4f8f8 00007fff`61c28691 ntdll!NtWaitForSingleObject+0x14
00000000`02a4f900 00007fff`61c31143 ntdll!LdrpDrainWorkQueue+0xe5
00000000`02a4f940 00007fff`61c8840d ntdll!LdrpInitializeThread+0xa3
00000000`02a4fa30 00007fff`61c8832e ntdll!_LdrpInitialize+0x89
00000000`02a4fab0 00000000`00000000 ntdll!LdrInitializeThunk+0xe

I guess there could be some kind of race condition.

The registration of the same DLL does not hang on Win 2012 Server or Win 7 machine.

@algalg
Copy link
Author

algalg commented Dec 12, 2018

I'd say, the issue is related to calling WaitForSingleObject while unloading the DLL.
https://stackoverflow.com/a/35833437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant