"Cannot Allocate Memory" error when you run a shell script in Windows 7 SP1, Windows Server 2008 R2 SP1, Windows 8 or Windows Server 2012

Article translations Article translations
Article ID: 2786401 - View products that this article applies to.
Expand all | Collapse all

On This Page

Symptoms

Assume that you have a computer that is running Subsystem for UNIX-based Applications (SUA). The computer is running one of the following operating systems:
  • Windows 7 Service Pack 1 (SP1)
  • Windows Server 2008 R2 Service Pack 1 (SP1)
  • Windows 8
  • Windows Server 2012
When you try to run a shell script to create many environment variables, the script fails and you receive an error message that resembles the following:
Cannot Allocate Memory

Note
This issue only occurs when the environment variable block size is over 64 kilobytes (KB).

Cause

This issue occurs because the string length that is specified for the RtlSetEnvironmentVar API is incorrect when the environment variable block size is over 64 KB.

Resolution

This hotfix is also available at Microsoft Update Catalog

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website:
http://support.microsoft.com/contactus/?ws=support
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

To apply this hotfix, you must be running one of the following operating systems:
  • Windows 7 Service Pack 1 (SP1)
  • Windows Server 2008 R2 Service Pack 1 (SP1)
  • Windows 8
  • Windows Server 2012
Additionally, you must have Utilities and Software Development Kit (SDK) for Subsystem for UNIX-based Applications installed.

For more information about how to obtain a Windows 7 or Windows Server 2008 R2 service pack, click the following article number to view the article in the Microsoft Knowledge Base:
976932 Information about Service Pack 1 for Windows 7 and for Windows Server 2008 R2

Registry information

To apply this hotfix, you do not have to make any changes to the registry.

Restart requirement

You must restart the computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace a previously released hotfix.

File information

Collapse this imageExpand this image
assets folding start collapsed
The global version of this hotfix installs files that have the attributes that are listed in the following tables. The dates and the times for these files are listed in Coordinated Universal Time (UTC). The dates and the times for these files on your local computer are displayed in your local time together with your current daylight saving time (DST) bias. Additionally, the dates and the times may change when you perform certain operations on the files.
Windows 7 and Windows Server 2008 R2 file information notes
Important Windows 7 hotfixes and Windows Server 2008 R2 hotfixes are included in the same packages. However, hotfixes on the Hotfix Request page are listed under both operating systems. To request the hotfix package that applies to one or both operating systems, select the hotfix that is listed under "Windows 7/Windows Server 2008 R2" on the page. Always refer to the "Applies To" section in articles to determine the actual operating system that each hotfix applies to.
  • The files that apply to a specific product, SR_Level (RTM, SPn), and service branch (LDR, GDR) can be identified by examining the file version numbers as shown in the following table:
    Collapse this tableExpand this table
    VersionProductMilestoneService branch
    6.1.760 1.22xxxWindows 7 and Windows Server 2008 R2SP1LDR
  • The MANIFEST files (.manifest) and the MUM files (.mum) that are installed for each environment are listed separately in the "Additional file information for Windows 7 and for Windows Server 2008 R2" section. MUM and MANIFEST files, and the associated security catalog (.cat) files, are extremely important to maintaining the state of the updated component. The security catalog files, for which the attributes are not listed, are signed with a Microsoft digital signature.
For all supported x86-based versions of Windows 7
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Psxdll.dll6.1.7601.22195309,24816-Dec-201218:37x86
Psxdllsvr.dll6.1.7601.22195357,88816-Dec-201218:37x86
Psxss.exe6.1.7601.22195656,89616-Dec-201214:43x86
Sua-ppdlic.xrm-msNot applicable2,98116-Dec-201218:57Not applicable
For all supported x64-based versions of Windows 7 and of Windows Server 2008 R2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Psxdll.dll6.1.7601.22195330,24016-Dec-201217:41x64
Psxdllsvr.dll6.1.7601.22195378,36816-Dec-201217:41x64
Psxss.exe6.1.7601.22195849,40816-Dec-201215:04x64
Sua-ppdlic.xrm-msNot applicable2,98116-Dec-201218:07Not applicable
Psxdll.dll6.1.7601.22195328,19216-Dec-201218:37x86
Psxdllsvr.dll6.1.7601.22195376,83216-Dec-201218:37x86
Psxdll.dll6.1.7601.22195328,19216-Dec-201218:37x86
For all supported IA-64-based versions of Windows Server 2008 R2
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Psxdll.dll6.1.7601.22195718,84816-Dec-201216:17IA-64
Psxdllsvr.dll6.1.7601.22195744,44816-Dec-201216:17IA-64
Psxss.exe6.1.7601.221951,649,66416-Dec-201214:26IA-64
Posixsscom.dll6.1.7601.221955,63216-Dec-201214:42x86
Psxdll.dll6.1.7601.22195328,19216-Dec-201218:37x86
Psxdllsvr.dll6.1.7601.22195376,83216-Dec-201218:37x86
Windows 8 and Windows Server 2012 file information notes
Important Windows 8 and Windows Server 2012 hotfixes are included in the same packages. However, only "Windows 8" is listed on the Hotfix Request page. To request the hotfix package that applies to one or both operating systems, select the hotfix that is listed under "Windows 8" on the page. Always refer to the "Applies To" section in articles to determine the actual operating system that each hotfix applies to.
  • The files that apply to a specific product, milestone (RTM,SPn), and service branch (LDR, GDR) can be identified by examining the file version numbers as shown in the following table:
    Collapse this tableExpand this table
    VersionProductMilestoneService branch
    6.2.920 0.20 xxxWindows 8 and Windows Server 2012RTMLDR
  • The MANIFEST files (.manifest) and the MUM files (.mum) that are installed for each environment are listed separately in the "Additional file information for Windows 8 and for Windows Server 2012" section. MUM and MANIFEST files, and the associated security catalog (.cat) files, are extremely important to maintain the state of the updated components. The security catalog files, for which the attributes are not listed, are signed with a Microsoft digital signature.
