Community
cancel
Showing results for 
Search instead for 
Did you mean: 
kfsone
New Contributor I
259 Views

Catastrophic error: unable to obtain mapped memory (see pch_diag.txt)

Getting this error with 11.1.051 and earlier versions when doing a Rebuild Project.

a/ There is no file called pch_diag.txt anywhere on the system;

b/ I can sometimes fix this by changing the #include order of one of the STL includes, such as or ,

c/ I cannot post a test case because which file it fails on varies and the code is proprietary,

Our project uses a precompiled header, which is built with the first .cpp file in the project. The next few files compile fine, and then it compiles some files which don't use the PCH file before going back to files that do, which is where the error occurs, e.g:

1> FirstFile.cpp <-- builds the pch
1> AnotherFile.cpp <-- uses pch
1> AnotherFile2.cpp <-- uses pch
1> oldfile.c <-- does not use pch
1> olderfile.c <-- does not use pch
1> MergedProjectFile.cpp <-- does not use pch
1> MergedProjectFile2.cpp <-- does not use pch
...
1> MergedProjectFileN.cpp <-- still not using pch
1> MainProjFile1.cpp <-- uses PCH
1> MainProjFile2.cpp <-- uses PCH
1> MainProjFile3.cpp <-- uses PCH
1> MainProjFile4.cpp <-- uses PCH

It's the first files after the non-PCH files that seem to have the problem. It's usually the second or third one, but occasionally it's the first one. Which one fails is random, you can run rebuild multiple times and there is no consistency to it.

I have stripped our PCH down to just the STL includes. Error still occurs regardless, when I use OpenMP.

Also, we are using /FI to include the header from which the PCH is generated.

If I run Rebuild Project Only twice, without making any changes, sometimes it fails on the first file after the non-PCHed files, sometimes it fails on the second or third file. It is not consistent.

Running VS 2008 on a Windows 7 64-bit box with 8Gb of RAM, compiling x86 targetted code.

- Oliver

0 Kudos
7 Replies
JenniferJ
Moderator
259 Views

We do have fixed one bug related to such pch error, but not sure if it would cover your case.

Please try the latest compiler 11.1.060 and let us know how it goes.

Thanks,
Jennifer
kfsone
New Contributor I
259 Views

