Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
CJ McAllister Absent Member.
Absent Member.
4754 views

BoundsChecker hangs when main process creates command line process

I'm using the DevPartner BoundsChecker Suite v10.5.1167.3 on Windows 7 x64.

There is a memory leak in my program that I am trying to track down. In the course of running, my program ("Main.exe") constructs a string that is passed to the command line that creates another process ("Foo.exe") that communicates with Main.exe. When running under BoundsChecker, the program runs fine up until the creation of Foo.exe. Please note that this is not a "child" process under the strict definition of the term, as it is created by the command line; Main.exe just passes the string with the command line args.

The leak is known to be somewhere within Bar.dll, so that is the only module I need to instrument. I have tried instrumenting Foo.exe, but I got no further with this.

Basically, my question comes down to this: How can I get BoundsChecker to function properly during and after Foo.exe is executing?

Any guidance is greatly appreciated!

0 Likes
9 Replies
Neal L Absent Member.
Absent Member.

RE: BoundsChecker hangs when main process creates command line process

CJ,

Could you provide me with a little more information so that we can research this more.

1. I am assuming that your application is mainly C/C++. Does it contain any managed code including C++?

2. What call are you using to launch the command line (fork, exec, CreateProcess, etc.)?

Thanks

Neal T. Leverenz
Development Manager and Software Architect
Micro Focus DevPartner

0 Likes
CJ McAllister Absent Member.
Absent Member.

RE: BoundsChecker hangs when main process creates command line process

1. You are correct, unmanaged C++ specifically for the module I'm looking into

2. The command line args are passed to some internal library code, but I'm pretty sure it eventually calls CreateProcess

0 Likes
CJ McAllister Absent Member.
Absent Member.

RE: BoundsChecker hangs when main process creates command line process

Just to add some more detail to the situation: The problem seems to occur because the instrumented Main.exe is running much more slowly than Foo.exe. This is the case even when Foo.exe is instrumented.

Foo.exe communicates with Main.exe through callbacks and such, and this appears to function as expected for a few seconds. However, Foo.exe then completes its run and exits, leaving the sluggish Main.exe still waiting for it to finish, because the proper message was not received when Foo.exe exited. I can't be 100% that this is what is happening, but it seems to be the most likely scenario.

Hopefully that clarifies the situation a little more

0 Likes
Highlighted
mlevis Absent Member.
Absent Member.

RE: BoundsChecker hangs when main process creates command line process

You might want to limit what is instrumented in main.exe by adding the following to the C/C++ options in the project settings /nmignore:*:*std::*

Another thing might be to limit what is being looked at in the settings for boudschecker.

a third might be to also put the overhead of being run under boudschecker by also opening a standalone Error Detection and wait for process of foo.exe

0 Likes
Rick Papo Absent Member.
Absent Member.

RE: BoundsChecker hangs when main process creates command line process

If BC is somehow slowing down the process spawn API enough to change it's behavior, I would like to see the code.

0 Likes
CJ McAllister Absent Member.
Absent Member.

RE: BoundsChecker hangs when main process creates command line process

Unfortunately, I don't believe I can provide any code; proprietary and whatnot. I'll give mlevis's suggestions a try though, and hopefully make some progress that way

0 Likes
Rick Papo Absent Member.
Absent Member.

RE: BoundsChecker hangs when main process creates command line process

BoundsChecker should not change the behavior of an application, except in one area: speed.  We have had occasions when we've had to ask a customer to greatly enlarge their timeouts when testing their code with BC.

0 Likes
CJ McAllister Absent Member.
Absent Member.

RE: BoundsChecker hangs when main process creates command line process

I'll look into extending the timeouts. I'm getting a little more consistent behavior with the previous recommendations, but the base issue remains unfortunately

0 Likes
Rick Papo Absent Member.
Absent Member.

RE: BoundsChecker hangs when main process creates command line process

Remember what I said about "should".  If BoundsChecker is altering the program's flow of execution in other ways, we need to determine just why.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.