VS 2010 Ultimate : Profiler – How to Enable Memory Profiling with the Profiler (Exception: Could not launch callsupportproc.exe. Injection of runtime library failed)?

Locked VS 2010 Ultimate : Profiler – How to Enable Memory Profiling with the Profiler (Exception: Could not launch callsupportproc.exe. Injection of runtime library failed)?

  • Wednesday, October 19, 2011 2:06 PM
     
     
    I am using Visual Studio 2010 Ultimate under Window 7 (x64), and have to analyze an C++ application (32bit) that includes several DLLs.

    I failed to start profiling the application with sampling (CPU Sampling from the Performance Wizard, or with vsperfcmd  /start:sample,  VSPerfClrEnv /sampleon from the console) and the launch option (from the Performance Wizard or with vsperfcmd /launch:XXX).   I got the following error:

    Error VSP1335: Could not launch callsupportproc.exe. Injection of runtime library failed

    The /attach:XXX  option works ok for the application. Even Instrumentation (Wizard and console) works fine.

    I heard that in case an application loads many DLLs, the profiler can throw the above exception, and one has to attach the profiler to the running application. 

    However, I need memory profiling (for leak analysis) and  have therefore to set the /GC option (or using .NET Memory Allocation – Sampling from the Performance Wizard). This option works only with “sampling” and with “launch”.

    Is there any solution in this case?

    • Edited by TZ00001 Wednesday, October 19, 2011 2:43 PM
    •  

