I have a log and a try catch in this console app, but does not seem to get that far.
Works fine on my dev machine, does not on Win Server 2008. Event viewer has the same info as below.
I understand there's not much to go on here, but that's what I know. All prev deployments worked, so I'm at a loss.
Please don't close, and help me solve this problem. I will answer any questions I can.
Thanks.
Description:
Stopped working
Problem signature:
Problem Event Name: APPCRASH
Application Name: LoaderLive.exe
Application Version: 2.0.1.0
Application Timestamp: 4ef176d6
Fault Module Name: KERNELBASE.dll
Fault Module Version: 6.1.7601.17651
Fault Module Timestamp: 4e211319
Exception Code: e0434f4d
Exception Offset: 0000b9bc
OS Version: 6.1.7601.2.1.0.272.7
Locale ID: 1033
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
If you have a top-level try/catch and it's not catching the exception, it might be because the fault is occurring at a very low level (e.g. somewhere in a native code library), too early (before your Main even starts), or on another thread (where your try/catch can't "reach").
To find out what is going on, run the application under a debugger. If you have Visual Studio installed on the target machine, you can do it from there (open the EXE and "Start Debugging"). If not, you can use windbg.exe / cdb.exe (available as Debugging Tools for Windows in the Windows SDK). Within the debugger, you should be able to see where the fault occurs, as it will by default stop on any fatal exception.
Related
I am running a .Net console application that executes 24 hrs a day. It has a bug that occurs about once every 6 days.
I would like your assistance to fix this bug. First I will provide some background, and then I will provide the exception messaging.
Unfortunately I do not have steps to reproduce. You will see why as you read on.
First some background:
I have robust exception handling in my code (or so I thought). For example I have a try...catch block in my Main() method that captures any unhandled exceptions and if they are FATAL it restarts the underlying task. It works great for any exceptions generated from my own code.
I cannot explain why the below exception isn't handled in my code. My best guess is that clr.dll exceptions do not get caught within the managed stack. And if that is the case, I do not know how to generate a stack trace. I don't even know where to begin to fix this.
The process I am running is using the following versions and modules:
C# .Net Framework 4.6.1
Console App project type
System.Net.WebClient
log4net
Windows 7 64-bit
At the time of the crash I checked RAM and HDD: both have plenty of free space.
About the code I'm executing. The process is a continous loop that downloads data from a website and saves it to a text file. If there is an error, it is logged using log4net.
The basic loop is this:
for (int i = 0; i < 5; i++)
{
try
{
return new WebClient().DownloadString(url);
}
catch
{
Thread.Sleep(500); // slow it down.
}
}
The following is the only message that displays in my console window when the exception occurs: (no stack trace displayed)
Process is terminated due to StackOverflowException
My console application completely freezes up and a dialog window pops up with the following information (closing this dialog also terminates my application)
Problem signature:
Problem Event Name: APPCRASH
Application Name: foo.goo.BatchExecutor.exe
Application Version: 1.0.0.0
Application Timestamp: 5a50f3eb
Fault Module Name: clr.dll
Fault Module Version: 4.7.2117.0
Fault Module Timestamp: 59cf5105
Exception Code: c00000fd
Exception Offset: 0002429f
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: 28e8
Additional Information 2: 28e8aacd8abfe32876bc8363e8e5c526
Additional Information 3: 6916
Additional Information 4: 6916665ca52ff482d854f190abcf46b2
The only other place I could find information about the crash is in the Windows Event Log:
Log Name: Application
Source: Application Error
Date: 1/23/2018 5:51:46 PM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: FOOGOO
Description:
Faulting application name: foo.goo.BatchExecutor.exe, version: 1.0.0.0, time stamp: 0x5a50f3eb
Faulting module name: clr.dll, version: 4.7.2117.0, time stamp: 0x59cf5105
Exception code: 0xc00000fd
Fault offset: 0x0002429f
Faulting process id: 0x1e00
Faulting application start time: 0x01d39169354e41a7
Faulting application path: C:\Users\Owner\Desktop\SHARED\foo.goo.BatchExecutor\foo.goo.BatchExecutor.exe
Faulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Report Id: 21b9b2a4-00a9-11e8-9f6c-94c69110a719
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2018-01-24T01:51:46.000000000Z" />
<EventRecordID>1852</EventRecordID>
<Channel>Application</Channel>
<Computer>FOOGOO</Computer>
<Security />
</System>
<EventData>
<Data>foo.goo.BatchExecutor.exe</Data>
<Data>1.0.0.0</Data>
<Data>5a50f3eb</Data>
<Data>clr.dll</Data>
<Data>4.7.2117.0</Data>
<Data>59cf5105</Data>
<Data>c00000fd</Data>
<Data>0002429f</Data>
<Data>1e00</Data>
<Data>01d39169354e41a7</Data>
<Data>C:\Users\Owner\Desktop\SHARED\foo.goo.BatchExecutor\foo.goo.BatchExecutor.exe</Data>
<Data>C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll</Data>
<Data>21b9b2a4-00a9-11e8-9f6c-94c69110a719</Data>
</EventData>
</Event>
*****UPDATE WITH SOLUTION WORKAROUND *****
I have given up trying to handle this exception within .Net. I found an effective workaround. This workaround applies to Windows, specifically any version with an Event Viewer.
Workaround Instructions.
1) Open control panel->Admin Tools->Event Viewer->Windows Logs->Applications.
2) Select the offending event. In my case, it is state ERROR, and matches the example that you see above.
3) On the right hand side click "Attach Task to This Event".
4) Complete the wizard. In my case, I restart my application.
5) Save the task.
6) Now switch over to Task Scheduler and find the task. Click Properties. Click through the tabs and configure the Task as you see fit.
*****UPDATE WITH SOLUTION WORKAROUND *****
I have given up trying to handle this exception within .Net. I found an effective workaround. This workaround applies to Windows, specifically any version with an Event Viewer.
Workaround Instructions.
1) Open control panel->Admin Tools->Event Viewer->Windows Logs->Applications.
2) Select the offending event. In my case, it is state ERROR, and matches the example that you see above.
3) On the right hand side click "Attach Task to This Event".
4) Complete the wizard. In my case, I restart my application.
5) Save the task.
6) Now switch over to Task Scheduler and find the task. Click Properties. Click through the tabs and configure the Task as you see fit.
I suggests to use ProcDump, it can be configured to generate a crash dump when the StackOverflowException occurs.
procdump -accepteula -e 1 -f C00000FD.STACK_OVERFLOW -g -ma <PID> <OUTPUT PATH>
Then analyze the dump file using one of this tools
Visual studio, windbg, debugdiag, clrmd.
I suggest trying DebugDiag (https://www.microsoft.com/en-us/download/details.aspx?id=49924) to capture the crash and analyse the resulting process dump. Make sure you include pdbs alongside your exe, to make diagnosis easier: in the Project properties, Build tab: set the Configuration to the configuration that you use to build the exe. In the Output section, Advanced button, set the Debugging information to Pdb (or Full).
To help collect a stack trace, PHPTower, you can do what I did and subscribe to the AppDomain.CurrentDomain.UnhandledException event of your program at the beginning of your Main() function
The signature of the event handler looks like the following, allowing you to get the exception, and output a stack trace with the Exception.ToString() method.
private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
File.AppendAllLines(FileName, e.ExceptionObject.ToString());
}
Happy hunting!
-cadatoiva
My programm is running without any problems, on my current laptop (x64). But when I try to run it on an other PC (x86) it crashes before starting. I also tried to change the platformtarget, as described in this answer:
XMLParseException occurs
I also catched all unhandled exceptions. That delivers me two exceptions:
I also got that from reliability history:
Faulting application name: LoginDemo.exe, version: 1.0.0.0, time
stamp: 0x56c19003 Faulting module name: KERNELBASE.dll, version:
6.1.7601.17651, time stamp: 0x4e2111c0 Exception code: 0xe0434352 Fault offset: 0x0000d36f Faulting process id: 0x4b0 Faulting
application start time: 0x01d167cd96535e01 Faulting application path:
C:\Users\hgservice\Desktop\Temp\LoginTool2\LoginDemo\bin\Release\LoginDemo.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll Report Id:
d6435b26-d3c0-11e5-b9a7-001999d6cbe5
I also read that the problem could occure because the programm tries to import a DLL while running, but all DLLs that I need for the exe are in the same folder. And as I said on my laptop it is working fine. Has anyone an idea what the problem could be?
This problem has nothing in common with WPF as such. If we analyse the stacktrace we can see that it is thrown by pcsc-sharp library. The more careful analysis will show that NoServiceException exception was thrown because the following native method returned an error:
[DllImport(WINSCARD_DLL, CharSet = CharSet.Auto)]
private static extern int SCardEstablishContext(...)
More precisely NoServiceException is mapped to the SCARD_E_NO_SERVICE (0x8010001D) error. It means that probably SmartCard service on your laptop is not running. To fix it: press Win+R, type services.msc and start SmartCard service.
This problem can be also caused by differences between various versions of Windows (for details see this question).
Another cause of this problem might be the lack of sufficient permissions (see this article).
Okay guys I fixed it. As Michał Komorowski and Jon Skeet already answered, the problem was that the Smard Card sevice was not running. The answer of Michał Komorowski is almost correct. The only thing I had to do furthermore, was to set the startup type on "manual". After that I could start the Smart Card service and now everything is working.
I was trying to publish a CEFSharp project through Visual Studio 2013 Cummunity. The .NET version I used is 4.5( tried 4.0 already and it failed). The program can run smoothly under model Release 64x model. However, when I tried to publish it to an executable format and run it, the executable file crashed and I got the following message error message.
Problem signature:
Problem Event Name: APPCRASH
Application Name: CEFRenderTest.exe
Application Version: 1.0.0.0
Application Timestamp: 55b166ca
Fault Module Name: KERNELBASE.dll
Fault Module Version: 6.1.7601.18869
Fault Module Timestamp: 556366fd
Exception Code: e0434352
Exception Offset: 000000000000b3dd
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: 1033
Additional Information 1: 367e
Additional Information 2: 367e805d0e7c1ec3f63b05bb5ce5c416
Additional Information 3: baed
Additional Information 4: baed2f50fa8c90ffc9d41aca75222fe2
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
Anyone familiar with VS and CEFSharp potential knows why?
I have a project iv been working on for sometime, but today when i tried to build the solution the following message was displayed.
This message appears twice when i try run my project, but the project is able to run after this appears.
The problem is i cant publish as this stops my publishing.
The problem signature reads the following:
Problem Event Name: APPCRASH
Application Name: csc.exe
Application Version: 4.0.30319.17929
Application Timestamp: 4ffa73cb
Fault Module Name: bitguard.dll
Fault Module Version: 2.6.1694.246
Fault Module Timestamp: 524a99fc
Exception Code: c0000005 Exception
Offset: 0017966f
OS Version: 6.1.7601.2.1.0.256.1 Locale ID: 7177
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
I have run and build this project many times as well as publish, but this now has become a problem out of the blue.
This is only happening with one project and my other run and build fine.
I have posted a bounty on a similar question as i need this resolved quickly:
Command Line Compiler stops working in specific project
Thanks in advance.
Found the solution with the help of Joe's comment above.
Following the Fault Module name you can see the problem file is bitguard.dll.
http://www.spywareremove.com/file/bitguarddll-367251/
Adw Cleaner is a free malware cleaner that helped me find bitguard and remove it safely.
http://download.cnet.com/AdwCleaner/3000-7786_4-75851221.html
The problem has been solved.
I created a pretty simple c# application using visual studio 2010 on windows xp. It compiles, runs and debugs fine on my machine. I even built it for release and ran the .exe on my machine and another windows xp machine perfectly fine. When I send the release folder with the .exe file and they open it, nothing happens! No errors or anything, just blank!
.NET version 4 framework installed
It is a windows form application.
UPDATE: Details from OP's comments given to one of the answers below:
Hey everyone, thanks for the ideas. I
copied what I found on my friends
windows 7 machine event log and this
is what it said:
Application: ePrescribing.exe Framework Version: v4.0.30319
Description: The process was
terminated due to an unhandled
exception. Exception Info:
System.IO.FileNotFoundException Stack:
at
ePrescribing.frmApp.InitializeComponent()
at ePrescribing.frmApp..ctor() at
ePrescribing.Program.Main()
Faulting application name: ePrescribing.exe, version: 1.0.0.0,
time stamp: 0x4d61e693 Faulting module
name: KERNELBASE.dll, version:
6.1.7600.16385, time stamp: 0x4a5bdbdf Exception code: 0xe0434352 Fault
offset: 0x0000b727 Faulting process
id: 0xb38 Faulting application start
time: 0x01cbe1dbe6d4ba2d Faulting
application path:
C:\Users\Duane\Downloads\ePrescribing.exe
Faulting module path:
C:\Windows\syswow64\KERNELBASE.dll
Report Id:
266adc61-4dcf-11e0-8438-e0cb4e197cde –
Fault bucket , type 0 Event Name: CLR20r3 Response: Not available
Cab Id: 0 Problem signature: P1:
eprescribing.exe P2: 1.0.0.0 P3:
4d61e693 P4: ePrescribing P5: 1.0.0.0
P6: 4d61e693 P7: 28 P8: e P9:
System.IO.FileNotFoundException P10: –
I removed the only area where I
thought there would be a file load
(for the picturebox loading
profile.jpg) and still got the same
error. Any ideas?
First, you might try checking the Event Viewer for any relevant errors messages (as stated above).
Next, make sure they have .NET installed (as stated above).
Then, try adding an UnhandledExceptionEventHandler to your application and in that handler, try to at least write a simple log/text file containing the exception that caused your application to exit.
Make sure the latest .NET framework is installed.
Check .NET framework installed on win7 computer equal your application framework target.
Check in the process explorer that it's running but didn't show you anything.
Check event log for crash reports.
Try to add logging to your application in different places and add unhandled error handlers.
Additionly to other answers I would also check whether your app compiled against x86/x64 runtime
Have you included a manifest file?
Take a look at this.
Or this...
Are you accessing any folders via static paths instead of environment variables? That could cause issues between these versions of Windows.
You should check if all other third party assemblies can be found either in GAC or app folder
Referenced assembly may be missing from target computer. Please set Copy Local=True for all referenced library. This may solve your issue.