none
Windows service stable APPCRASH in clr.dll after 3.5 to 4.0 .NET platform change

    General discussion

  • I have windows service project created with .NET 3.5 some time ago. It uses managed class library with native code via PInvoke. Recently 4.0 .NET version of that class library was created. I had to change windows service configurstion to 4.0 .NET client also.

    Wierd problem started to appear after 4.0 version compilation. After about 1 minute of run service is terminated. In the Windows Events Application Error entry is created (event code 1000, task category (100)):

    Application name: MyService.exe, version: 1.0.0.0, timestamp: 0x4d87107f 
    Module name: clr.dll, version: 4.0.30319.1, timestamp 0x4ba1d9ef 
    Exception code: 0xc00000fd 
    Error offset: 0x000ccd3c 
    Process id: 0x1680 
    Time: 0x01cbe7b1aaafc5a0 
    Application path: C:\projects\MyService\release\MyService.exe 
    Module path C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll 
    Report code: 024b8ca0-53a5-11e0-9963-544249093872 

    With 2 more entries in the events with information from Windows Error Reporting:

     Contaier error , type 0 
     
    Event name: APPCRASH 
     
    Reply: No data 
     CAB
    Identifier: 0 
     
     
    Problem signature: 
     P1
    : MyService.exe 
     P2
    : 1.0.0.0 
     P3
    : 4d87107f 
     P4
    : clr.dll 
     P5
    : 4.0.30319.1 
     P6
    : 4ba1d9ef 
     P7
    : c00000fd 
     P8
    : 000ccd3c 
     P9
    :  
     P10
    :  

    With crash dump files reported to be found in C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_MyServ_c7f32a85ba9f45a9b76ff6beb5fac592fa5396f3_cab_047b1b2c

    There is no specific point in the service it stops to work as I looked in the service logs dumped to text file. Any function call that follows after about 1 minute of work results in the termination. Service has a timer that fires with specific delays which invokes its functionality.

    If I comment out managed class library call that uses native code the service termination stops. If I run the same class library with the same service functionality in original 4.0 console project there are no problems either.

    Are there any bugs in 4.0 clr related to native code call in windows service applications?

    I have not got installed any 4.0 updates or fixes neither VS 2010 SP1

    Tuesday, March 22, 2011 6:10 PM

