Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
告知
Important Update: Community Platform Migration​. Learn more​>
5340 ディスカッション

Program Crashes with Performance Analyzer

Rajesh_k_1
ビギナー
4,658件の閲覧回数

Hi , I am currently experimenting with the Intel Vtune Performance Analyzer 2013 on Windows 7. My release build application seems to work fine however when I attempt to run the application from Performance Analyzer my 32 bit application just hangs. I am using VS2010 and QT. Any suggetsions on what might be going wrong ?

0 件の賞賛
16 返答(返信)
SergeyKostrov
高評価コントリビューター II
4,659件の閲覧回数
Create a console Window with Win32 API and output some information there using printf CRT-function from several check-points created in sources. At least you will be able to see what application does when it hangs.
Rajesh_k_1
ビギナー
4,658件の閲覧回数

So after creating a log file. I noticed that it hangs during creation of threads. I have a for loop that creates a specific noumber of threads (That vary from 4 to 15) and if a no is large it simply hangs up. Any suggestions on how i may resolve that issue ?

Bernard
高評価コントリビューター I
4,658件の閲覧回数

>>>So after creating a log file. I noticed that it hangs during creation of threads. I have a for loop that creates a specific noumber of threads (That vary from 4 to 15) and if a no is large it simply hangs up. Any suggestions on how i may resolve that issue ?>>>

How do you create threads?Do you use WinApi CreateThread() function?If you do can you put a breakpoint on this function call and inspect return value.

You mentioned log file please post it?

Rajesh_k_1
ビギナー
4,658件の閲覧回数

No I am using Boost thread to create the threads. I believe it uses the Win32 API underneath to create the threads. The log file I generated was custom made it just helped me diagnose where my program was hanging when launched by the performance analyzer

Bernard
高評価コントリビューター I
4,658件の閲覧回数

>>>No I am using Boost thread to create the threads. I believe it uses the Win32 API underneath to create the threads>>>

Probably yes.

>>>and if a no is large it simply hangs up.>>>

What do you mean by writing this?Is this related to number of threads created.

Rajesh_k_1
ビギナー
4,658件の閲覧回数

Yes I believe it has something to do with the number of threads created. I am not sure why it has an issue with that.

Bernard
高評価コントリビューター I
4,658件の閲覧回数

Are you running low on memory?Or do you have  large memory allocation?If you could post return value of CreateThread function,but you will need to use debugger for this.

SergeyKostrov
高評価コントリビューター II
4,659件の閲覧回数
>>...Yes I believe it has something to do with the number of threads created. I am not sure why it has an issue with that... On 32-bit and 64-bit Windows platforms you could create thousands of threads and an actual number of threads depends on how much memory is allocated for the stack of a thread and how much total memory ( Physical plus Virtual ) a system has. I'll give you some example later. Try to debug the codes since the description of the problem is too generic in order to understand what could be wrong.
SergeyKostrov
高評価コントリビューター II
4,658件の閲覧回数
>>...If you could post return value of CreateThread function, but you will need to use debugger for this... Debugger is Not needed to get an error code and a call to GetLastError Win32 function should provide you with exact reason why some thread was not created.
SergeyKostrov
高評価コントリビューター II
4,659件の閲覧回数
Here are a couple of threads related to threads creation on a Windows platform: Forum Topic: Relationship between number of threads in OpenMP application and memory used Web-link: http://software.intel.com/en-us/forums/topic/279381 Forum Topic: Stress testing of Intel OpenMP library - More than 18,600 OpenMP threads created in a parallel region Web-link: http://software.intel.com/en-us/forums/topic/278302 Forum Topic: Couldn't create more than 64 OpenMP threads in a test application Web-link: http://software.intel.com/en-us/forums/topic/279487 Here are some numbers for a 32-bit Windows XP OS: [cpp] ... // Release configuration // RTuint uiStackSize; // Operating System: Windows XP 32-bit // C++ compiler MSC BCC MGW ICC // #define _STACK_SIZE 0 // Threads created: // #define _STACK_SIZE 1024 // 30,548 30,575 30,716 30,533 // #define _STACK_SIZE 2048 // 30,548 30,575 30,716 30,533 // #define _STACK_SIZE 4096 // 30,548 30,575 30,716 30,533 // #define _STACK_SIZE 8192 // 30,548 30,575 30,716 30,533 // #define _STACK_SIZE 16384 // 30,548 30,575 30,716 30,533 // #define _STACK_SIZE 32768 // 30,548 30,575 30,716 30,533 // #define _STACK_SIZE 65536 // 30,548 30,575 30,716 30,533 // #define _STACK_SIZE 131072 // 15,735 15,750 15,823 15,727 // #define _STACK_SIZE 262144 // 7,985 7,995 8,032 7,980 // #define _STACK_SIZE 524288 // 4,019 4,027 4,047 4,017 // #define _STACK_SIZE 1048576 // 2,016 2,021 2,031 2,015 // #define _STACK_SIZE 2097152 // 1,006 1,011 1,015 1,005 // #define _STACK_SIZE 4194304 // 501 504 507 500 ... [/cpp]
Bernard
高評価コントリビューター I
4,658件の閲覧回数

Sergey Kostrov wrote:

>>...If you could post return value of CreateThread function, but you will need to use debugger for this...

Debugger is Not needed to get an error code and a call to GetLastError Win32 function should provide you with exact reason why some thread was not created.

Overlooked that options.

Bernard
高評価コントリビューター I
4,658件の閲覧回数

I do not think that problem can be related to creation dozen of threads.

@Rajesh

if you would like to investigate your issue deeper there is one great tool or script which can dump hang process.It is called ADPlus.

Rajesh_k_1
ビギナー
4,658件の閲覧回数

iliyapolak wrote:

I do not think that problem can be related to creation dozen of threads.

@Rajesh

if you would like to investigate your issue deeper there is one great tool or script which can dump hang process.It is called ADPlus.

I will defnitely investigate this issue and post back here. Ill look over ADPlus

Bernard
高評価コントリビューター I
4,658件の閲覧回数

>>>I will defnitely investigate this issue and post back here. Ill look over ADPlus>>>

ADPlus works with windbg.

SergeyKostrov
高評価コントリビューター II
4,658件の閲覧回数
>>...No I am using Boost thread to create the threads. I believe it uses the Win32 API underneath to create the threads. >>The log file I generated was custom made it just helped me diagnose where my program was hanging when >>launched by the performance analyzer... >>... >>Yes I believe it has something to do with the number of threads created. I am not sure why it has an issue with that... I understood that you've found a reason, right? If Yes, How many threads were successfully created before the application hang?
Bernard
高評価コントリビューター I
4,658件の閲覧回数

Hi Rajesh

do you have any updates?Did you try to use ADPlus?

返信