Rahul Das

Rahul Das

  • NA
  • 1
  • 0

C#.NET 2005 Windows Service Crashing automatically

May 22 2007 8:25 AM

Hi,

    I have a windows service written in C# 2005.  The service basically listens to a queue in MSMQ.  As soon as a message arrives in the monitored queue, the service processes it, does some processing in MS-access using ADO, OLEDB and ODBC.NET and finally executes a few queries, fills dataset and populates Excel sheets using MS-Office PIA(Primary Interop Assembly) and sends an email attaching the excel workbook.  The service runs fine, processes a message when it comes and sends mail as well.  But, after some time, it crashes putting an entry in the EventLog as :

<< 

Source : .NET Runtime 2.0 Error Reporting

EventID : 1000

Category : None

Description : Faulting application windowsservice1.exe version 1.0.0.0 stamp 4652715c, faulting module unknown, version 0.0.0.0, stamp 00000000, deubu?0, fault address 0x4de7649a.

>> 

By not getting any hint from it, I added try/catch block in 100% code.  But, of no use.

Then, I used Adplus, and created a Crash Dump using the following command line:

 

adplus.vbs -crash -pn WindowsService1.exe

 After loading the crash dump in windbg, I got the following output:

Loading Dump File [D:\Program Files\Debugging Tools for Windows\Crash_Mode__Date_05-21-2007__Time_12-03-40PM\PID-192__WINDOWSSERVICE1.EXE__2nd_chance_AccessViolation__full_0d80_2007-05-21_12-39-55-359_00c0.dmp]
User Mini Dump File with Full Memory: Only application data is available

Comment: '2nd_chance_AccessViolation_exception_in_WINDOWSSERVICE1.EXE_running_on_EC4-RRD-148703'
Symbol search path is: D:\WinXPSP2Symbols;D:\rahul\PIA\PIAWindowsService\PIAWinService\RRD.MailDat.Processor\bin\Debug;D:\rahul\PIA\PIAWindowsService\PIAWinService\WindowsService1\bin\Debug
Executable search path is:
Windows XP Version 2600 (Service Pack 2) UP Free x86 compatible
Product: WinNt, suite: SingleUserTS
Debug session time: Mon May 21 12:39:55.000 2007 (GMT+5)
System Uptime: 0 days 4:19:18.974
Process Uptime: 0 days 0:37:15.000
.......................................................................................................
Loading unloaded module list
................
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(c0.df4): Access violation - code c0000005 (first/second chance not available)
eax=7ffaa000 ebx=00000000 ecx=40000000 edx=00000043 esi=4de7649a edi=0975fea0
eip=4de7649a esp=0975fe3c ebp=0975fe64 iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
<Unloaded_msado15.dll>+0x6649a:
4de7649a ??              ???
0:012> kb
ChildEBP RetAddr  Args to Child             
WARNING: Frame IP not in any known module. Following frames may be wrong.
0975fe38 7e418734 00150d10 00000219 00000007 <Unloaded_msado15.dll>+0x6649a
0975fe64 7e418816 4de7649a 00150d10 00000219 user32!InternalCallWinProc+0x28
0975fecc 7e4189cd 00000000 4de7649a 00150d10 user32!UserCallWinProcCheckWow+0x150
0975ff2c 7e418a10 0975ff54 00000000 0975ff70 user32!DispatchMessageWorker+0x306
0975ff3c 77513787 0975ff54 00000000 77606c28 user32!DispatchMessageW+0xf
0975ff70 775270d5 00007530 7c802540 001c6248 ole32!CDllHost::STAWorkerLoop+0x5c
0975ff8c 77527008 0975ffb4 774fe3dc 77606c28 ole32!CDllHost::WorkerThread+0xc8
0975ff94 774fe3dc 77606c28 948e43d5 001c6248 ole32!DLLHostThreadEntry+0xd
0975ffa8 774fe444 0376e57c 0975ffec 7c80b683 ole32!CRpcThread::WorkerLoop+0x1e
0975ffb4 7c80b683 001c6248 948e43d5 0376e57c ole32!CRpcThreadCache::RpcWorkerThreadEntry+0x1b
0975ffec 00000000 774fe429 001c6248 00000000 kernel32!BaseThreadStart+0x37