All Replies

  • Friday, October 21, 2011 8:30 AM
    Moderator
     
     
    #Ray Price
    FYI, I had this same problem and it turned out that cyberarmor filrewall had it's hooks into some of my DLL's causing more DLL's to be loaded than necessary. I un-installed cyberarmor and this problem went away.
    It's possible something similar may be happening with you if you have firewall/antivirus etc. installed.

    #mgoldin
    I was able to reproduce the problem. It looks like at startup time the application is extensively loaded with various modules, such that we cannot find a room for profiler. Somehow later the memory load goes down, that's why we are able to attach profiler to the application.
    If you are especially interested in profiling of startup, I would recommend instrumenting the application and using instrumentation profiling mode.

    I think you can read into this thread: http://social.msdn.microsoft.com/forums/en-US/vstsprofiler/thread/c7728be6-c7f4-4408-8b24-937c46a412ae/, and try to turn off the anti virus software and other type protection product, also the firewall product, since some firewall product also have check virus function like the anti virus software.

    And maybe you can try to use /3G switch: http://msmvps.com/blogs/carlosq/archive/2009/06/09/the-strange-case-of-visual-studio-getting-quot-out-of-memory-quot.aspx

    Then please let me know the result.

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Friday, October 21, 2011 2:32 PM
     
     

    Thanks for the reply.

    I de-activated the firewall and Real-time protection (Microsoft Forefront Protection 2010) - still have the same problem.

    I have VS 2010 (x86) runing on 64bit Windows 7. The application was built with /LARGEADDRESSAWARE so they have > 3.5 G memory.

    Memory usage for deven.exe did not really rise (about 1 Gb)  before the "Error VSP1335:..." crash.

    As I really need the memory profiling, instrumentation does not help. Perhaps there is a way to start memory profiling with instrumentatio - with the /GC option?

  • Saturday, October 22, 2011 4:42 PM
    Moderator
     
     

    I think you can try to see if you can use this command line:

    vsperfclrenv.cmd /samplegclife

    If the code is in a .Net Framework service, then try this article: http://msdn.microsoft.com/en-us/library/dd255367.aspx

    http://msdn.microsoft.com/en-us/library/aa985627.aspx

     

    If there's any concern, please feel free to let me know.

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Monday, October 24, 2011 10:30 AM
     
     

    Hi,

    I tried vsperfclrenv.cmd /samplegclife and then tried to attach the profiler to the running application process. The attach was ok. However it generated only CPU profile for the application.

    I believe that the profiler should be started with the /GC open (vsperfcmd /start:sample /output:test /attach:XXX.exe /GC:Allocation). However /GC works only with launch. Launch failed due to the aforementioned problem.

    Is there a possibility to switch on GC for "attach"?

  • Tuesday, October 25, 2011 4:59 AM
    Moderator
     
     

    Sys can only be used in a command line that also contains the Launch or the Attach option.

    I think you can try to use these two articles to have a try on your side:

    http://stackoverflow.com/questions/3568494/memory-profiler-for-silverlight

    http://blogs.msdn.com/b/mgoldin/archive/2010/04/26/vs2010-silverlight-4-profiling.aspx

    And if there's any concern, please feel free to let me know.

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Sunday, October 30, 2011 9:51 AM
    Moderator
     
     
    I am writing to check the status of the issue on your side. 
    What about this problem now? 
    Would you mind letting us know the result of the suggestions?

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Monday, October 31, 2011 8:20 AM
     
     

    Hi Mike,

    Thanks for the reply.

    I can not try at the moment. It seems to me that several tests with the vsperfclrenv.cmd  configurations destroyed mein VS einvironment (it takes now almost 10-30 minutes to open a middle size solution - after a reboot of the machine) . I have now to wait for a re-installation of my computer before I can start testing again.

  • Monday, October 31, 2011 8:35 AM
    Moderator
     
     

    Ok.

    I will go on to follow if you have any update on this thread.

    Best wishes,


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Wednesday, November 02, 2011 4:35 PM
    Moderator
     
     
    I am writing to check the status of the issue on your side. 
    What about this problem now? 
    Would you mind letting us know the result of the suggestions?

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Wednesday, November 02, 2011 4:45 PM
     
     

    Hi,

    I was able to make some tests on a new machine (no firewall and nor virus scanner) . Unfortunately both proposed solutions failed to work.

    1) http://stackoverflow.com/questions/3568494/memory-profiler-for-silverlight

    2) http://blogs.msdn.com/b/mgoldin/archive/2010/04/26/vs2010-silverlight-4-profiling.aspx

    With 1) the launch failed in the console -  " Injection of runtime library failed" . With 2), everything was ok, but I still didn’t get the memory profile.

    I have no idea at the moment. I guess I will abandon this approach and try something else to do my memory analyses.

     

  • Thursday, November 03, 2011 3:16 PM
    Moderator
     
     

    Do you mean that you can ensure there's no anti virus kind process in your System(Windows Task Manager)?

    Can you just create a new project in your this new environment, and then profile its memory data(test managed(it is better to use C# project) and unmanged projects), I would like to know this test result.

    If you were shown that error message, "Injection of runtime library failed", then please do just use Wizard, try Analysis->Profiler->Attach/Detach

    Have you noted that if the CPU and Memory usage increasing so higher when you are shown that error message, "Injection of runtime library failed"?

     


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Friday, November 04, 2011 8:43 AM
     
     

    Yes. I am sure that there are no anti virus/firewall running on that machine - no process in TM and confirmed by the system administrator. 

    Analysis->Profiler->Attach/Detach is ok - bit it does not gives me the memory profile.

    I will make later some tests with a new projects  and come back with the results.

  • Tuesday, November 08, 2011 12:49 PM
    Moderator
     
     

    I think you can try to add a profile session:

    Analysis -> Profiler -> New Performance Session

    And then right click on the new performance session to use its property page config it:

    Then right click on the performance session, you can try to use the Attach/Detach function.

    Maybe this can work for you.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Friday, November 11, 2011 11:51 AM
     
     

    Thanks for the suggestions. 

    Now I was able to create a completely new C++ project (an application with two classes and a loop to create/process instances) on a computer without firewall/virus scanner.  The .NET memory profling properies were also checked. Both sampling and instrumenting worked fine. Memory profiling failed, now with a new error : PRF0025: No data was collected.

  • Sunday, November 13, 2011 9:42 AM
    Moderator
     
     Answered

    http://blogs.msdn.com/b/profiler/archive/2010/01/14/prf0025-no-data-was-collected-why-is-that.aspx

    Base on this blog said,

    It would be caused by your application run time is too short.

    Or there's any other diagnostic tools affect the profile action, then please find them and stop them, then reboot your system.


    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
  • Thursday, November 17, 2011 7:57 AM
    Moderator
     
     
    I am writing to check the status of the issue on your side. 
    What about this problem now? 
    Would you mind letting us know the result of the suggestions?

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us