What can cause exception 0xc0000142 in CONSPAWN.EXE in windo

Posted by cverbiest on 12-Mar-2015 07:40

Hi,

I started a tech support case for this, but I ask the question here as well hoping that someone encountered (and solved)  this before.

Our batchserver (prowin32 started as windows service) spawns new prowin32 batchclients processes.

Those batchclient prowin32 executables execute a DOS SILENT DIR /B VALUE(WZ-IMPORT-FILE) > VALUE(WZ-TMP-FILE).

This works perfectly but sometimes it starts to fail . When it fails we see the error below in the event viewer.
When this occurs the problem persists for all newly started bachclients until we stop and start the batchserver .

Unfortunately this is on a system where we have no administrator rights.

Faulting application name: CONSPAWN.EXE, version: 11.3.0.1232, time stamp: 0x51e71c18
Faulting module name: KERNELBASE.dll, version: 6.3.9600.17278, time stamp: 0x53eeb4a3
Exception code: 0xc0000142
Fault offset: 0x00098f05
Faulting process id: 0xe84
Faulting application start time: 0x01d05c31cbb67669
Faulting application path: G:\progress\oe113\bin\CONSPAWN.EXE
Faulting module path: KERNELBASE.dll
Report Id: 0977d1e9-c825-11e4-80d6-005056886621
Faulting package full name:
Faulting package-relative application ID:

Posted by Matt Gilarde on 12-Mar-2015 08:16

0xc0000142 is "DLL Initialization failed". KERNELBASE.DLL can't initialize itself. Processes that run as services have less of some resources available to them by default. My guess is that you're running out of room in the desktop heap, which is a memory pool from which every process gets some resources. By default, the size of the desktop heap for services is much smaller than it is for interactive processes. There's a tool called DHeapMon which monitors the desktop heap. You could use this tool to see if that's the problem. Here's a page that covers everything you ever wanted to know about the desktop heap:

blogs.msdn.com/.../desktop-heap-overview.aspx

There's a lot of information there but if you just want to test my theory you can try to increase the size of the desktop heap to see if it solves the problem.

The desktop heap size is set in the registry in this value:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SubSystems\Windows

The "Windows" value is a long string. One part of the string will say something like "SharedSection=1024,20480,768". The third number (768 in this example) is the one you want to change. Increase it 4096 and reboot. If the problem goes away you had a desktop heap problem.

All Replies

Posted by Matt Gilarde on 12-Mar-2015 08:16

0xc0000142 is "DLL Initialization failed". KERNELBASE.DLL can't initialize itself. Processes that run as services have less of some resources available to them by default. My guess is that you're running out of room in the desktop heap, which is a memory pool from which every process gets some resources. By default, the size of the desktop heap for services is much smaller than it is for interactive processes. There's a tool called DHeapMon which monitors the desktop heap. You could use this tool to see if that's the problem. Here's a page that covers everything you ever wanted to know about the desktop heap:

blogs.msdn.com/.../desktop-heap-overview.aspx

There's a lot of information there but if you just want to test my theory you can try to increase the size of the desktop heap to see if it solves the problem.

The desktop heap size is set in the registry in this value:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SubSystems\Windows

The "Windows" value is a long string. One part of the string will say something like "SharedSection=1024,20480,768". The third number (768 in this example) is the one you want to change. Increase it 4096 and reboot. If the problem goes away you had a desktop heap problem.

Posted by cverbiest on 12-Mar-2015 08:59

Hi Matt, thanks we'll try that

This thread is closed