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
Highlighted
vikrantl Absent Member.
Absent Member.
2688 views

Not able to find memory leak in a basic C program

Team/friends,

I have writtern a simple C program on WIndows 7.

In stanadalone mode (NO VC) I am trying to run

bc.exe myprogram.exe

-No memory leak is detected

-The UI says

No source file

I tried with all settings mentioned in the help pages "Memory Tacking" and other settings.

The license server is configured good.

The program is configured in debug mode, with no instrumentation.

Can anyone suggest the core problem?

Thanks,

-Vikrant

DPS BoundsCheckerv 11.2.1181.0

0 Likes
4 Replies
ppimental Absent Member.
Absent Member.

RE: Not able to find memory leak in a basic C program

After you launch BC.exe there are two options to start a profiling session:

1. Select the .exe you want to profile, under File/Open. Then select Program\Start (F5)

2. Select the .exe you want to profile, under File/Open. Then select Program\Wait for Process, and then start your application as normal.

Which option did you use when attempting to profile the application?

0 Likes
vikrantl Absent Member.
Absent Member.

RE: Not able to find memory leak in a basic C program

Used the first one. I selected Enable memory tracking in the options.

As I was not able to do with option#1, I also had tried option #2 (waiting for the process)

Here is my simple C code

----

void nothin4g(void)

{

char* p = (char*) malloc(123224);

char* q = (char*) malloc(322223);

p = q+1;

p = (char*) malloc(322223);

}

int main(int argc, char* argv[])

{

nothin4g();

printf("\ngetche");

_getche();

return 0;

}

----

0 Likes
ppimental Absent Member.
Absent Member.

RE: Not able to find memory leak in a basic C program

Hello Vikrant. I noted that you have generated a support incident and have updated you on my findings.  

0 Likes
ppimental Absent Member.
Absent Member.

RE: Not able to find memory leak in a basic C program

In this case, the product was not catching the leak, but this was resolved in 11.3 build 1443, released  in September 2015. GA releases 11.3 HF2 and HF3 also contain the fix.

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.