Problems while starting console programs on Windows 7 x64 (0xc0000142)

1

a customer of us has the problem that sometimes the error 0xc0000142 (Application failed to initialize properly) occurs while our software tries to execute a console program.

Since the console program run properly if we start it manually, a virus, which infected the system files, can be excluded. Furthermore it is a computer in a company network which has no direct access to the internet and is strictly managed by the IT (the users have less privileges and must ask the IT for installing programs, etc.).

After some research I've found this: http://blogs.technet.com/b/askperf/archive/2007/07/24/sessions-desktops-and-windows-stations.aspx

And for short this: http://support.microsoft.com/kb/824422/en-us

We have already tried this, but it didn't help. We raised the heap size for the non-interactive desktop, but the error still occurs.

But the conditions for the error are the same like in the Knowledge base article: - The computer runs multiple days long without any reboot - Many processes run on this computer - The process is executed "silent" (hence it should run in the non-interactive desktop space)

The computer has Windows 7 x64 SP1 as operating system, but the crashing console program has the x86 architecture.

Any ideas how to solve this problem?

windows-7
windows
asked on Super User May 21, 2014 by David Gausmann

2 Answers

0

Quite a broad subject using just the OS and Error however how I would troubleshoot:

Is that error from the event logs or somewhere else (possible to get a copy of any errors in event log at time of failure)?

Have you setup any perfmon to check for any CPU/Memory spikes during the crash?

You can try to run SFC /SCANNOW from command prompt which might solve any underlying OS issues.

Can you replicate the problem by running the program manually?

answered on Super User May 21, 2014 by CharlesH
0

For those who also have this problem: I didn't find a solution via a Windows configuration or similary. The program (which has been written by myself) only imported functions from kernel32.dll (which should always work). However kernel32.dll is sometimes not available on Remote Desktop systems.

My solution was it to take the source code (from the EXE) and put it into a DLL. The host process calls now the DLL instead of the EXE. Since this DLL doesn't cause a new process on execution (the code is running in-process), the bug didn't occur on Remote Desktop systems anymore. So in my case the problem was resolved.

answered on Super User Jan 19, 2016 by David Gausmann

User contributions licensed under CC BY-SA 3.0