Windows Server 2008 does not like my exe (KernelBase.dll) - 64-bit

I have written an app to run on 64bit Windows Server 2008, it needs to go in the schedular as it needs to run every 15 minutes. For some reason the program crashes after being open for a few minutes (this is without it being in the schedular). The program runs fine on both my 32bit laptop and a colleagues 64 bit laptop, but fails on this server. Error details:
EventType = APPCRASH
Fault Module Name = KERNELBASE.dll
Fault module Version = 6.1.7600.16385
Exception Code = e053534f
Any help on this would be most appreciated, ive already tried changing the target platform to x64, setting DetectNewerInstalledVersions to false, running as administrator and changing the compatability settings to what the compatability checker recommends (Windows XP Service Pack 2) and still no avail....

That's very little to go by. However, the exception code is EXCEPTION_SOFTSO, a "soft stack overflow" exception. It is raised when the CLR is about to run managed code but detects that there isn't enough stack space left to safely execute the code.
You'll need a debugger to get to the bottom of it. Use the Debug + Exceptions dialog to make the debugger stop at the exact point where the exception is raised.

Related

Unhandled exception at 0x008EAE83

I have a Windows MFC application that is crashing on launch on a customer's Windows Server OS. The application runs fine on our Windows 10 workstations and Windows Server 2019 test OS. I have a crash dump and loaded the debug symbols but all I get is this call stack:
MyApp.exe!abort() Line 77
at minkernel\crts\ucrt\src\appcrt\startup\abort.cpp(77)
MyApp.exe!terminate() Line 58
at minkernel\crts\ucrt\src\appcrt\misc\terminate.cpp(58)
[External Code]
The exception is Unhandled exception at 0x008EAE83 (MyApp.exe) in MyApp.exe.9156.dmp: Fatal program exit requested.
Event viewer gives an application exception error code 0xc0000409 or STATUS_STACK_BUFFER_OVERRUN. But apparently, this can be called even though it's not actually a stack buffer overrun.
The weird thing is, if we insert AfxMessageBox() at the start of the app - CMainFrame::OnCreate() then it doesn’t crash and it launches fine.
There is an existing binary built using VS2008 or VS2013 with the same code that launches fine. We are unable to recreate that build from source code though.

How to solve "File is in use" Windows 10 error when the file is actually not in use

I develop software using Visual Studio 2017 on Windows 10 Home with the latest updates. When my application throws an exception, the executable according to Windows remains open by itself. When I (or Visual Studio) try to delete (overwrite it with newly built executable) Windows says test.exe is open by test.exe and cannot be deleted even though test.exe is not running and there are no other processes that have a handle to test.exe (verified by running Sysinternals handle.exe tool). The only way to deal with this problem is to reboot Windows or log off and log on.
test.exe uses test.dll. If the exception happens in test.dll code, then test.dll will stay locked until reboot.
I did not have this problem on my previous old laptop with the same OS and I don't have it on my work laptop with Windows 10 Pro.
The .net application is a console one written in c#. The content of the code does not matter, it can be just one line that generates any exception. If I run the binary from explorer, I do not experience this problem, only when I run it from the command line. If I kill the main thread test.exe of my test.exe process in sysinternals process explorer before I hit "debug" or "close" button, then I can delete the file without a problem.
It looks like a Windows bug but why I did not have it in my old laptop and my work laptop?
I wonder if anyone else has experience the same problem? Or even better if someone knows how to fix it.
Thanks a lot!

Attaching MSVC 2012 profiler hangs the application

I have a C++ application (it's built using Qt 5.8 library and works with PostgreSQL 9.5 database in case it's relevant). The application is build by MSVC 2012 compiler, is 64-bit application and both debug and release versions run normally on their own and under cdb debugger.
When I try to profile the running application by Visual Studio instrument (Analyze -> Profiler -> Attach), it seemingly hangs as soon as it tries to do something meaningful: simply resizing a window or clicking on checkboxes works, but any attempt to compute new values and write them to database never succeeds, as if control flow didn't return from some call.
When I stop the profiling, Studio marks as a "hot path" sequence of calls RtlWalkFrameChain->RtlpWalkFrameChain->RtlpLookupFunctionEntryForStackWalks->RtlLookupFunctionTable->RtlAcquireSRWLockShared.
RtlpWalkFrameChain has the biggest "exclusive samples" count.
Trying to filter data to exclude initial several seconds of run (until the apparent freeze) results in "No Call Tree Data Is Available" message.
I didn't manage to find any article or post with a similar problem.
The project is build in Qt Creator (I don't have a project file Studio would understand, so I can't run "normal" performance analysis).
OS is Windows 7, exact version of Visual Studio is 11.0.61219.00 Update 5.
Any idea on the subject would be welcome.
Upd: When I try to profile the application with Luke Stackwalker profiler, it aborts with the message ERROR: StackWalk64-Endless-Callstack!. The only relevant comment about the message I found is this Stackoverflow question. When I run application under cdb debugger and then try to profile it with Luke Stackwalker, the error message is the same, but subsequent pause in the debugger shows the proper (or at least believable) stack for all threads. For the working thread debugger points to a line of code inside system library and doesn't advance no matter what I do (once again, without profiling attempts the application runs normally, debugger or not).

