.NET Framework Developer Center >
.NET Development Forums
>
64-Bit .NET Framework Development.
>
Win (.NET) service fails on Windows Server 2008 x64
Win (.NET) service fails on Windows Server 2008 x64
- Hi All,
We have windows service (.NET 2) which works fine on Windows Server 2000 and Windows Server 2003 x32/x64. But it fails on Windows Server 2008 x64. No errors, no exceptions - it simply stops (it starts and it works for some (random) time) working.
Any suggestions?
Answers
- Hello gloomman
This looks a typical "slient process exit" problem: Process terminates unexpectedly without user knowledge and without any actionable trace. This kind of issues are generally difficult to debug. Windows 7 introduces a powerful capability to trouble-shoot silent process exit:
http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/07d82a0e-a85a-44a0-825d-493a2c49db1a
but the function is not available in Windows Server 2008 x64 under discussion.
The typical causes of "silent process exit" are:
1. custom exception filters that swallows the exception and terminates the process.
2. C++ unhandled exceptions (Fixed in VS2005 and later Visual Studios)
3. COM swalows exceptions across boundaries, application may run in corrupted state
4. application bugs resulting in unexpected process termination.
For terminations due to unahndled exceptions, you can attach a debugger to the service process to find out the exception. The KB http://support.microsoft.com/kb/824344 introduces how to debug a windows service. If you cannot install any debugger on the server machine, you can remote debug: http://support.microsoft.com/kb/824344
For termination due to Termiation APIs:
TerminateProcess,
ExitProcess,
TermiateThread on the last therad,
ExitThread on the last thread
You can set a breakpoint on these functions, and when your debugger breaks on the calls, check the current call stack to see who's the caller.
As I said previously, trouble-shooting slient process exit is generally difficult. Please follow the above suggestions, and let me know if you have any questions.
Regards,
Jialiang Ge
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byJialiang Ge [MSFT]MSFT, ModeratorMonday, October 26, 2009 4:27 AM
All Replies
- Check the event log; top-level exceptions for services get written there.
-Steve
Programming blog: http://nitoprograms.blogspot.com/
Including my TCP/IP .NET Sockets FAQ
Microsoft Certified Professional Developer Check the event log; top-level exceptions for services get written there.
Nothing specific there (at that moment i'm unable to provide you with exact message (i have no access to the server), but there is some generic message, like "service stopped").- That sounds like a normal shutdown. i.e., something else told the service to stop, and that's why it stopped.
-Steve
Programming blog: http://nitoprograms.blogspot.com/
Including my TCP/IP .NET Sockets FAQ
Microsoft Certified Professional Developer - Hello gloomman
This looks a typical "slient process exit" problem: Process terminates unexpectedly without user knowledge and without any actionable trace. This kind of issues are generally difficult to debug. Windows 7 introduces a powerful capability to trouble-shoot silent process exit:
http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/07d82a0e-a85a-44a0-825d-493a2c49db1a
but the function is not available in Windows Server 2008 x64 under discussion.
The typical causes of "silent process exit" are:
1. custom exception filters that swallows the exception and terminates the process.
2. C++ unhandled exceptions (Fixed in VS2005 and later Visual Studios)
3. COM swalows exceptions across boundaries, application may run in corrupted state
4. application bugs resulting in unexpected process termination.
For terminations due to unahndled exceptions, you can attach a debugger to the service process to find out the exception. The KB http://support.microsoft.com/kb/824344 introduces how to debug a windows service. If you cannot install any debugger on the server machine, you can remote debug: http://support.microsoft.com/kb/824344
For termination due to Termiation APIs:
TerminateProcess,
ExitProcess,
TermiateThread on the last therad,
ExitThread on the last thread
You can set a breakpoint on these functions, and when your debugger breaks on the calls, check the current call stack to see who's the caller.
As I said previously, trouble-shooting slient process exit is generally difficult. Please follow the above suggestions, and let me know if you have any questions.
Regards,
Jialiang Ge
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byJialiang Ge [MSFT]MSFT, ModeratorMonday, October 26, 2009 4:27 AM
Hello gloomman
Thank you a lot, Jialiang. I'll check issues you have mentioned.
This looks a typical "slient process exit" problem: Process terminates unexpectedly without user knowledge and without any actionable trace.
Hello gloomman
Thank you a lot, Jialiang. I'll check issues you have mentioned.
This looks a typical "slient process exit" problem: Process terminates unexpectedly without user knowledge and without any actionable trace.
It may be helpful to see if the problem also happens on Windows 7, if it does, then the new Silent Process Exit feature may shed light on the cause. In other words, you may be able to use Windows 7 as a tool to help you fix the bug on Server 2008.
Cap'nIt may be helpful to see if the problem also happens on Windows 7, if it does, then the new Silent Process Exit feature may shed light on the cause. In other words, you may be able to use Windows 7 as a tool to help you fix the bug on Server 2008.
Cap'n
Unfortunately, it's not possible at that moment.It may be helpful to see if the problem also happens on Windows 7, if it does, then the new Silent Process Exit feature may shed light on the cause. In other words, you may be able to use Windows 7 as a tool to help you fix the bug on Server 2008.
Cap'n
Unfortunately, it's not possible at that moment.
OK in that case, consider using a vectored exception handler, or AppDomain.UnhandledException event.
Cap'n- Hello
How are you? Could you please update me about your findings?
Thanks
Jialiang Ge
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. OK in that case, consider using a vectored exception handler, or AppDomain.UnhandledException event.
Already done, but not deployed (tested) yet.
Regards, DenisHello
How are you? Could you please update me about your findings?
Hi,
No news at that moment. I am waiting for response from our testers and IT guys... I'll make an update to this post as soon as i get any results.
Regards, Denis


