- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It was move from IPP forum. http://redfort-software.intel.com/en-us/forums/showthread.php?t=106951
I have two Windows 7 SP1 x64 dev machines that have reliability problems unless I set KMP_ALL_THREADS environment variable. If I don't set that environment variable, I get application crashes in Windows save (as) file dialogs. When the app crashes, it pops a separate console window to display errors. The errors I see are like this:
OMP: Error #136: Cannot create thread.
OMP: System error #8: Not enough storage is available to process this command.
And then the application crashes. The applications that have crashed like this are Outlook Express, VirtualDub, Visual Studio 2010, and a tiny C++ test ui I wrote that just opens a file save dialog. These machines both have 8GB of RAM, I am not low on RAM according to task manager. I have generally had only Visual Studio running.
When I execute the test ui and point to a directory without a jpeg, it works fine. When I point to a directory with a jpeg (as the above steps do), it crashes and pops a console window with this:
OMP: Error #136: Cannot create thread.
OMP: System error #8: Not enough storage is available to process this command.
OMP: Error #178: Function GetExitCodeThread() failed:
OMP: System error #6: The handle is invalid.
When I run under the visual studio debugger I don't get the crash.
The crash is perfectly repeatable, I haven't seen it not crash given the specified run conditions.
If I set the system environment variable KMP_ALL_THREADS (I tried 0,1,16 and 4096) or OMP_THREAD_LIMIT the crash does not happen. With system environment variable OMP_NUM_THREADS set to 1 or 16 the crash still happens. With system environment variable KMP_STACKSIZE and/or OMP_STACKSIZE set to 4m the crash still happens.
But when I set KMP_ALL_THREADS to 1, 16, or 4096 (probably anything) I get this when I run another app that uses IPP:
OMP: Warning #96: Cannot form a team with 8 threads, using 1 instead.
OMP: Hint: Consider unsetting KMP_ALL_THREADS and OMP_THREAD_LIMIT (if either is set).
So I either have crashes and a console window with errors with windows file save as dialog, or a console window with errors on an app that uses IPP. Neither is good.
What is going on here? Is Windows using Intel OMP? What does "not enough storage" mean if I'm not low on memory or disk? Why can it not form a team of 8 threads with KMP_ALL_THREADS set to 4096?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All of these programs are 32-bit, I think.
I don't know that any of these applications are using IPP. However they appear to be using Intel OpenMP because the crash is affected by an Intel-specific environment variable KMP_ALL_THREADS. Is it correct that KMP_ALL_THREADS is Intel-specific?
So it is like the Windows operating system itself has the problem, not any particular application.
One PC is Nehalem and the other is Ivy Bridge. They have different motherboards. So I don't think hardware is the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ryans,
No, we notice the scenario you mentioned. (none of the apllication Outlook Express, VirtualDub, (Microsoft) Visual Studio 2010, and a tiny C++ test ui use IPP, so it should not related to IPP). But as you post the problem to IPP forum, so we need to make sure if it is IPP-related or Intel Compiler related.
But you should be right about KMP_ALL_THREADS is Intel-specific. So the problem appear to be related Intel OpenMP.
As Sergery mentioned, it is impossible to catch the reason without a test case, you may do general check, like check how many threads started in task manager etc.
( i may try to move your post to Intel Compiler forum and see if there are some insight from Compiler experts)
the new post in Intel Compiler Forum is http://redfort-software.intel.com/en-us/forums/showthread.php?t=107255
Best Regards,
Ying
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OMP: Error #136: Cannot create thread.
OMP: System error #8: Not enough storage is available to process this command.
...
Some time ago I had a similar problem with a stress test-case ( based on TBB library ) and it was creating hundreds of threads.
In order to create as many as possible threads I used the following settings for the linker:
...
#pragma message ( "*** New HEAP Commit:Reserve and STACK Commit:Reserve Values Defined ***" )
#ifdef _DEBUG
// Case 1
// #pragma comment( linker, "/HEAP:1069547520,1069547520" )
// #pragma comment( linker, "/STACK:4194304,4194304" )
// Case 2
// #pragma comment( linker, "/HEAP:134217728,134217728" )
// #pragma comment( linker, "/STACK:134217728,134217728" )
// Case 3
// #pragma comment( linker, "/HEAP:268435456,268435456" )
// #pragma comment( linker, "/STACK:268435456,268435456" )
// Case 4
#pragma comment( linker, "/HEAP:536870912,536870912" )
#pragma comment( linker, "/STACK:536870912,536870912" )
#endif
#ifdef NDEBUG
// Case 1
// #pragma comment( linker, "/HEAP:1069547520,1069547520" )
// #pragma comment( linker, "/STACK:4194304,4194304" )
// Case 2
// #pragma comment( linker, "/HEAP:134217728,134217728" )
// #pragma comment( linker, "/STACK:134217728,134217728" )
// Case 3
// #pragma comment( linker, "/HEAP:268435456,268435456" )
// #pragma comment( linker, "/STACK:268435456,268435456" )
// Case 4
#pragma comment( linker, "/HEAP:536870912,536870912" )
#pragma comment( linker, "/STACK:536870912,536870912" )
#endif
...
All my tests were done on a 32-bit Windows XP.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[SergeyK] It looks like some problem with memory allocation. However, it is not clear why some 3rd party applications crashed.
Is Windows using Intel OMP?
[SergeyK] No. Microsoft has its own version of OpenMP.
What does "not enough storage" mean if I'm not low on memory or disk?
[SergeyK] When Windows creates a thread it needs some memory to create a stack. If there is no more memory
available Windows doesn't create a thread and a user application could crash if there is no an error processing.
Error #136 is returned by from OpenMP library
System Error #8 is returned from a 'GetLastError' Win32 API function
Why can it not form a team of 8 threads with KMP_ALL_THREADS set to 4096?
[SergeyK] With Intel OpenMP library you should be able to do it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[SergeyK] With Intel OpenMP library you should be able to do it.
Here is a link to a thread:
Stress testing of Intel OpenMP library - More than 18,600 OpenMP threads created in a parallel region
http://redfort-software.intel.com/en-us/forums/showthread.php?t=105139&o=a&s=lr
Please take a look.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And then several hundred more of these (up to thread numbers over 500) and then crashes with the errors I listed in my original post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page