"A remote operation is taking longer than expected" x64

First off, I think I've been to every website and forum there is that's discussing this issue and I've tried many different things. I'm at my wits end. This is the dumbest thing and I just want to start coding again!
I'm using Visual Studio Express 2012 for Windows Desktop. I have a x64 project I'm trying to run in Debug mode using the local windows debugger. The only external library I'm using is that of which is required to run DX11.
I attempt to run my program and it freezes. A window pops up saying "A remote operation is taking longer than expected."
I click Terminate and another window pops up asking if I'd like to terminate the remote session. Why yes, I would.
Then it says, "Unable to start program (my path leading to my .exe). The network connection to the Visual Studio Remote Debugger has been closed."
To my understanding, because Visual Studio itself is a 32 bit application, it needs to use the Remote Debugger to compile to x64. Is that correct?
Regardless, I'm still failing to see where that would break down. I've ran several repairs on VS and upgraded to Service Pack 2 (or 1, whichever is the latest).
I've ran a windows repair and uninstalled any VMWare type stuff on my computer. I'm not using a VPN.
I've even copied msvsmon.exe from my laptop (working instance of the project) over to this computer and still no luck.
I'm about ready to Nuke my OS and do a clean install on everything. sigh
Found the problem. It wasn't Windows Firewall like other threads describe. It was my internet filter. I guess it decided to try and block msvsmon.exe because it was using the network. Adding it, along with WDExpress.exe to the application exceptions list did the trick.

c++ - cli application compiled on Windows 8 can not start on Windows Server 2008 R2 if boost/thread.hpp is included

My application starts fine on my Windows 8 laptop.
However I can not start it on Windows Server 2008 R2. Following error occured:
The exception unknown software exception (0xe0434352) occured in the application at location 0xfd5ecaed.
The following is printed in the command line:
Unhandled Exception: Cannot print exception string because Exception.ToString() failed.
My solution contains one c++-cli project which i'm trying to use, and if I do not use it then everything works fine, so commenting just this line helps:
// private static CliAdapterMain cliAdapter = new CliAdapterMain();
I've tried:
repair .NET Framework 4.5 on target machine
repair/reinstall VS 2012 Update 1 Redistributable (both x86 and x64, version 11.0.51106.1)
updated my VS2012 to Update 1 recompiled project
no Windows pending updates, tried to reboot system several times
Dependency Walker claims that following DLL's are missing: GPSVC.DLL IESHIMS.DLL MF.DLL MFPLAT.DLL MFREADWRITE.DLL WLANAPI.DLL However they exist on target computer, for example here
c:\Windows\winsxs\amd64_microsoft-windows-grouppolicy-base_31bf3856ad364e35_6.1.7601.17514_none_8649674dfda23046\gpsvc.dll
Probably I can try manually reregister missing dll's, but i don't think this is really a problem. Looking at an exception it seems that something is broken, not something is missing.
upd: From Windows logs:
Va.MBClient.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException
Stack:
at Va.MBClient.Program.Main(System.String[])
So I guess that private static CliAdapterMain cliAdapter = new CliAdapterMain(); is failed but i don't know why.
upd played with my application a little. Finally i've found just one line of code that causes a failure. This is #include <boost/thread.hpp>. Why this doesn't work? I'm using latest version of boost (1.52), but i did built it on my Windows 8 machine. Should I rebuilt everything for Windows Server 2008 R2? Should I built entire project on Windows Server 2008 R2?
It is due to in the Windows Sever, some features is not enabled by default, you need to add the Windows Media Services and Wireless LAN Service by yourself to get the Dll back.
You can reference to MSDN

Resources