enter image description here
I want to remove Exceptions below, But Don't know how to
Exception thrown at 0x00007FFADD50CD29 in TestProject.exe: Microsoft C++ exception: unsigned long at memory location 0x0000005C0A3AD420.
Exception thrown at 0x00007FFADD50CD29 in TestProject.exe: Microsoft C++ exception: unsigned long at memory location 0x0000005C0A3AE540.
Exception thrown at 0x00007FFADD50CD29 in TestProject.exe: Microsoft C++ exception: int at memory location 0x0000005C0A3AE2DC.
It's just an empty project
These exceptions are caused by a third-party software Fasoo DRM. It injects its code into your app. As Google says, Fasoo Enterprise DRM - Persistent Threat Protection, perhaps is some kind of antivirus software. Uninstall or disable it.
Related
My program calls into a library for which I don't have source code (Direct2D ID2D1DCRenderTarget::BeginDraw). Visual Studio debugger gives me a "first-chance" when that library code throws an exception. I have the definition of the thrown object (it's a _com_error). How can I inspect that object in the debugger at that point?
I tried modifying my code to catch the exception, but the library is catching (and handling?) the exception before it propagates back to the call site. I tried poking around at the registers and memory in the debugger at the point of the first-chance exception, but I don't know enough about how VS maps exceptions into the ABI to really know where to look. Is there a particular register that points to the exception object?
Why I'm asking: I'm trying to figure out if this exception is part of the normal operation of the library or if it's indicative of a bug in how I'm using the library. The library appears to be handling whatever exceptional condition arises, but I'm not sure if it's just covering up a mistake on my part. In certain circumstances[*], it happens in every iteration of a hot loop[**], so I'm concerned about the performance impact of the exception propagation. I'm hoping the details in the _com_error exception object will give me a clue as to what's going on under the covers.
[*] The certain circumstances are that a high-contrast theme is selected. When a "standard" theme is selected, no exception is thrown.
[**] It's a hot loop because it's every frame of an animation. And, actually, it's a few times per frame because I'm animating on a few render targets simultaneously and the exception happens on the BeginDraw call for every target.
The address listed in the throw should be the address of a _com_error object. If he turns on the Microsoft Symbol Server, you should be able to inspect the properties of the _com_error and the IErrorInfo it’s holding internally.
Example:
Exception thrown at 0x757708F2 in ConsoleApplication1.exe: Microsoft C++ exception: _com_error at memory location 0x00BAFA70.
Watch window:
However, I would suggest you turn on the sdk layers instead:
https://msdn.microsoft.com/en-us/library/windows/desktop/ee794277(v=vs.85).aspx
That should tell you if anything is going wrong with his D2D calls better than inspecting an error that may be intentional.
I'm using POCO lib to working network.
i use JSON data of POCO/JSON . my code:
User user(context.marshal_as<std::string>(tbUserName->Text),
context.marshal_as<std::string>(tbFullName->Text),
context.marshal_as<std::string>(tbDisplayName->Text),
context.marshal_as<std::string>(tbEmail->Text),
context.marshal_as<std::string>(tbPhoneNumber->Text),
context.marshal_as<std::string>(tbNamSinh->Text),
context.marshal_as<std::string>(tbPassword->Text),
context.marshal_as<std::string>(tbConfirm->Text)
);
string jsonString = user.serialize();
I have an error Exception thrown at 0x00007FF93E507A7A (ntdll.dll) in Client_Winform.exe:
0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
If there is a handler for this exception, the program may be safely continued.
Use Visual Studio's Code Analysis to track the exact place in your code where the bug is.
https://msdn.microsoft.com/en-us/library/ms182028.aspx
The problem with these kinds of error messages is not to understand the reason (bad handle) but to find the place. Since your code passed compilation with no errors, and in many cases, will run smoothly on several machines and crash only on one of them, you need to focus on the place of the crash.
You are using a handle which got returned as INVALID_HANDLE from some function (INVALID_HANDLE is -1 or 0xFFFFFFFFFFFFFFFF). When you try to use it, it gets used as an address and you don't have permissions to access that address (error 5 is access violation).
This could occur, when you do have multiplatform projects (i.e. assemblies). Meaning, if you do have one project of x86 and another project in x64. Issue occurs when you build project under wrong platform. For example, referred x64 assembly build under x86 and in the consumer code are trying to call specific function. Because, of this mixed platformed assemblies, reference calculation is resulting in x00000005 or xFFFFFFFF kind of location, which is restricted area in side RAM (i.e. OS part). Hence, it's throwing exception having message like "Access Violation exception reading location...". The solution I found is to identify and apply exact platform to relevant project. I retrieved entirely fresh code from the repo again and build under specific platform and this issue disappeared.
I was building a 10-year-old project with debug set as x64. When I changed to x86 for debug and Win32 in the configuration manager the "ntdll.dll can't find" error went away. Remaining issue is that malloc/free throws a runtime error is some places but not in others. Change to new/delete formats solved this issue.
I use windbg to debug the crash dump, in the following output from the windbg, you can see that "first/second chance not available", Why the first/second chance not available here? what does this mean?
This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(e38.2270): Access violation - code c0000005 (first/second chance not available)
first/second chance refers to exceptions that can be thrown and the handling mechanism of the debugger that can be utilized. When debugging an application with a debugger, the debugger get's to see the exceptions before the application does, and so get's a first chance at handling them.
A first chance exception is one that is handled by the debuggers first chance mechanism for handling exceptions.
The fact that none is available here most likely means that no exceptions were thrown where this error occurred or that no first chance handling mechanisms are available in the debugger to handle any exception that was thrown.
I would put my bets on the fact that this error has no exceptions being thrown because of it, it's just a seg fault.
According to http://www.dumpanalysis.org/ (first/second chance not available) means that information about whether an exception was first-chance or second-chance is missing in a crash dump file. How to distinguish between 1st and 2nd chances
Demystifying first-chance exceptions (Part 1
, 2).
I have a Win32 C++ app developed in VS2005. There is a try {} catch (...) {} wrapped around a block of code, and yet 3 functions deep, when the algorithm breaks down and tries to reference off the end of a std::vector, instead of catching the exception, the program drops into the VS debugger, tells me I have an unhandled win32 exception, and the following is found on the call stack above my function:
msvcr80.dll!:inavlid_parameter_noinfo()
msvcr80.dll!:invoke_watson(....)
msvcr80.dll!:_crt_debugger_hook(...)
How can I prevent the debugger being called? This occurs at the end of a 30 minute simulation, at which point I lose all my results unless I can catch and log the exception. This and similar try/catch constructs have been working in the past - are there compiler settings which affect this? Help?
You may want to convert non-C++ exceptions into C++ exceptions. Here's an example of how to do it.
Apologies for the delay - unforeseen circumstances - but the real answer appears to be the following.
First, the application is also wrapped in a __try {} __except () {} construct, and uses unhandled exception filtering based on XCrashReport. This picks up the non C++ exceptions for the reasons many have pointed out above.
Second, however, as one can find here and elsewhere, since CRT 8.0, for security reasons Microsoft bypasses unhandled exception handling on buffer overruns (and certain other situations), and passes the issue directly to Dr Watson.
This is really annoying - I want to know where my buffer overruns are occurring, and why, and to fix them. I also want my program to crash, leave an audit trail, and then be automatically restarted, 24/7. Having MS Visual Studio on the PC seems to mean that Dr Watson will pause and offer me the option of using MSVC to debug the issue. However, until I respond to the dialog box, nothing will happen. Comments on workarounds greatly appreciated...
Just because you have a catch(...) doesn't mean you can catch and recover from all exceptions. Not all exceptions are recoverable.
You problem might be that the first exception that pin points the exact problem is getting obscured by your catch statement
You need to attach the debugger to the program and have it break on all exceptions and fix the code
Standard Library containers do not check for any logic errors and hence themselves never emit any exceptions.
Specifically, for std::vector only method that throws an exception is std::vector::at().
Any Undefined Behavior w.r.t to them will most likely lead your program to crash.
You will need to use Windows' SEH and C++ Exception Handling for catching Windows specific exceptions, which are non C++ standard btw.
At runtime, when myApp.exe crashes i receive "Unhandled Win32 exception" but how would i know which exception was occurred? where did something went wrong?
For a Native C++ app see my earlier answer here: Detect/Redirect core dumps (when a software crashes) on Windows for catching the unhandled exception (that also gives code for creating a crash dump that you can use to analyse the crash later. If the crash is happening on a development system then in Visual Studio (I'm assuming you're using that, if not other IDEs will have something similar), in Debug/Exceptions tick the 'Thrown' box for 'Win32 Exceptions'.
Typically, Windows will give you several hexadecimal numbers as well. Chances are that the exception code will be 0xC0000005. This is the code of an Access Violation. When that happens, you also will have three additional bits of information: the violating address, the violated address, and the type of violation (read, write or execute).
Windows won't narrow it down any further than that, and often it couldn't anyway. For instance, if you walk past the end of an array in your program, Windows likely won't realize that you were even iterating over an array. It just sees "read:OK, read:OK, read:out of bounds => page fault => ACCESS VIOLATION". You will have to figure that out from the violating address (your array iteration code) and the violated address (the out-of-bounds address behind your array).
If it's a .Net app you could try to put in a handledr for the UnhandledException event. You can find more information about it and some sample code here.
In general it's a good sign that your exception handling is broken though, so might be worth going through your code and finding places that could throw but where you don't handle exceptions.
Use the debugger. You can run the program and see what exception is been thrown that kills your application. It might be able to pinpoint the location of the throw. I have not used the VS debugger for this, but in gdb you can use catch throw to force a breakpoint when an exception is thrown, there should be something similar.