Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 624253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:10:50+00:00 2026-05-13T19:10:50+00:00

This might not appear like a programming question, but inherently deals with code. I

  • 0

This might not appear like a programming question, but inherently deals with code.

I have a following piece of test-code, which has obvious errors like array index out of bounds, memory leak:-

#include "stdio.h"
#include "stdlib.h"
main()
{
   int i;
   char *ptr;
   ptr = (char*)malloc(5);
   for(i=0;i<10;i++)
   {
      ptr[i]=(char)i;
   }

}

This code is built on a MS-Visual Studio 2008.

I am trying to use Rational Purify (version 7.0) to identify run-time errors, memory leaks in my code. Towards after reading some pointers about how to build code for usage in Purify, i have done below things in the MSVS-2008 project settings:-

1.)Disable incremental link 2.) Debug information compiler flag is /Zi

3.) Set the Linker option – “Basic run-time checking to value Default.

4.) Added a extra linker option /fixed:no.

5.) Build config is debug, no optimization enabled.

Then i build and get the exe. I use this exe to run in Purify so that it instruments the same. But the output window in purify after running/instrumenting this exe, shows no errors about memory leak, ..etc which are present in the code above.

The purify output window shows output of different binaries (my exe file and some other system dlls) it instrumented loaded, executed. But in the output where is shows data about my exe, there is no error message.

My feeling is i am making a mistake in giving compilation/linker options while building the exe in MS-VS 2008.or The generated executable format is not compatible/understandable by Purify?

1.)What could be wrong here? What more options i could need while building the exe?

2.)Is my process of using Purify correct, or am i missing something? How can i get Purify to show all the errors in my program after doing run time analysis?

3.)Is there any other tool (free/commercial license)which can detecl memory leaks, array out of bound errors, use of uninitialized pointers, variables, memory corruption etc.. by doing run time analysis of C code.

Sorry for longish mail, but had to be clear.

thanks.

-AD

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:10:50+00:00Added an answer on May 13, 2026 at 7:10 pm

    After furiously trying many things, reading on internet, i found out the soln. for this

    1) Add a new environment variable as :

    Name = IBM_RATIONAL_PURIFY_ENABLE_SELECTIVE

    Vale = 1

    2) Apart from the MS Visual Studio project settings which i mentioned in the OP, below setting is needed –

    C/C++–>Code Generation = Run time library –> Multi-threaded Debug /MTd

    And when u run the executable in purify, you have to click on Configure Selective, select your exe.

    Then when u run, it should colelct the required error related information.

    -AD

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 408k
  • Answers 408k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use negative assertion: (?!.*\S{25}) \S{25} matches a sequence of 25… May 15, 2026 at 6:52 am
  • Editorial Team
    Editorial Team added an answer http://reader.google.com May 15, 2026 at 6:52 am
  • Editorial Team
    Editorial Team added an answer Set the SO_REUSEADDR socket option before binding to the listening… May 15, 2026 at 6:52 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.