All replies

  • I am having the same error and it happens as indicated above.  However, usually after the first crash, the service will run for a number for hours until it bombs.  The problem is with two difference Window Services running on different Windows 2008 R2 servers.  Until now they have been running fine on Window 7 boxes for a number of months.  The services are written to use .NET 4 framework.  Both service are multi-thread and fairly busy.

    Any ideas?

    Tuesday, March 22, 2011 11:41 PM
  • I'm running it on w7 x64. The service is x86 compiled as it uses 32bit native dlls. It is also multithreaded and pretty busy with real time image processing.

    My crashes are stable, after a minute of work it crashes. E.g. with the timer interval set to 3 seconds before the crash final timer event is delayed to 6 seconds, then after event is finished and processing cycle is complete the clr.dll 0xc00000fd appear in windows events.

    It needs more testing to discover which code part turned off avoids the crash

    Wednesday, March 23, 2011 6:03 AM
  • Hi amsndbfvgchxjzkl,

     

    Welcome to the MSDN forum!

    Could you please show more code of the managed class library that P/Invoke the native dll?

    We need more information so that we may provide a better response.

     

    Have a nice day!


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, March 27, 2011 7:18 AM
  • I am getting something similar from an ASP.NET MVC application running on Windows Server 2008 R2 SP1. This is a website that has been running untouched for two weeks--the only thing that changed was I installed SP1 over the weekend.

    Here is the Application Error:

    Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
    Faulting module name: clr.dll, version: 4.0.30319.1, time stamp: 0x4ba21eeb
    Exception code: 0xc00000fd
    Fault offset: 0x00000000000d4738
    Faulting process id: 0x760
    Faulting application start time: 0x01cbed04801e6ea2
    Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
    Faulting module path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
    Report Id: cfca44fa-5afa-11e0-ae6d-00155d030205

     

    Fault bucket , type 0
    Event Name: APPCRASH
    Response: Not available
    Cab Id: 0
    Problem signature:
    P1: w3wp.exe
    P2: 7.5.7601.17514
    P3: 4ce7afa2
    P4: clr.dll
    P5: 4.0.30319.1
    P6: 4ba21eeb
    P7: c00000fd
    P8: 00000000000d4738
    P9:
    P10:
    Attached files:
    C:\Windows\Temp\WER5C16.tmp.appcompat.txt
    C:\Windows\Temp\WER653F.tmp.WERInternalMetadata.xml
    C:\Windows\Temp\WER6540.tmp.hdmp
    C:\Windows\Temp\WERD89C.tmp.mdmp
    These files may be available here:
    C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_w3wp.exe_b8e9f7c1d273b4d840a1f3d773335799a795df5e_cab_0c63ea5c
    Analysis symbol:
    Rechecking for solution: 0
    Report Id: cfca44fa-5afa-11e0-ae6d-00155d030205
    Report Status: 4

    and

    Fault bucket , type 0
    Event Name: APPCRASH
    Response: Not available
    Cab Id: 0
    Problem signature:
    P1: w3wp.exe
    P2: 7.5.7601.17514
    P3: 4ce7afa2
    P4: clr.dll
    P5: 4.0.30319.1
    P6: 4ba21eeb
    P7: c00000fd
    P8: 00000000000d4738
    P9:
    P10:
    Attached files:
    C:\Windows\Temp\WER5C16.tmp.appcompat.txt
    C:\Windows\Temp\WER653F.tmp.WERInternalMetadata.xml
    C:\Windows\Temp\WER6540.tmp.hdmp
    C:\Windows\Temp\WERD89C.tmp.mdmp
    These files may be available here:
    C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_w3wp.exe_b8e9f7c1d273b4d840a1f3d773335799a795df5e_cab_0c63ea5c
    Analysis symbol:
    Rechecking for solution: 0
    Report Id: cfca44fa-5afa-11e0-ae6d-00155d030205
    Report Status: 0

    This sequence repeats five times until I get a WAS error:

    Application pool 'MyApplicaton' is being automatically disabled due to a series of failures in the process(es) serving that application pool.

    ...which is always fun because then I have to manually restart the application pool. After manually restarting, everything seems ok.

    Wednesday, March 30, 2011 9:46 PM
  • Hi,

     

    We should do a live debugging or capture a dump for further investigation.

    You can use WinDbg + SOS to debug such issue or Using ADPlus to capture a dump file.

    ADPlus is shipped with Debugging Tools For Windows which available at here, you can try this command to capture a dump file:

    adplus -crash -o d:\dumps -pn MyApplication

     

    I hope this can help you to resolve your problem.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 31, 2011 5:12 AM
  • Hi, app crash dumps are saved in programdata\...\WER\ReportQueue folder.

    I can upload on of them for your investigation if you suggest me the place

    Monday, April 04, 2011 12:04 PM
  • I recently installed .net 4.0 update to 4.0.30319.255 version but the same problem persists
    Monday, April 04, 2011 12:05 PM
  • Hi Paul

    I can not reveal our company code. I have app crash dumps in WER folder to share.

    Basically there is timer that ticks say every second. On each event background thread is started that performs some action using unmanaged dll.

    I tested unmanaged code in a managed console application running on the same data for a long time without any problems

     

    Monday, April 04, 2011 12:11 PM
  • Hi,

     

    Sorry for late response.

    Could you please send the dump file to my e-mail: v-paulz@mircosoft.com.

    If you send it to me, I will try to find root cause for you.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, April 07, 2011 8:47 AM
  • Hi

    I'm sending it from the company email ayonix.com it is about 100Mb in rar file.

    I very much hope you can solve it.

    If microsoft pop servers do not pass such large file we can share it online somehow

    Saturday, April 09, 2011 9:31 AM
  • Would you confirm if you recieved my email?

    I've got delivery delay notion from smtp

    Monday, April 11, 2011 9:24 AM
  • Hello folks,

     

    I also have the described error event. It occurs here several times per day and 5..7 times, one by one, during the ~30 seconds period. And next there are no errors during 2..3 hours and again several times during short time.

     

    I tried an advice found here: http://social.msdn.microsoft.com/Forums/en-NZ/clr/thread/e0de4156-d028-4f01-859e-b20ba3683651 and

    installed the hotfix: KB982638 located here: https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=29638

    Unfortunately it did'nt help.

     

    Thanks,

    Marek

    Monday, April 11, 2011 1:30 PM
  • Hi,

    I haven't received the dump file from you. I think it is too large to send it by e-mail.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 12, 2011 5:35 AM
  • Hello,

     

    I resolved this issue. There was an infinity loop in my code. In some circumstances my code fall into infinite loop. Under the debuger I observed Stack Overflow exception. I repaired the code and now there is no error event in CLR.DLL.

     

    Thanks,

    Marek


    • Edited by Marek Zgadzaj Wednesday, April 13, 2011 9:30 AM Corrected several mistakes
    Tuesday, April 12, 2011 6:18 PM
  • Hi,

    I haven't received the dump file from you. I think it is too large to send it by e-mail.

    I've sent you email with a link to deposit files on the same day. Have you recieved it?

    I will resend it again.

    Tuesday, April 12, 2011 7:26 PM
  • I've sent you email with a link to deposit files on the same day. Have you recieved it?

    I will resend it again.


    That is the reply from smtp server for your email:

    This message was created automatically by mail delivery software.

    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:

    v-paulz@mircosoft.com
    retry timeout exceeded

    Wednesday, April 13, 2011 12:24 PM
  •  

    Hi,

     

    I have received mail from you. I am downloading the dump and I will try to find the cause of this exception.

    It may take a little time to analyse the case.

     


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, April 14, 2011 3:01 AM
  •  

    Hi,

     

    I have received mail from you. I am downloading the dump and I will try to find the cause of this exception.

    It may take a little time to analyse the case.

     


    Great, there is stack overflow in clr.dll as I gatherd from the error code.
    Friday, April 15, 2011 6:19 AM
  • Paul,

    We have are having the exact same problem with our windows service.  the APPCRASH is actually was happening in 3.5 with mscorwks.dll and now in 4.0 with clr.dll.

     

    We have been chasing this for a month now with no progress.

     

    We get this error:

    Faulting application name: ENVControlServices.exe, version: 1.2.38.0, time stamp: 0x4efbc86b
    Faulting module name: clr.dll, version: 4.0.30319.239, time stamp: 0x4e1822f4
    Exception code: 0xc0000005
    Fault offset: 0x000000000018b20e
    Faulting process id: 0x15e0
    Faulting application start time: 0x01ccc5e4a21b721e
    Faulting application path: C:\Program Files (x86)\Climate Automation Systems, Inc\ENV Control Services\ENVControlServices.exe
    Faulting module path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
    Report Id: c5dd101f-31f0-11e1-919c-643150071134

     

    Then this one:

    Fault bucket 52544195, type 4
    Event Name: APPCRASH
    Response: Not available
    Cab Id: 1527717751

    Problem signature:
    P1: ENVControlServices.exe
    P2: 1.2.38.0
    P3: 4efbc86b
    P4: clr.dll
    P5: 4.0.30319.239
    P6: 4e1822f4
    P7: c0000005
    P8: 000000000018b20e
    P9:
    P10:

    Attached files:
    C:\Windows\Temp\WERED44.tmp.appcompat.txt
    C:\Windows\Temp\WERED84.tmp.WERInternalMetadata.xml
    C:\Windows\Temp\WERED94.tmp.hdmp
    C:\Windows\Temp\WERFAAF.tmp.mdmp

    These files may be available here:
    C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_ENVControlServic_ad66ffa090515310b04d468cb353451ef3e8f1f1_cab_0509a0f9

    Analysis symbol:
    Rechecking for solution: 0
    Report Id: c5dd101f-31f0-11e1-919c-643150071134
    Report Status: 8

    We have 40 other sites running the same code with no problems.  The only unique difference at this site is that we are reading several devices over a COMM PORT connected to the PC via USB.

    This is a Windows 7 Professional x64 HP Laptop...

    PLEASE HELP....


    The Doctor is in... "There is a fine line between Saturday night and Sunday morning."
    Thursday, December 29, 2011 2:50 PM
  • I recently had exactly the same error(s) as the OP.  Firstly let me say that there is some really good information in this thread as it sent me in the right direction.

    Ours came down to a permission issue on the server.  The User of the App Pool had changed to be specific to that pool and web service, but the new custom user had not been given perms to the folder where the app writes its log files.  Doh!  Whenever it would try to write to the log... CRASH!  Added the user with Read/Write to the log folder, and viola!

    Hope this can help someone else someday.  I've been banging my head for a few days now over this.  I know how frustrating errors like this can be.

     

    Good Luck!

    Friday, January 20, 2012 7:24 PM
  • Yes, i have the same situation. I think that was a .net bug but it was me. Overrride ToString method and internal stck overflow was generated !!! 

    La vanguardia es así ...

    Friday, February 21, 2014 6:46 PM
  • Hi, I have similar problem, but a little different.

    We used Framework version 4.0 and found out this problem, so we upgraded OS from windows 7 to windows 8 and Framework from 4.0 to 4.5.2. Problem still continue...

    Information from Eventviewer: Faulting application name: Mikro.FareOn.Modules.Cards.Client.KioskJihlava.exe, version: 3.0.804.3406, time stamp: 0x56cb21bd Faulting module name: clr.dll, version: 4.0.30319.18408, time stamp: 0x52310b2d Exception code: 0xc0000409 Fault offset: 0x0047cb35 Faulting process id: 0xba4 Faulting application start time: 0x01d29eef3c327226 Faulting application path: c:\mikroelektronika\kiosk\Mikro.FareOn.Modules.Cards.Client.KioskJihlava.exe Faulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Report Id: b9419dac-0aed-11e7-a037-00045f8f3145 Faulting package full name: Faulting package-relative application ID:

    Fault bucket , type 0 Event Name: BEX Response: Not available Cab Id: 0 Problem signature: P1: Mikro.FareOn.Modules.Cards.Client.KioskJihlava.exe P2: 3.0.804.3406 P3: 56cb21bd P4: clr.dll P5: 4.0.30319.18408 P6: 52310b2d P7: 0047cb35 P8: c0000409 P9: 00000002 P10: Attached files: These files may be available here: C:\Users\kiosk1\AppData\Local\Microsoft\Windows\WER\ReportQueue\AppCrash_Mikro.FareOn.Mod_91f327b9c548e7d593481687d6a18516e131862d_091355f6 Analysis symbol: Rechecking for solution: 0 Report Id: b9419dac-0aed-11e7-a037-00045f8f3145 Report Status: 4 Hashed bucket:

    Now I have installed .Net Framework 4.5.2

    Can somebody help me, please?


    Friday, March 17, 2017 12:10 PM