For all supported x86-based versions of Windows 8
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Psxdll.dll6.2.9200.20657289,28009-Mar-201304:24x86
Psxdllsvr.dll6.2.9200.20657339,45609-Mar-201304:24x86
Psxss.exe6.2.9200.20657650,24009-Mar-201304:25x86
Sua-ppdlic.xrm-msNot Applicable2,87309-Mar-201307:43Not Applicable
For all supported x64-based versions of Windows 8 and of Windows Server 2012
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Psxdll.dll6.2.9200.20657315,90409-Mar-201304:59x64
Psxdllsvr.dll6.2.9200.20657364,03209-Mar-201304:59x64
Psxss.exe6.2.9200.20657837,12009-Mar-201305:00x64
Sua-ppdlic.xrm-msNot Applicable2,87310-Mar-201301:19Not Applicable
Psxdll.dll6.2.9200.20657305,15209-Mar-201304:24x86
Psxdllsvr.dll6.2.9200.20657354,30409-Mar-201304:24x86
Collapse this imageExpand this image
assets folding end collapsed

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Additional file information

Collapse this imageExpand this image
assets folding start collapsed

Additional file information for Windows 7 and for Windows Server 2008 R2

Additional files for all supported x86-based versions of Windows 7
Collapse this tableExpand this table
File nameX86_d1d3e2cfd1573a5086cbc1ae0e34227d_31bf3856ad364e35_6.1.7601.22195_none_d6235662a99095b7.manifest
File versionNot applicable
File size707
Date (UTC)18-Dec-2012
Time (UTC)06:33
PlatformNot applicable
File nameX86_subsystem-for-unix-based-applications_31bf3856ad364e35_6.1.7601.22195_none_7623bf20678f756b.manifest
File versionNot applicable
File size62,446
Date (UTC)18-Dec-2012
Time (UTC)06:36
PlatformNot applicable
Additional files for all supported x64-based versions of Windows 7 and of Windows Server 2008 R2
Collapse this tableExpand this table
File nameAmd64_2fb9030afc4f5a84d5c70e7814b63899_31bf3856ad364e35_6.1.7601.22195_none_bd77bdfff55d7104.manifest
File versionNot applicable
File size716
Date (UTC)18-Dec-2012
Time (UTC)06:33
PlatformNot applicable
File nameAmd64_ee855c5f7f3358d37718528ea64d446f_31bf3856ad364e35_6.1.7601.22195_none_853cef94ff17f9a6.manifest
File versionNot applicable
File size716
Date (UTC)18-Dec-2012
Time (UTC)06:33
PlatformNot applicable
File nameAmd64_eeab6e1f12351a34357a45d41ea85445_31bf3856ad364e35_6.1.7601.22195_none_3feb26a91c44d31e.manifest
File versionNot applicable
File size1,064
Date (UTC)18-Dec-2012
Time (UTC)06:33
PlatformNot applicable
File nameAmd64_subsystem-for-unix-..d-applications-core_31bf3856ad364e35_6.1.7601.22195_none_52b77cb1d0692a3f.manifest
File versionNot applicable
File size58,151
Date (UTC)18-Dec-2012
Time (UTC)06:39
PlatformNot applicable
File nameAmd64_subsystem-for-unix-based-applications_31bf3856ad364e35_6.1.7601.22195_none_d2425aa41fece6a1.manifest
File versionNot applicable
File size63,787
Date (UTC)18-Dec-2012
Time (UTC)06:40
PlatformNot applicable
File nameWow64_subsystem-for-unix-..d-applications-core_31bf3856ad364e35_6.1.7601.22195_none_5d0c270404c9ec3a.manifest
File versionNot applicable
File size42,861
Date (UTC)18-Dec-2012
Time (UTC)06:39
PlatformNot applicable
File nameWow64_subsystem-for-unix-based-applications_31bf3856ad364e35_6.1.7601.22195_none_dc9704f6544da89c.manifest
File versionNot applicable
File size42,787
Date (UTC)18-Dec-2012
Time (UTC)06:39
PlatformNot applicable
Additional files for all supported IA-64-based versions of Windows Server 2008 R2
Collapse this tableExpand this table
File nameIa64_7604db672cbb1af03eb08856158462fa_31bf3856ad364e35_6.1.7601.22195_none_a88f90d733ea8a5e.manifest
File versionNot applicable
File size1,062
Date (UTC)18-Dec-2012
Time (UTC)06:33
PlatformNot applicable
File nameIa64_subsystem-for-unix-based-applications_31bf3856ad364e35_6.1.7601.22195_none_76256316678d7e67.manifest
File versionNot applicable
File size63,784
Date (UTC)18-Dec-2012
Time (UTC)06:33
PlatformNot applicable
File nameWow64_subsystem-for-unix-based-applications_31bf3856ad364e35_6.1.7601.22195_none_dc9704f6544da89c.manifest
File versionNot applicable
File size41,411
Date (UTC)16-Dec-2012
Time (UTC)18:54
PlatformNot applicable

