Windows stops working
My program uses Fortran and C++ via VS2017. I spawn many processes with _spawnl(). The program runs and gets the right answers. But after many cycles, Windows seems to be corrupted. Some apps won't open or show a black screen, and even the power/restart menu item won't work.
Is there any diagnostic tool I can run when this happens, to look inside Windows and see if something is amiss? I have no clue what is wrong.
C++
-
Viorel 118.5K Reputation points
2021-09-16T14:15:16.273+00:00 Try a simple system tool: Task Manager. Check if there are enough free memory and CPU resources. Check if the number of processes, started by your code, is abnormally large. In Details tab you can also add some columns (GDI objects, Handles, Threads, etc.) to see the evolution before and after your applications.
Are you using the _P_NOWAIT argument for _spawnl?
-
RLWA32 45,951 Reputation points
2021-09-16T14:23:56.337+00:00 This sounds like the same issue that was discussed here - createfilemapping-possible-memory-leak.
Did you ever manage to open a support case with Microsoft?
-
Don Dilworth 1 Reputation point
2021-09-16T15:30:39.13+00:00 Yes, I use _P_NOWAIT.
iI have followed the Task Manager as I do this, and the results are as follows:
Before: Threads = 3512, Handles = 83889, Memory = 3%.
While running: Threads = 3740; Handles about 120000, Memory = 4%.
Afterwards: Threads = 3421, Handles slowly comes down to about 108000, Memory = 3%.
There is nothing in the Event Viewer that looks like an error.
-
Don Dilworth 1 Reputation point
2021-09-16T15:33:59.11+00:00 The link you quote was from me, and I never received any advice that worked.
I don't know how to open a support case with Microsoft. I tried and got a zillion categories to choose from. I tried opening a chat with them, but I was number 309 waiting in line and gave up.
Is there any utility that can figure out what's wrong with Windows? That would be a useful clue.
-
RLWA32 45,951 Reputation points
2021-09-16T15:43:26.863+00:00 See if the Application Verifier tool provides some useful information. application-verifier
-
Don Dilworth 1 Reputation point
2021-09-16T17:37:27.503+00:00 Excellent suggestion! My system does not have AppVerif.exe, and when I found a source and tried to install it, I got a message that it won't install on 64-bit systems.
Is there a different version? How do I install it?
-
RLWA32 45,951 Reputation points
2021-09-16T17:53:13.563+00:00 Both x86 and x64 versions were installed with VS2019 as part of the Windows SDK component on a Windows 10 x64 system. Under the Windows KIts folder in the start menu.
-
Don Dilworth 1 Reputation point
2021-09-16T18:18:52.347+00:00 I'm using VS 2017, and my drive C does not have a Windows Kit folder. Where is it?
-
RLWA32 45,951 Reputation points
2021-09-16T19:30:05.813+00:00 Should be under C:\Program Files (x86)
-
Don Dilworth 1 Reputation point
2021-09-16T20:43:41.19+00:00 I installed one called Application Verifier for Mobile 5.0. But it won't run. Where can I get a real version that will run in Win32 mode?
-
RLWA32 45,951 Reputation points
2021-09-16T22:06:57.567+00:00 You should be able to use Control Panel->Programs and Features to install it from the Windows SDK. In Programs and Features select the Windows SDK installed with VS2017 and press "Change". The SDK installer should display a dialog for actions and you should select "Change" again. At that point another dialog should display from which you can check the Application Verifier selection and proceed to install it.
-
Don Dilworth 1 Reputation point
2021-09-17T15:18:41.79+00:00 When I try this, I get a list that includes "Windows Software Development Kit - Windows 10.0.17763.132, and a second one numbered 10.0.26624.
I chose the second one, and got a dialog to select the features to change. The Application Verifer is indeed on that list. It's already selected, but the Change button is greyed out.
Then I tried selecting Repair instead of Change, and it ran for a while.
Then I went to Start->Windows Kits and I see Application Verifier (WOW) and (x64). I click those, and get a box asking if I want to run it. I say yes, the box closes, and nothing else happens.
Is this normal?
I should add that in the folder Application Verifier there are exactly three files, a dll, an h, and an idl. There is no exe file there.
-
RLWA32 45,951 Reputation points
2021-09-17T18:43:39.067+00:00 Is the application verifier from the 10.0.17763.132 SDK installed?
-
Don Dilworth 1 Reputation point
2021-09-17T20:21:32.147+00:00 I thought it was. So I ran the Kit again, selected that version, and clicked Uninstall, planning to reinstall it.
But now that Kit is no longer in the list. So I cannot reinstall it.
So I selected version 10.0.26624 and clicked Repair. It ran for a while.
But the Application Verifier folder still has only three files, none an exe.
What do I do now?
-
RLWA32 45,951 Reputation points
2021-09-17T20:32:28.953+00:00 See if you can use the Visual Studio Installer to reinstall that Windows SDK
-
Don Dilworth 1 Reputation point
2021-09-18T21:33:04.817+00:00 What I need is exact instructions on how to download and install the Application Verifier. Nothing I have tried works.
-
RLWA32 45,951 Reputation points
2021-09-19T01:31:20.397+00:00 The Application Verifier is part of the Windows SDK. That's why I suggested that you try to reinstall the 10.0.17763.132 SDK with the Visual Studio Installer (should be on your start menu). Did you try this?
-
RLWA32 45,951 Reputation points
2021-09-19T09:36:35.287+00:00 BTW, I don't know where you looked but the Application Verifier application is located in the System32 folder for x64 and the SYSWOW64 folder for x86.
-
Don Dilworth 1 Reputation point
2021-09-19T13:36:38.92+00:00 I l reinstalled VS2017, then chose Repair. it ran a long time.
Then I looked all over, and I do not have a System32 folder. Where should it be?And I have no SYSWOW... folder either.
But I have a Program Files folder and Program Files folder (x86). These both have a folder that says Application Verifier. And in both cases there are three files in them: vrfauto.dll, vrfauto.h and vrfauto.idl. There is no .exe file anywhere.
What did I do wrong? What do I do now?
-
RLWA32 45,951 Reputation points
2021-09-19T14:12:47.193+00:00 I apologize for not being specific. I assumed you would understand that System32 and SysWOW64 are located under the C:\Windows folder. The executables that start the Application verifier's user interface are located in those two folders. For example -
x64
and
x86
-
Don Dilworth 1 Reputation point
2021-09-19T16:14:53.25+00:00 I have indeed looked, and the folders Windows SysWOW64 and System32 there are indeed files called appferif.exe. So that is progress, thank you! But if I try to run either of these, a window opens that asks me if I want to run it, and I click Yes. then nothing happens.
Us that the wrong file? What is the file supposed to be named?
-
RLWA32 45,951 Reputation points
2021-09-19T18:28:20.093+00:00 If you have located the application (appverif.exe) and doubled-clicked on it in explorer then you would ordinarily receive a UAC consent prompt since the application needs to run with Administrator privileges. After responding Yes then application verifier should present its user interface as shown below -
At this point you need to identify to it the application you want to run it against and select the specifics. Details of exactly how to use Application Verifier are contained in its help file. Basically, you identify the application, make your selections and exit the application verifier. Then you run your application. After your application terminates you run the application verifier again and view the report it has created for your application.
-
Don Dilworth 1 Reputation point
2021-09-19T19:04:54.813+00:00 Under Windows | SysWOW64, I see a file appverif.exe. If I right-click and select Run as Administrator, I see the Account Control dialog, and I click Yes.
At this point, a frame opens for an instant and then closes.
If I use the version in system32, the same thing happens.
Is my system screwed up, or am I doing something wrong?
-
RLWA32 45,951 Reputation points
2021-09-19T19:09:46.707+00:00 What you describe is not normal behavior . Sounds to me like something is wrong with the system or the installation of the Windows SDK. I'd look in the event logs to see if there are any error messages.
-
Don Dilworth 1 Reputation point
2021-09-19T19:39:47.997+00:00 Indeed. The only error I see in the Event Viewer is this, and it shows up twice, in the System section.
The description for Event ID 7023 from source Service Control Manager cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
ZeroConfigService
%%2147770990I
-
Don Dilworth 1 Reputation point
2021-09-19T19:40:11.553+00:00 I also see this, in the Application section:
Service cannot be started. System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' ---> System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly ... -
RLWA32 45,951 Reputation points
2021-09-19T19:56:32.783+00:00 Sorry, but I don't know how best to proceed at this point to address the many anomalous behaviors that you have described. I hate to say it but maybe its time to do a clean reinstall of Windows and Visual Studio.
Sign in to comment