Solved

Get a crash dump for a windows service

Posted on 2007-11-30
4
2,000 Views
Last Modified: 2012-06-22
Hello,

I have tried to get a crush dump file from a windows service made by me. The problem is that drwtsn32 cannot catch ethese crashes or it cannot make dump files for services. Could anyone tell me how should I do it?

Thank you
0
Comment
Question by:aureliuh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 40

Expert Comment

by:evilrix
ID: 20381228
Try using DebugDiag

http://www.microsoft.com/downloads/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&displaylang=en

The Debug Diagnostic Tool (DebugDiag) is designed to assist in troubleshooting issues such as hangs, slow performance, memory leaks or fragmentation, and crashes in any Win32 user-mode process. The tool includes additional debugging scripts focused on Internet Information Services (IIS) applications, web data access components, COM+ and related Microsoft technologies.
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 20382226
You should add a interface to your service so that you can start it as a console prog from the command line.

At least you should add trace statements which let you narrow where the crash happens.

Regards, Alex
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 20384419
You can use 'MiniDumpWriteDump()' (http://msdn2.microsoft.com/en-us/library/ms680360.aspx) to create your own crash dump. For an example on how to do that, see http://www.codeproject.com/tools/minidump.asp ("Own Crash Minidump with Call Stack"). Also check out http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b170738 ("Debugging a Windows NT Service")
0
 

Author Comment

by:aureliuh
ID: 20391759
Thank you very much JKR. I used you suggested minidump project. I had to make some modification regarding the implementention of the __try __except block, because I did not work with my service. I had to use a _set_se_translator in order to catch SEH exceptions

Thank you again.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question