Call executable handle leak

We noticed in TestStand 4.1 that when we use "Call Executable" on a batch file:
with "no wait" it leaks a handle on each call
with other view options thatn "show minimized" it leaks GDI objects
We can work around the first issue by using CloseHandle (from kernel32.dll) on RunState.PreviousStep.ProcessHandle, but I would like to know whether these are known issues and are addressed in later versions of TS.
Best regards
Peter

In later versions of TestStand, the default behavior of a new callexecuteable step is to NOT store the process handle at all (instead it gets closed immediately). There is a setting for whether or not to store the handle and an expression to specify where to store it as shown below:
For the GDI object leak, are you seeing a leak in the TestStand process or is the GDI object leaking because the handle hasn't been closed yet, so the other process is still around and still using GDI objects? Does the GDI leak go away if you close the process handle? If you call callexecutable in a tight loop does the number of GDI objects grow unbounded or does it level off (i.e. is it really a leak or a one-time allocation)?
-Doug

Similar Messages

  • Handle leak when using ADO2.7 access oracle

    Ado version:2.7
    OS:Window2000 professional
    Oracle Server:9.2.0.1.0
    Client Provider:9.2.0.1.0
    Using Oracle OLEDB connection oracle
    when i execute such function in my test program continuously:
    Handle count of the program will increase.I know handle will increase for connection pool ,but it will stop increasing when handle count reach one value. i think this is a problem that ADO cann't match with Oracle OLEDB
    better.
    Any suggestion?
    Set mConOracle = New Connection
    mConOracle.CursorLocation = adUseClient
    mConOracle.ConnectionString = "Provider=OraOLEDB.Oracle.1;Password=123;Persist Security Info=True;User ID=abc;Data Source=aaa;OLE DB Services=-1; "
    mConOracle.Open
    mConOracle.Close
    Set mConOracle=Nothing

    Ok,
    I tried out connection pooling switching on/off. Also waited some minutes for the pool timeout. But nothing happened.
    So I made some further tests and this is what I found out:
    - The left handles are all semaphores
    - To generate a handle leak it is necessary to create an ADO object, call connect and do a database query. Actually some data must be transmitted over the network. Then close connection, release ADO object. -> 2-3 semaphore handles are left.
    - Handle leak occurs indepentendly of apartment or multi threaded
    - MDAC 2.7, MDAC 2.8 was used with no success
    However, we hat one piece of software here, which didn't have handle leaks. So I did some more investigation on that phenomena.
    This is what happened and could be used as a workaround until a fix is available:
    - I recognized, that if at least one connection (which has been really established once by the underlying components) has been opened and is kept open, it is possible to create more ADO objects, use them for database retrieval and release them again without having the handle count increased.
    - So the handle leak seems only to occur, if there is no more database connection in use and one of the underlying components tries to release everything. Each time this happens 2-3 semaphore handle are left.
    - Finally my current workaround is to create and open on initalization of my process an ADO object and the database connection and leave this object alone without touching it again until the process ends. For every database query in any thread I can now use a new ADO object, without having the handles increased and never released.
    So, this is the end for now. I hope this information can help somebody to figure out where the problem is eventually located and a fix could be released.
    Hopefully,
    Markus (writing under Uwes account)

  • How to Call Event Handler Method in Another view

    Hi Experts,
                       Can anybody tell me how to call Event handler Method which is declared in View A ,it Should be Called in
      view B,Thanks in Advance.
    Thanks & Regards
    Santhosh

    hi,
    1)    You can make the method EH_ONSELECT as public and static and call this method in viewGS_CM/ADDDOC  using syntax
        impl class name of view GS_CM/DOCTREE=>EH_ONSELECT "method name.
                 or
    2)The view GS_CM/ADDDOC which contains EH_ONSELECT method has been already enhanced, so I can't execute such kind of operation one more time.
                         or
    3)If both views or viewarea containing that view are under same window , then you can get the instance ofGS_CM/DOCTREE from view GS_CM/ADDDOC  through the main window controller.
    lr_window = me->view_manager->get_window_controller( ).
        lv_viewname = 'GS_CM/DOCTREE '.
      lr_viewctrl ?=  lr_window ->get_subcontroller_by_viewname( lv_viewname ).
    Now you can access the method of view GS_CM/DOCTREE .
    Let me know in case you face any issues.
    Message was edited by: Laure Cetin
    Please do not ask for points, this is against the Rules of Engagement: http://scn.sap.com/docs/DOC-18590

  • Handle leak - Crystal for VS 2010

    I've been playing with the Crystal VS2010 runtime and have come across a problem which I believe might be a handle-leak in Crystal Reports.
    I can reproduce this at will using the following example:
    I created a project with a typed dataset (containing 2 empty tables with only a single column each).  I then added a blank report to the project and only added a single text object to it - no data is loaded from the dataset at all.
    Then, I can execute the following 100 times in a loop:
    using (DataSet1 dataSet = new DataSet1())
       using (CrystalReport1 report = new CrystalReport1())
          report.SetDataSource(dataSet);
          report.Close();
       dataSet.Clear();
    This I then follow with a forced garbage collect, just to make sure everything was cleaned up properly.  However, +- 100 new handles were opened and using sysinternals' handle.exe, these show up as Mutexes e.g.:
    1324: Mutant        \Sessions\1\BaseNamedObjects\CrystalReportXalanInitilizeMutex2916l
    I haven't been able to find any information about this on the forums or the internet - can anyone confirm if this is a known issue?  (Or am I doing something stupid? )
    Thanks!

    Hi,
    I've tried some of your suggestions:
    In you report check on No Printer and check off all o f the Verify Database options.  - Made no difference
    Also, be sure to use the Legacy mode in your app.config file, search for it. MS issue with DataSets. - Also, no difference
    GDI Objects  - These don't budge - this is a Mutex leak, not a GDI leak
    As for datasets, I'm not filling the dataset - its empty.  So a database does not enter into the equation, and no database connection handles are therefore ever created.
    Also, I tried the printer theory by running the app on a machine without any printers installed - the problem persisted.  Machines also have entirely different graphics card drivers, so highly unlikely to cause the problem.
    I've also tried targeting both Framework 4.0 and Framework 2.0 - the leak occurs in both cases.
    The code that I posted was only a snippet yes, but it really is 90% of the test-app.  This is the whole content of Form1.cs (a single-button form):
    using System;
    using System.Windows.Forms;
    namespace CrystalLeakTest
        public partial class Form1 : Form
            public Form1()
                InitializeComponent();
            private void ProduceReport()
                using (DataSet1 dataSet = new DataSet1())
                    using (CrystalReport1 report = new CrystalReport1())
                        report.SetDataSource(dataSet);
                        report.Close();
                    dataSet.Clear();
            private void button2_Click(object sender, EventArgs e)
                for (int i = 0; i < 100; i++)
                    ProduceReport();
                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect();
                MessageBox.Show("Done");
    The rest of the app is simply a blank report, a blank typed dataset (with 1 table and 1 column - no data).  That really is it
    Is there anything else I can try?
    Thanks!

  • Handle leaks?

    Has anyone seen handle leaks in ODP.NET? I have a multi-threaded server application that contains managed and unmanaged C++ code and uses ODP.NET. It leaks handles that seem to be thread handles created by ODP.NET. I cannot reproduce it in a simple test. I am working on it, but it would be nice to know if anyone noticed the same problem and has a workaround or fix. This is a big problem in my app because the number of handles goes up to 10,000 in a couple of hours. GC.Collect does not help.
    Thanks,
    Aleksey

    Yes, I know that. I do close and dispose everything. The behaviour is hard to reproduce, but it does happen.
    One quick tip you can try is to explicitly close all
    objects you created when no longer needed. For
    example, call the Close/Dispose method on your your
    ODP.NET connections, DataReaders, etc. objects before
    you leave your applications scope. Sometimes the
    .NET garbage collector cannot reclaim resources
    quickly enough under heavily-loaded conditions.
    Alex

  • Camera Eventually stops connecting possibly caused by a handle leak

    Can somebody tell me how to write an app that display a picture of the webcam on screen, change the size of video shown and remove it from the screen without the camera eventually not displaying and the created handles being left behind.
    From my investigation any camera with the usbvideo.sys driver is affected, which will be at least 50% of webcams out there.
    Sometimes air locks up and becomes unresponsive / sometimes it just stops displaying the camera, it depends upon the camera.
    Tested with lots of different cameras on Windows 7 and 8 with lots of versions of the Air/Flex Frameworks.
    Heres a simple app to test it.
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        creationComplete="windowedapplication1_creationCompleteHandler(event)">
      <fx:Script>
      <![CDATA[
      import mx.collections.ArrayList;
      import mx.events.FlexEvent;
      import spark.events.IndexChangeEvent;
      private var camera:Camera;
      [Bindable]
      private var cams:ArrayList;
      private var video:Video;
      [Bindable]
      private var autoInProgress:Boolean;
      [Bindable]
      private var totalAttempts:int = 0;
      private var currentAttempts:int = 0;
      protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void
      cams = new ArrayList(Camera.names);
      protected function selectedCamera_changeHandler(event:IndexChangeEvent):void
      camera = Camera.getCamera(selectedCamera.selectedIndex.toString());
      if (camera)
      camera.setMode(640, 480, 30);
      private function start() : void {
      currentAttempts = 0;
      autoInProgress = true;
      if (resizeTest.selected) {
      addVideoAndAttachCamera();
      resize();
      else {
      attachDetach();
      private function addVideoAndAttachCamera() : void {
      if (camera) {
      video = new Video(camera.width, camera.height);
      videoContainer.addChild(video);
      video.attachCamera(camera);
      private function detachCameraAndRemoveVideo() : void {
      video.attachCamera(null);
      video.clear();
      videoContainer.removeChild(video);
      video = null;
      private function attachDetach() : void {
      ++ currentAttempts;
      ++ totalAttempts;
      if (camera) {
      addVideoAndAttachCamera();
      memoryUsage.text = "System Memory Usage: " + (System.totalMemory).toString() + "bytes";
      setTimeout(function():void {
      detachCameraAndRemoveVideo();
      if (currentAttempts < int(attempts.selectedItem)) {
      attachDetach();
      else {
      autoInProgress = false;
      }, int(delay.selectedItem));
      private function resize() : void {
      ++ currentAttempts;
      ++ totalAttempts;
      if (camera) {
      camera.setMode(640, 480, 30);
      memoryUsage.text = "System Memory Usage: " + (System.totalMemory).toString() + "bytes";
      setTimeout(function():void {
      if (currentAttempts < int(attempts.selectedItem)) {
      resize();
      else {
      detachCameraAndRemoveVideo();
      autoInProgress = false;
      }, int(delay.selectedItem));
      ]]>
      </fx:Script>
      <s:VGroup>
      <s:HGroup>
      <s:Label enabled="{!autoInProgress}" text="Camera" />
      <s:ComboBox enabled="{!autoInProgress}"
      id="selectedCamera"
      dataProvider="{cams}"
      change="selectedCamera_changeHandler(event)"/>
      <s:Label id="memoryUsage" />
      <s:Label text="{totalAttempts}" />
      </s:HGroup>
      <s:HGroup>
      <s:Label text="Auto Connect/Disconnect" enabled="{!autoInProgress}" />
      <s:ComboBox id="attempts" enabled="{!autoInProgress}" selectedIndex="1">
      <mx:ArrayCollection>
      <fx:String>1</fx:String>
      <fx:String>5</fx:String>
      <fx:String>10</fx:String>
      <fx:String>50</fx:String>
      <fx:String>75</fx:String>
      <fx:String>100</fx:String>
      <fx:String>500</fx:String>
      <fx:String>1000</fx:String>
      <fx:String>5000</fx:String>
      <fx:String>10000</fx:String>
      </mx:ArrayCollection>
      </s:ComboBox>
      <s:Label text="times" enabled="{!autoInProgress}" />
      <s:CheckBox id="resizeTest" label="Resize Test?" />
      <s:Button enabled="{!autoInProgress}" click="start()" label="Start" />
      </s:HGroup>
      <s:HGroup>
      <s:Label text="Delay" enabled="{!autoInProgress}" />
      <s:ComboBox id="delay" enabled="{!autoInProgress}" selectedIndex="1">
      <mx:ArrayCollection>
      <fx:String>1000</fx:String>
      <fx:String>1500</fx:String>
      <fx:String>2000</fx:String>
      <fx:String>3000</fx:String>
      </mx:ArrayCollection>
      </s:ComboBox>
      </s:HGroup>
      <mx:UIComponent id="videoContainer" width="640" height="480" />
      </s:VGroup>
    </s:WindowedApplication>
    The resizeTest checkbox shows that you can make the camera lockup just by repetitively calling cam.setMode().
    I have submitted a bug into the bugbase.  Bug#3850401 - Handle leak with video.attachCamera leading to inoperable camera

    Avrom,
    I have never seeb this error before.
    It certainly looks like an OC4J issue. Please try to get an answer on this in the OC4J forum.
    Steven Davelaar,
    JHeadstart Team.

  • Why do I get error -17500 when calling a batch file using the call executable step type?

    I am calling a batch file using the call executable step type. If the path to the batch file contains a space I get error -17500 and a message stating there was an error in "Post". For example the path to the batch file is "c:\TestWin\Test Files\...\Program.bat" When I run this I get the above mentioned error, however if I change my directory structure so the path is now "c:\TestWin\TestFiles\...\Program.bat" it runs fine. I use the browse feature to find my batch file so it is not me typing in a path incorrectly. I have removed the batch file and I get a different error stating that it couldn't find the file so it appears that for my error it can find the file but can't run it. I am
    sure that this has something to do with the fact that batch files are written in DOS but really don't want to resort to changing my directory structure on all my test stations. Is there any way to fix this problem so I can leave a space in my path?

    It appears I have figured it out. This was on another computer so I was unaware of how they used their computer. I like you got it to work in the temp directory and in fact got the program.bat file to work as long as I put it under the temp directory, but when I switched out to my TestWin directory it wouldn't work, so I removed everything from the directory except the batch file it self and it work. What I found out after adding files in one at a time is that the person had a file called "Test" with no file extension in there "c:\TestWin\" directory. Removing this file made it work. Putting the file back broke it. So it appeares that when teststand was running it followed the path saw a space and attempted to grab the "Test" file instead of bro
    wsing into the "Test Files" directory. If you create a file in your temp directory called "temp" with no file extension you will see the same problem. Thank you for your help.

  • How to execute a system command with call executable in teststand 4.2.1?

    Hi All,
          how to execute a system command with "call executable" step in teststand 4.2.1?
          example as i want to quit a application.using "taskkill /f /im xxx.exe".And execute other system command(DOS).
    BR
    Johnny

    Hi, 
    I want to run netstat -an | find "8080" command from command prompt using call executable in test stand. after that i would like take the std output to local variable. 
    Attachments:
    callsettings.jpg ‏404 KB

  • Using Quotation Mark in an Argument in Call Executable

    Hello all,
    I am trying to use Call Executable to do what I would normally do in CMD like this:
    C:\My Document\My_Prog.exe "C:\My Document\file1.tch" "C:\My Document\file2.tch"
    The two argument locations are stored in a locals.filename1 and locals.filename2.
    I don't know how to make sure that the arguments are sent in that exact format with the quotation marks.
    Thanks,
    Chase

    If the local variables do not contain quotes in them, the argument expression would be:
    "\"" + Locals.filename1 + "\" \"" + Locals.filename2 + "\""

  • Calling executable from Oracle?

    Trying to call executables within Oracle, is this possible? & how.
    (i.e. when a value of a column changes would like to call an executable code written in C++, I could see that a change in a value of a column could fire a trigger but then what?)
    Thanks

    say you write some c++ code...
    in the header export atleast one func using
    extern "C"
    foo()
    to avoid name mangling
    now in oracle simply create library as
    '/home/oracle/foo'
    (look up the syntax)
    & in pl/sql simply call the function:)
    its dead easy to implement
    null

  • How to call formhandler handler method using js onclick function

    I need to call formhandler handle method when user clicks on a link. I want to call that method in js function.
    any help will be appreciated.

    Please try the below.
    In jsp page:
    <a(HTML tag) href="javascript:submitfunction();"> My Submit Link </a(HTML tag end>
    <dsp:input type="hidden" bean="MyFormHandler.handleMethod" id="submitForm"/>
    In js file:
    submitFunction(){
    $(#submitForm).submit(); //or you can try .click();
    Note: I am using jQuery library.
    Thanks,
    Gopinath Ramasamy
    Edited by: Gopinath Ramasamy on Nov 29, 2012 1:06 PM
    Added comment to 'a' tag to get the code displayed in the page

  • Calling executable files

    Is it possible to call executable file, or applications, or calling the ms dos promp using a button in java?
    tnkss alot in advance....

    etuc,
    There's a box on the left below the words "Search Forums". Try typing some key words, like "DOS prompt" into that box and pressing the button. A number of discussions will appear. If none meet your need, the results page has an "advanced search" button which will let you be more specific.
    Google also indexes these forums (and many others) so you could try there for maybe "java DOS prompt". Again, the advanced search lets you home in on more specific results. Forums are for the questions you can't answer this way.

  • Call executable and stdout/stderr

    Is there a possibility to save  the output of commandline program which writes to stdout/stderr and which is run from a call executable teststep other than to redirect the stdout/stderr channels to a file ?

    The Call Executable Step Type does is not able to access the stdout/stdin/stderr at the present time.  This may be a feature we consider adding for a future version of TestStand.
    One workaround you can do is to call an executable from another environment (such as LabVIEW), and create a custom step type from this.
    Allen P.
    NI

  • Calling executables from java

    hi guys, I'm looking for a way to calla executable programs from java under unix-like operating systems...
    ..can anyone help me???
    p.s.:I already know a system to make this under windows, but I'm not sure it will work with linux too...

    try {
       Process proc = Runtime.getRuntime().exec(new String[]   {"myprog", "arg1"});
       int res = proc.waitFor();
    catch(IOException e) {
    catch(InterruptedException e) {

  • Call Executable​, absolute path doesnt work as expected

    Hi all,
    i have a problem with the step call executable.
    I configure the step (call a .exe or bat file) with absolute path.
    As long as Teststand runs with the seq-file loaded all works fine.
    The problem shows up when i close the seq-file and reload it later.
    Then the configuration seems to be ok (still the absolute path).
    But when i execute the seq-file it runs the .exe or .bat file as it only has
    the relative path in the configuration.
    I know that, because it wanna load some files from the same folder
    and it doesn't find them after reloading the seq-file.
    Sincerely Stefan Bölsterli

    I use Teststand 3.0

Maybe you are looking for