I am using OpenCvSharp4 4.1.0.20190416 and function for deep neural networks.
...
mDnn.SetInput(blob, "data");
// get output layer name
var outNames = mDnn.GetUnconnectedOutLayersNames();
// create mats for output layer
Mat[] outs = outNames.Select(_ => new Mat()).ToArray();
// Run dnn
mDnn.Forward(outs, outNames);
...
When during debugging step over the mDnn.Forward row, after while application crashed with access violation. But calling mDnn.Forward returns results without any problem. I don't have any idea, where could be problem.
Program Trace' has exited with code 0 (0x0).
has exited with code -1073741819 (0xc0000005) 'Access violation'.
Ok, I have found solution. It seems that everything can be solved by enabling
"Enable native code debugging" property in project properties at debug tab.
UPDATE
After enabling this property, application crash on different error.
Finally the problem was in Intel Graphic driver version:24
I have to uninstall the driver and everything is ok.
Uninstallation process
Related
I'm trying to build and run the Hello World sample at the tutorial page at R.NET. When I force the program to run in x86 mode, it seems to do OK. However, when I run in x64, it stops very early on with the message, "[program] exited with code-1073740791"
I've installed the latest version of R at The R Project and have ran the troubleshooting steps. The output I've gotten from the troubleshooting program is:
Is this process 64 bits? True
Info: caller provided rPath=null, rHome=null Info: R.NET looked for preset R_HOME env. var. Found null
Info: Found Windows registry key RDotNet.NativeLibrary.WindowsRegistryKey
Info: Found Windows registry key RDotNet.NativeLibrary.WindowsRegistryKey
Info: Found sub-key InstallPath under RDotNet.NativeLibrary.WindowsRegistryKey
Info: InstallPath value of key RDotNet.NativeLibrary.WindowsRegistryKey: C:\Program Files\R\R-4.0.3
Info: R.NET looked for platform-specific way (e.g. win registry). Found C:\Program Files\R\R-4.0.3
Info: R.NET trying to find rPath based on rHome; Deduced C:\Program Files\R\R-4.0.3\bin\x64
C:...\bin\x64\Debug\net5.0\ConsoleNet5R.exe
(process 33500) exited with code -1073740791.
I have verified that there IS a file R.dll where it deduced it should be, "C:\Program Files\R\R-4.0.3\bin\x64". When I step through using my decompiler, it appears that it gets choked up at what is showing up for me as line 400 in REngine.cs, under the function "Initialize" at this.GetFunction<setup_Rmainloop>()(); It doesn't appear to throw an exception, it just stops. I'll be honest--I'm not sure what this line is supposed to be doing...
Any ideas what is going on? I can run in x86 mode if I have to, but I would like to use x64 if possible.
This issue has been reported for a while..
I experienced the same with R-4.0.3 to R-4.0.5.
There is not such issue for R-4.0.2 and former versions (4.0.1, 4.0.0, 3.6, 3.5)
I've done an analysis of this and tracked findings in one of the RDotNet GitHub issues where this was raised (https://github.com/rdotnet/rdotnet/issues/139#issuecomment-898699993).
This appears to be related to the Control Flow Guard security feature enabled in Windows 10. This doesn't happen in the R programs themselves because they are compiled using a different compiler (gcc via mingw) than Microsoft's. However, the CFG feature is enabled for .NET binaries and there is something (sorry, I don't know the actual underlying root cause) in a change within R 4.0.3 in setjmp/longjmp calls that is causing the crash (see: https://github.com/wch/r-source/blob/trunk/src/gnuwin32/fixed/h/psignal.h#L44-L51).
Although you would actually be disabling a security feature, I have had some luck for now in modifying my program after it is compiled (you can set this as a post-build event). You will need to run something like: link /EDIT /GUARD:NO <yourapp>.exe, which disables CFG.
Thanks to https://github.com/dotnet/runtime/issues/11899#issuecomment-502195325 for providing the instructions needed for this workaround, and https://www.trendmicro.com/en_us/research/16/j/control-flow-guard-improvements-windows-10-anniversary-update.html for providing the amazing analysis of CFG that led to an understanding of what was going on.
I have a solution with multiple projects.
Its build in .NET Core 2.2 and uses for example .NET EF.
When calling a async method the debugger stops, no exception, try.. catch around it doesn't catch the error, debugger goes direct to the end of the console application. Cleaned up all bin/obj folders, removed .vs folder, checked all nuget packages for updates.
The code where it stopped it this moment is where I query EF async.
But before this I got the same error while executing other async functions of web-requests. All thirdparty libraries from Microsoft. After adding .wait() or .result the problem is solved and I can contine.
tRepository.Queryable().Where(q => q.Tenant.Guid == iBaseTenant.Guid).ToListAsync();
The program '[17052] dotnet.exe' has exited with code 0 (0x0).
The program '[17052] dotnet.exe: Program Trace' has exited with code 0 (0x0).
Found the solution, I forgot to add a await on a higher level. This function itself had the await, but the function calling this function was executed via a foreach loop where this did't wait for the result of all those items.
So when you have the same issue, please check if ALL levels have the await.
I have developed an C#.Net console application using Telegram Bot API.
The ProcessUpdates.cs file is now approximately 2.11Mb and has around 30500 line of code.
I am getting the following error, when I trying build the project:
unexpected error writing debug information -- insufficient memory to continue to execution of the program.
I've found only one instance of this error in This Link, But I did not get any results of its response.
Using Visual Studio 2015 Update-2 in Windows 10 x64 with 8Gb of memory.
I used the 'Release' Instead 'Debug' the problem is solved now, but I'm not sure again later cause problems or not.
I had a 77k Lines program source within VS2017 which caused the same error.
The offending source was generated using a program that I wrote.
I solved the issue in splitting up a 50k lines C# method the source contained, by adding these 6 lines around a 23K lines code block within the method:
#if DEBUG
void myOffendingCodeBlock() {
#endif
... // the original code
#if DEBUG
} myOffendingCodeBlock();
#endif
Clearly, this will only work when there are no goto's that jump out of the code block.
I have built a web app which suddenly stops while running. I could see the following in output window in my VS
The program '[29000] iisexpress.exe: Managed (v4.0.30319)' has exited with code -1073741819 (0xc0000005) 'Access Violation'
The program '[20648] iexplore.exe' has exited with code -1 (0xffffffff).
I have tried to debug to find the line where it fails. But it did not fail anywhere. The page was successfully loaded and it stops running after few seconds.
Check out the answers for this question.
You can try cleaning the solution/project and making sure you delete ASP.NET temporary files.
I noticed your error includes detail regarding IExplore.exe; makes me wonder if the debug process is unable to launch Internet Explorer due to something blocking that invocation. Try temporarily turning off Windows Firewall or any Anti-Virus program and make sure User Account Control (or LUA if on Windows Server) is disabled.
Description
When launching any Console Application, the code stops running immediately on an AccessViolationException (Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt). More info included in the next section.
Technical Symptoms
The Call Stack only contains external code:
Exception:Thrown: "The message filter indicated that the application is busy. >(Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))" (System.Runtime.InteropServices.COMException)
A System.Runtime.InteropServices.COMException was thrown: "The message filter indicated that the application is busy. (Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))"
Time: 12/10/2015 10:59:55 AM
Thread:vshost.NotifyLoad[15344]
I created a new Console Application, containing only Console.WriteLine("Hello world!");
Running the new Hello world app results in the same exception and an identical
call stack.
Background
I suspect this has nothing to do with the issue, as I will explain, but I feel it is important to answer the obvious question, "what were you doing when the issue happend?" The last change I made was adding an extension to my Selenium Driver to hotkey logout from an application:
public static void logout(this IWebDriver Driver)
{
Driver.FindElement(By.TagName("body")).Click();
new Actions(Driver)
.SendKeys(Keys.Control + Keys.Shift + "x")
.Perform();
}
I also made a change in my App.Config file for one of my projects, but reverting this had no impact either.
Removing this code (the Driver extension and/or the App.Config change) does not resolve this issue. Retrieving a previous check-in does not resolve the issue. I am the only person currently working on this solution.
Discoveries
As mentioned, this is happening for an empty Console Application. Windows Form Applications launch fine. Unit Test Projects launch fine as well.
Research
I've spent hours looking into this. It seems like every similar issue I have looked into is pertinent to debugging only or a .NET version. For me, the issue occurs with a Release as well. Additionally, I have been using .NET 4.5 without any issues or changes on that front. I can't find any articles that seem worth posting, but I might be overlooking something.
Visual Studio Info
Microsoft Visual Studio Ultimate 2013
Version 12.0.30501.00 Update 2
.NET Version 4.6.00081 (just noticed it says 4.5 in my project properties, though)
Running as Administrator
Feedback
When Running from devenv.exe /SafeMode, Visual Studio loaded with:
An exception was encountered while constructing the content of this frame. This information is also logged in "C:\Users\UserName\AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml".
Exception details:
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.VisualStudio.Shell.Interop.IVsShell5.LoadPackageWithContext(Guid& packageGuid, Int32 reason, Guid& context)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.GetPackage()
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
Additionally, when trying to run, I get an error message of "Error while trying to run project: Invalid Pointer" (again, VS in devenv.exe /SafeMode - see how to run visual studio without plugin and all third party feature if unfamiliar)
Please let me know if I can provide any additional information.
It may be because when you name the project you can't put spaces, I put them and it gave me a AccessViolationException aswell, try using capitals to separate your words, but only use letters and no spaces to be sure.
I also faced this issue with Visual Studio 2010. More interestingly I had several projects in my solution (Console application, WPF application, Windows Forms application) but it was failing only when, I was setting the project which was of type "Console Application" as start up project. Following change finally helped me nail down the issue: Go to project properties of the console application project -> Go to "Debug" tab -> Go to "Enable Debuggers" section in right pane -> Check the "Enable unmanaged code debugging" check box as shown in the snapshot below. Root cause of why it happened is still not known to me. Only thing which I observed as fishy was that there were lot of windows updates which had got installed on my machine the previous night which mostly constituted of office updates and OS updates (More than a dozen KB articles).