Additional file information for Windows 8 and for Windows Server 2012

Additional files for all supported x86-based versions of Windows 8
Collapse this tableExpand this table
File nameUpdate.mum
File versionNot Applicable
File size1,808
Date (UTC)11-Mar-2013
Time (UTC)08:46
PlatformNot Applicable
File nameX86_abc6db3707e75a09460f94e1d26eafff_31bf3856ad364e35_6.2.9200.20657_none_02b4f29ac0374f57.manifest
File versionNot Applicable
File size707
Date (UTC)11-Mar-2013
Time (UTC)08:46
PlatformNot Applicable
File nameX86_subsystem-for-unix-based-applications_31bf3856ad364e35_6.2.9200.20657_none_714074dfda58f2e4.manifest
File versionNot Applicable
File size65,697
Date (UTC)11-Mar-2013
Time (UTC)08:46
PlatformNot Applicable
Additional files for all supported x64-based versions of Windows 8 and of Windows Server 2012
Collapse this tableExpand this table
File nameAmd64_9a8f20613198143a7d8884742138d897_31bf3856ad364e35_6.2.9200.20657_none_5262302ca9ad9685.manifest
File versionNot Applicable
File size1,064
Date (UTC)11-Mar-2013
Time (UTC)08:47
PlatformNot Applicable
File nameAmd64_subsystem-for-unix-based-applications_31bf3856ad364e35_6.2.9200.20657_none_cd5f106392b6641a.manifest
File versionNot Applicable
File size66,813
Date (UTC)11-Mar-2013
Time (UTC)08:47
PlatformNot Applicable
File nameUpdate.mum
File versionNot Applicable
File size1,818
Date (UTC)11-Mar-2013
Time (UTC)08:47
PlatformNot Applicable
File nameWow64_subsystem-for-unix-based-applications_31bf3856ad364e35_6.2.9200.20657_none_d7b3bab5c7172615.manifest
File versionNot Applicable
File size41,529
Date (UTC)11-Mar-2013
Time (UTC)08:47
PlatformNot Applicable
Collapse this imageExpand this image
assets folding end collapsed

Properties

Article ID: 2786401 - Last Review: May 15, 2013 - Revision: 3.0
Applies to
  • Windows Server 2008 R2 Service Pack 1, when used with:
    • Windows Server 2008 R2 Enterprise
    • Windows Server 2008 R2 Datacenter
    • Windows Server 2008 R2 for Itanium-Based Systems
    • Windows Server 2008 R2 Foundation
    • Windows Server 2008 R2 Standard
    • Windows Web Server 2008 R2
  • Windows 7 Service Pack 1, when used with:
    • Windows 7 Enterprise
    • Windows 7 Home Basic
    • Windows 7 Home Premium
    • Windows 7 Professional
    • Windows 7 Starter
    • Windows 7 Ultimate
  • Windows 8
  • Windows 8 Enterprise
  • Windows 8 Pro
  • Windows Server 2012 Datacenter
  • Windows Server 2012 Essentials
  • Windows Server 2012 Standard
Keywords: 
kbautohotfix kbqfe kbhotfixserver kbfix kbsurveynew kbexpertiseadvanced kberrmsg KB2786401

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com