Jennifer,
No luck:
Again, remember: this only starts when I enable Languages -> OpenMP support. We don't have any OpenMP directives in the code as this point, however:
1>------ Rebuild All started: Project: WW2, Configuration: BetaReleaseSSE2SmrtHeap Win32 ------
1>Deleting intermediate files and output files for project 'WW2', configuration 'BetaReleaseSSE2SmrtHeap|Win32'.
1>Compiling resources... (Microsoft VC++ Environment)
1>Microsoft Windows Resource Compiler Version 6.1.6723.1
1>
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>TextureRectangle.cpp
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>trncd.cpp
1>dimain.cpp
1>Catastrophic error: unable to obtain mapped memory (see pch_diag.txt)
1>
1>compilation aborted for ..\..\src\di\dimain.cpp (code 4)
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>sysMovieWin.cpp
1>NPClient.cpp
1>clientGlobals.cpp
1>rijndael-alg-fst.c
1>rijndael-api-fst.c
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>dx3dinfo.cpp
1>Build log was saved at "file://G:\PN\ww2\ww2\branches\Unity15\WW2\proj\win\BetaReleaseSSE2SmrtHeap\BuildLog.htm"
1>WW2 - 0 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Different file every time I do a rebuild:
1>------ Rebuild All started: Project: WW2, Configuration: BetaReleaseSSE2SmrtHeap Win32 ------
1>Deleting intermediate files and output files for project 'WW2', configuration 'BetaReleaseSSE2SmrtHeap|Win32'.
1>Compiling resources... (Microsoft VC++ Environment)
1>Microsoft Windows Resource Compiler Version 6.1.6723.1
1>
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>TextureRectangle.cpp
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>TutorialManager.cpp
1>glsl.cpp
1>Catastrophic error: unable to obtain mapped memory (see pch_diag.txt)
1>
1>compilation aborted for ..\..\SRC\shader\glsl.cpp (code 4)
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>clientGlobals.cpp
1>NPClient.cpp
1>sysMovieWin.cpp
1>md5c.c
1>rijndael-api-fst.c
1>rijndael-alg-fst.c
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>dx3dinfo.cpp
1>Build log was saved at "file://G:\PN\ww2\ww2\branches\Unity15\WW2\proj\win\BetaReleaseSSE2SmrtHeap\BuildLog.htm"
1>WW2 - 0 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Manually running compile on either file is fine:
1>------ Rebuild All started: Project: WW2, Configuration: BetaReleaseSSE2SmrtHeap Win32 ------
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>glsl.cpp
1>Build log was saved at "file://G:\PN\ww2\ww2\branches\Unity15\WW2\proj\win\BetaReleaseSSE2SmrtHeap\BuildLog.htm"
1>WW2 - 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Note that, again, there is no pch_diag.txt available - presumably because it went on to compile additional files.
And I searched my entire file system to make sure it wasn't somewhere unexpected.
"TextureRectangle.cpp" is the file that is rebuilding the Precompiled Header file,
"clientGlobals.cpp" does not use the precompiled header,
"TutorialManager.cpp" does use the precompiled header,
"uisound.cpp", "mlutility.cpp" and "glsl.cpp" also use the precompiled header
So - I tried a Build instead of rebuild, and each time it fails on the second file to use the pch:
1>------ Build started: Project: WW2, Configuration: BetaReleaseSSE2SmrtHeap Win32 ------
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>uiSound.cpp
1>mlutility.cpp
1>Catastrophic error: unable to obtain mapped memory (see pch_diag.txt)
1>
1>compilation aborted for ..\..\src\ml\mlutility.cpp (code 4)
1>Build log was saved at "file://G:\PN\ww2\ww2\branches\Unity15\WW2\proj\win\BetaReleaseSSE2SmrtHeap\BuildLog.htm"
1>WW2 - 0 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
1>------ Build started: Project: WW2, Configuration: BetaReleaseSSE2SmrtHeap Win32 ------
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>mlutility.cpp
1>obsph.cpp
1>Catastrophic error: unable to obtain mapped memory (see pch_diag.txt)
1>
1>compilation aborted for ..\..\src\ob\obsph.cpp (code 4)
1>Build log was saved at "file://G:\PN\ww2\ww2\branches\Unity15\WW2\proj\win\BetaReleaseSSE2SmrtHeap\BuildLog.htm"
1>WW2 - 0 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
1>------ Build started: Project: WW2, Configuration: BetaReleaseSSE2SmrtHeap Win32 ------
1>Compiling with Intel C++ Compiler 11.1.071 [IA-32]... (Intel C++ Environment)
1>obsph.cpp
1>chatSquadControl.cpp
1>Catastrophic error: unable to obtain mapped memory (see pch_diag.txt)
1>
1>compilation aborted for ..\..\src\chat\chatSquadControl.cpp (code 4)
1>Build log was saved at "file://G:\PN\ww2\ww2\branches\Unity15\WW2\proj\win\BetaReleaseSSE2SmrtHeap\BuildLog.htm"
1>WW2 - 0 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Here is the contents of the build/intermediate folder after a rebuild fail:
G:\PN\ww2\ww2\branches\Unity15\WW2\proj\win\BetaReleaseSSE2SmrtHeap>dir
Volume in drive G is Common
Volume Serial Number is EE23-E6C0
Directory of G:\PN\ww2\ww2\branches\Unity15\WW2\proj\win\BetaReleaseSSE2SmrtHeap
03/26/2010 12:38 AM .
03/26/2010 12:38 AM ..
03/26/2010 12:38 AM 41,320 BuildLog.htm
03/26/2010 12:38 AM 31,794 clientGlobals.cod
03/26/2010 12:38 AM 14,665 clientGlobals.obj
03/26/2010 12:38 AM 788,059 dx3dinfo.cod
03/26/2010 12:38 AM 53,376 dx3dinfo.obj
03/26/2010 12:38 AM 156,106 md5c.cod
03/26/2010 12:38 AM 5,479 md5c.obj
03/26/2010 12:38 AM 428,462 NPClient.cod
03/26/2010 12:38 AM 37,870 NPClient.obj
03/26/2010 12:38 AM 420,975 rijndael-alg-fst.cod
03/26/2010 12:38 AM 25,992 rijndael-alg-fst.obj
03/26/2010 12:38 AM 127,241 rijndael-api-fst.cod
03/26/2010 12:38 AM 3,481 rijndael-api-fst.obj
03/26/2010 12:38 AM 397,541 sysMovieWin.cod
03/26/2010 12:38 AM 52,960 sysMovieWin.obj
03/26/2010 12:38 AM 1,449,106 TextureRectangle.cod
03/26/2010 12:38 AM 76,745 TextureRectangle.obj
03/26/2010 12:38 AM 4,428,863 TutorialManager.cod
03/26/2010 12:38 AM 301,970 TutorialManager.obj
03/26/2010 12:38 AM 80,019,456 WW2.pchi
03/26/2010 12:38 AM 6,612 WW2.res
03/26/2010 12:38 AM 2,333,638 WW2_90.dg
22 File(s) 91,201,711 bytes
2 Dir(s) 371,165,634,560 bytes free
kfsone
New Contributor I
259 Views

Also, I tried trimming down the PCH so that it only results in a PCHI of 9Mb (can't get it much below that because of windows.h).

Still no joy (and adds about 30 minutes to total build time =/)
kfsone
New Contributor I
259 Views

I've been unable to boil this down to any particular facet of our project, but I haven't been able to recreate it with a fresh project.
I have found that I can sometimes get a particular file to compile by changing the order of inclusion of STL headers - but not always. And there were no STL includes in the trimmed down version of the header file.
I don't know if its a conflict with some other project configuration setting, the number of files in the project, our pervasive use of #pragma once... (I just noticed that our precompiled header uses #pragma once, I'm going to try switching that to a guard)
kfsone
New Contributor I
259 Views

Ok - it appears that using #pragma once inside a precompiled header will eventually cause the situation where Intel Compiler can no-longer use the PCH multiple times.
I've automatically replaced all of our #pragma once's with #ifndef guards, and now I am able to build projects again with OpenMP language support enabled.

Replacing "#pragma once" with an ifndef guard fixed it on one of my machines, the one with 11.1.061. However, on my other machine, on which I was evaluating Parallel studio, with 11.1.071, it didn't fix it.
kfsone
New Contributor I
259 Views

I uninstalled Parallel composer (11.1.071) from the second machine, reinstalled Intel Professional Compiler 11.1.060 and can now build with OpenMP enabled on the second machine described above.
JenniferJ
Moderator
259 Views

Sorry that I didn't know you're using the Parallel Composer. The Composer update 5 should contain the fix as well.

The icl in Parallel Composer update 5 is 11.1.078, Build 20100203

Jennifer
Reply